@Test public void testParseInLineDeclaration() { final SubroutineDeclaration declaration = parser .parse("subroutine ( in_line_sub(person_id = f8, name = vc(ReF)) = i2 with protect ) "); assertThat(declaration.getName()).isEqualTo("in_line_sub"); assertThat(declaration.getReturnType().getDataType()).isEqualTo(DataType.I2); final List<SubroutineArgumentDeclaration> arguments = declaration.getArguments(); final SubroutineArgumentDeclaration personId = arguments.get(0); assertThat(personId).isNotNull(); assertThat(personId.getName()).isEqualTo("person_id"); assertThat(personId.getDataType()).isEqualTo(DataType.F8); assertThat(personId.isByRef()).isFalse(); final SubroutineArgumentDeclaration nameArg = arguments.get(1); assertThat(nameArg).isNotNull(); assertThat(nameArg.getName()).isEqualTo("name"); assertThat(nameArg.getDataType()).isEqualTo(DataType.VC); assertThat(nameArg.isByRef()).isTrue(); }
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);  }