@Test public void testParseIgnoreNotByRef() { final SubroutineDeclaration declaration = parser .parse("declare some_subroutine(arg1=vc(ref), arg2=i4(value,CURREF), arg3=i2(val)) = i2"); assertThat(declaration.getName()).isEqualTo("some_subroutine"); assertThat(declaration.getReturnType().getDataType()).isEqualTo(DataType.I2); assertThat(declaration.getArguments()).hasSize(3); final List<SubroutineArgumentDeclaration> arguments = declaration.getArguments(); final SubroutineArgumentDeclaration arg1 = arguments.get(0); assertThat(arg1).isNotNull(); assertThat(arg1.getName()).isEqualTo("arg1"); assertThat(arg1.getDataType()).isEqualTo(DataType.VC); assertThat(arg1.isByRef()).isTrue(); final SubroutineArgumentDeclaration arg2 = arguments.get(1); assertThat(arg2).isNotNull(); assertThat(arg2.getName()).isEqualTo("arg2"); assertThat(arg2.getDataType()).isEqualTo(DataType.I4); assertThat(arg2.isByRef()).isFalse(); final SubroutineArgumentDeclaration arg3 = arguments.get(2); assertThat(arg3).isNotNull(); assertThat(arg3.getName()).isEqualTo("arg3"); assertThat(arg3.getDataType()).isEqualTo(DataType.I2); assertThat(arg3.isByRef()).isFalse(); }
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);  }