@Test public void testParseMissingArgumentEqualsDeclared() { final SubroutineDeclaration declaration = parser.parse( "declare getDisplayDetails(SourceRec, schEventIdRec, appointmentType = i4(ref)) = null with protect"); final List<SubroutineArgumentDeclaration> arguments = declaration.getArguments(); assertThat(arguments.get(0).getName()).isEqualTo("SourceRec"); assertThat(arguments.get(0).isByRef()).isEqualTo(false); assertThat(arguments.get(0).getDataType()).isEqualTo(DataType.UNKNOWN); assertThat(arguments.get(1).getName()).isEqualTo("schEventIdRec"); assertThat(arguments.get(1).isByRef()).isEqualTo(false); assertThat(arguments.get(1).getDataType()).isEqualTo(DataType.UNKNOWN); assertThat(arguments.get(2).getName()).isEqualTo("appointmentType"); assertThat(arguments.get(2).isByRef()).isEqualTo(true); assertThat(arguments.get(2).getDataType()).isEqualTo(DataType.I4); final SubroutineDeclaration inlineDeclaration = parser.parse( "subroutine(getDisplayDetails(SourceRec, schEventIdRec, appointmentType = vc) = null with protect)"); final List<SubroutineArgumentDeclaration> inlineArguments = inlineDeclaration.getArguments(); assertThat(inlineArguments.get(0).getName()).isEqualTo("SourceRec"); assertThat(inlineArguments.get(0).isByRef()).isEqualTo(false); assertThat(inlineArguments.get(0).getDataType()).isEqualTo(DataType.UNKNOWN); assertThat(inlineArguments.get(1).getName()).isEqualTo("schEventIdRec"); assertThat(inlineArguments.get(1).isByRef()).isEqualTo(false); assertThat(inlineArguments.get(1).getDataType()).isEqualTo(DataType.UNKNOWN); assertThat(inlineArguments.get(2).getName()).isEqualTo("appointmentType"); assertThat(inlineArguments.get(2).isByRef()).isEqualTo(false); assertThat(inlineArguments.get(2).getDataType()).isEqualTo(DataType.VC); }
public SubroutineDeclaration parse(final String declaration) { if (declaration == null) { throw new IllegalArgumentException("Subroutine declaration cannot be null."); } final EtmPoint point = PointFactory.getPoint(getClass(), "parse(String)"); String reducedDeclaration = reduceDeclaration(uncommentDeclaration(declaration).trim()); try { return new SubroutineDeclaration(parseName(declaration, reducedDeclaration), parseReturnType(declaration, reducedDeclaration), parseArguments(reducedDeclaration)); } finally { point.collect(); } }
SubroutineDeclarationParser { public SubroutineDeclaration parse(final String declaration) { if (declaration == null) { throw new IllegalArgumentException("Subroutine declaration cannot be null."); } final EtmPoint point = PointFactory.getPoint(getClass(), "parse(String)"); String reducedDeclaration = reduceDeclaration(uncommentDeclaration(declaration).trim()); try { return new SubroutineDeclaration(parseName(declaration, reducedDeclaration), parseReturnType(declaration, reducedDeclaration), parseArguments(reducedDeclaration)); } finally { point.collect(); } } }
SubroutineDeclarationParser { public SubroutineDeclaration parse(final String declaration) { if (declaration == null) { throw new IllegalArgumentException("Subroutine declaration cannot be null."); } final EtmPoint point = PointFactory.getPoint(getClass(), "parse(String)"); String reducedDeclaration = reduceDeclaration(uncommentDeclaration(declaration).trim()); try { return new SubroutineDeclaration(parseName(declaration, reducedDeclaration), parseReturnType(declaration, reducedDeclaration), parseArguments(reducedDeclaration)); } finally { point.collect(); } }  }
SubroutineDeclarationParser { public SubroutineDeclaration parse(final String declaration) { if (declaration == null) { throw new IllegalArgumentException("Subroutine declaration cannot be null."); } final EtmPoint point = PointFactory.getPoint(getClass(), "parse(String)"); String reducedDeclaration = reduceDeclaration(uncommentDeclaration(declaration).trim()); try { return new SubroutineDeclaration(parseName(declaration, reducedDeclaration), parseReturnType(declaration, reducedDeclaration), parseArguments(reducedDeclaration)); } finally { point.collect(); } }  SubroutineDeclaration parse(final String declaration); }
SubroutineDeclarationParser { public SubroutineDeclaration parse(final String declaration) { if (declaration == null) { throw new IllegalArgumentException("Subroutine declaration cannot be null."); } final EtmPoint point = PointFactory.getPoint(getClass(), "parse(String)"); String reducedDeclaration = reduceDeclaration(uncommentDeclaration(declaration).trim()); try { return new SubroutineDeclaration(parseName(declaration, reducedDeclaration), parseReturnType(declaration, reducedDeclaration), parseArguments(reducedDeclaration)); } finally { point.collect(); } }  SubroutineDeclaration parse(final String declaration);  }