private IGosuProgram parseProgram( String expr ) throws ParseResultsException { IGosuProgramParser programParser = GosuParserFactory.createProgramParser(); ParserOptions parserOptions = new ParserOptions(); parserOptions.withTypeUsesMap( _interactiveTypeUsesMap ); IParseResult result = programParser.parseExpressionOrProgram( expr, _interactiveSymbolTable, parserOptions ); return result.getProgram(); }
private IGosuProgram parseProgram( String expr ) throws ParseResultsException { IGosuProgramParser programParser = GosuParserFactory.createProgramParser(); ParserOptions parserOptions = new ParserOptions(); parserOptions.withTypeUsesMap( _interactiveTypeUsesMap ); IParseResult result = programParser.parseExpressionOrProgram( expr, _interactiveSymbolTable, parserOptions ); return result.getProgram(); }
new ParserOptions() .withFileContext(fileContext) .withTypeUsesMap(typeUses); return options;
public static AardvarkProgram parse(Project project, File baseDir, Reader reader) throws ParseResultsException { try { String content = StreamUtil.getContent(reader); IGosuProgramParser programParser = GosuParserFactory.createProgramParser(); List<String> packages = getDefaultTypeUsesPackages(); ITypeUsesMap typeUses = CommonServices.getGosuIndustrialPark().createTypeUsesMap(packages); for( String aPackage : packages ) { typeUses.addToDefaultTypeUses( aPackage ); } IType supertype = TypeSystem.getByFullName("gw.vark.AardvarkFile"); ParserOptions options = new ParserOptions().withTypeUsesMap(typeUses).withSuperType(supertype); IParseResult result = programParser.parseExpressionOrProgram( content, new StandardSymbolTable( true ), options ); AardvarkProgram aardvarkProgram = new AardvarkProgram(project, baseDir, result.getProgram()); project.addReference(REF_ID, aardvarkProgram); return aardvarkProgram; } catch (IOException e) { throw GosuExceptionUtil.forceThrow(e); } }
ParserOptions parserOptions = new ParserOptions().withTypeUsesMap( usesMap ); IGosuFragment fragment; try
IType enclType = TypeLord.getPureGenericType( outerMostEnclosingType instanceof IGosuClass ? outerMostEnclosingType : ownersType ); ParserOptions options = new ParserOptions() .withTypeUsesMap( usesMap ) .withEnclosingType( enclType.getName() ) .withExpectedType(type)
ParserOptions options = new ParserOptions().withTypeUsesMap( usesMap ); IGosuParser parser = GosuParserFactory.createParser( _newExpressionAsString ); options.setParserOptions( parser );
ParserOptions options = new ParserOptions().withTypeUsesMap( usesMap ); IGosuParser parser = GosuParserFactory.createParser( _newExpressionAsString ); options.setParserOptions( parser );
ParserOptions options = new ParserOptions().withTypeUsesMap( getTypeUsesMap() ) .withExpectedType( elem.getReturnType() ) .withTokenizerInstructor( getTokenizerInstructor() )
ParserOptions options = new ParserOptions().withTypeUsesMap( getTypeUsesMap() ) .withExpectedType( elem.getReturnType() ) .withTokenizerInstructor( getTokenizerInstructor() )