@Test public void testExtractReturnTypeName() throws Exception { DataType voidDt = BuiltInDataTypeManager.getDataTypeManager().getDataType("/void"); assertEquals(voidDt, parser.extractReturnType("void bob(int a)")); assertEquals(voidDt, parser.extractReturnType("void bob (int a)")); }
DataType extractReturnType(String signatureText) throws ParseException { int parenIndex = signatureText.indexOf('('); if (parenIndex < 0) { throw new ParseException("Can't find return type"); } String[] split = StringUtils.split(signatureText.substring(0, parenIndex)); if (split.length < 2) { throw new ParseException("Can't find return type"); } String returnTypeName = StringUtils.join(split, " ", 0, split.length - 1); DataType dt = resolveDataType(returnTypeName); if (dt == null) { throw new ParseException("Can't resolve return type: " + returnTypeName); } return dt; }
FunctionSignatureParser { DataType extractReturnType(String signatureText) throws ParseException { int parenIndex = signatureText.indexOf('('); if (parenIndex < 0) { throw new ParseException("Can't find return type"); } String[] split = StringUtils.split(signatureText.substring(0, parenIndex)); if (split.length < 2) { throw new ParseException("Can't find return type"); } String returnTypeName = StringUtils.join(split, " ", 0, split.length - 1); DataType dt = resolveDataType(returnTypeName); if (dt == null) { throw new ParseException("Can't resolve return type: " + returnTypeName); } return dt; } }
FunctionSignatureParser { DataType extractReturnType(String signatureText) throws ParseException { int parenIndex = signatureText.indexOf('('); if (parenIndex < 0) { throw new ParseException("Can't find return type"); } String[] split = StringUtils.split(signatureText.substring(0, parenIndex)); if (split.length < 2) { throw new ParseException("Can't find return type"); } String returnTypeName = StringUtils.join(split, " ", 0, split.length - 1); DataType dt = resolveDataType(returnTypeName); if (dt == null) { throw new ParseException("Can't resolve return type: " + returnTypeName); } return dt; } FunctionSignatureParser(Program program, DataTypeManagerService service); }
FunctionSignatureParser { DataType extractReturnType(String signatureText) throws ParseException { int parenIndex = signatureText.indexOf('('); if (parenIndex < 0) { throw new ParseException("Can't find return type"); } String[] split = StringUtils.split(signatureText.substring(0, parenIndex)); if (split.length < 2) { throw new ParseException("Can't find return type"); } String returnTypeName = StringUtils.join(split, " ", 0, split.length - 1); DataType dt = resolveDataType(returnTypeName); if (dt == null) { throw new ParseException("Can't resolve return type: " + returnTypeName); } return dt; } FunctionSignatureParser(Program program, DataTypeManagerService service); FunctionDefinitionDataType parse(FunctionSignature originalSignature,
			String signatureText); }
FunctionSignatureParser { DataType extractReturnType(String signatureText) throws ParseException { int parenIndex = signatureText.indexOf('('); if (parenIndex < 0) { throw new ParseException("Can't find return type"); } String[] split = StringUtils.split(signatureText.substring(0, parenIndex)); if (split.length < 2) { throw new ParseException("Can't find return type"); } String returnTypeName = StringUtils.join(split, " ", 0, split.length - 1); DataType dt = resolveDataType(returnTypeName); if (dt == null) { throw new ParseException("Can't resolve return type: " + returnTypeName); } return dt; } FunctionSignatureParser(Program program, DataTypeManagerService service); FunctionDefinitionDataType parse(FunctionSignature originalSignature,
			String signatureText);  }