@Override public ISymbolTable getSymbolTable() { if( _symTable == null ) { _symTable = new StandardSymbolTable( true ); } return _symTable; }
@Override public ISymbolTable getSymbolTable() { if( _symTable == null ) { _symTable = new StandardSymbolTable( true ); } return _symTable; }
public ISymbolTable createSymbolTable() { return new StandardSymbolTable(); }
public ThreadSafeSymbolTable( boolean bDefineCommonSymbols ) { _defaultSymTable = new StandardSymbolTable( bDefineCommonSymbols ); }
public ISymbolTable copy() { return new StandardSymbolTable( this ); }
public void pushCompileTimeSymbolTable( ISymbolTable symTable ) { // push on a clean symbol table for parsing pushSymTableCtx( symTable == this ? new StandardSymbolTable( true ) : symTable ); }
public void pushCompileTimeSymbolTable( ISymbolTable symTable ) { // push on a clean symbol table for parsing pushSymTableCtx( symTable == this ? new StandardSymbolTable( true ) : symTable ); }
private static Stack getSymbolTableStack() { Stack stack = SYM_TABLE_STACK.get(); if( stack == null ) { stack = new Stack(); stack.push( new StandardSymbolTable( true ) ); SYM_TABLE_STACK.set( stack ); } return stack; }
private static Stack getSymbolTableStack() { Stack stack = SYM_TABLE_STACK.get(); if( stack == null ) { stack = new Stack(); stack.push( new StandardSymbolTable( true ) ); SYM_TABLE_STACK.set( stack ); } return stack; }
public InteractiveShell( boolean logOutput ) { _interactiveTypeUsesMap = CommonServices.getGosuIndustrialPark().createTypeUsesMap( Collections.<String>emptyList() ); _interactiveSymbolTable = new StandardSymbolTable( true ); _completionHandler = new CompletionHandler( _interactiveSymbolTable, _interactiveTypeUsesMap ); _logOutput = logOutput; }
public InteractiveShell( boolean logOutput ) { _interactiveTypeUsesMap = CommonServices.getGosuIndustrialPark().createTypeUsesMap( Collections.<String>emptyList() ); _interactiveSymbolTable = new StandardSymbolTable( true ); _completionHandler = new CompletionHandler( _interactiveSymbolTable, _interactiveTypeUsesMap ); _logOutput = logOutput; }
public static IExpression compileExpression(String script, String varName, IType varType) throws ParseResultsException { StandardSymbolTable symbolTable = new StandardSymbolTable( true ); symbolTable.putSymbol( GosuShop.createSymbol( varName, varType, null ) ); return compileExpression(script, symbolTable ); }
public static IExpression compileExpression(String script, String varName, IType varType, String varName2, IType varType2) throws ParseResultsException { StandardSymbolTable symbolTable = new StandardSymbolTable( true ); symbolTable.putSymbol( GosuShop.createSymbol( varName, varType, null ) ); symbolTable.putSymbol( GosuShop.createSymbol( varName2, varType2, null ) ); return compileExpression(script, symbolTable ); }
private static ISymbolTable findCompileTimeSymbols( IGosuClassInternal enclosingClass, int iLocation ) { ISymbolTable symTable = new StandardSymbolTable( false ); IParseTree deepestLocation = enclosingClass.getClassStatement().getClassFileStatement().getLocation().getDeepestLocation( iLocation, false ); collectLocalSymbols( enclosingClass, symTable, deepestLocation.getParsedElement(), iLocation ); return symTable; }
public void update() { initType(); createNewParseInfo(); getParseInfo().addDefaultConstructor( new StandardSymbolTable(), null ); // implement the one method that blocks implement implementInvoke(); implementToString(); }
private void markErrorsOnAssignmentsToFinal( IVarStatement varStmt, ArrayList<AssignmentOrReference> assignments ) { for( AssignmentOrReference assignment : assignments ) { if( assignment.getStmt() instanceof IStatement ) { IStatement s = (IStatement)assignment.getStmt(); ParseException parseException = new ParseException( s.getLineNum(), 1, s.getLocation().getColumn(), s.getLocation().getOffset(), s.getLocation().getExtent(), new StandardSymbolTable(), Res.MSG_CANNOT_ASSIGN_VALUE_TO_FINAL_VAR, varStmt.getSymbol().getName() ); s.addParseException( parseException ); } } }
private void markErrorsOnAssignmentsToFinal( IVarStatement varStmt, ArrayList<AssignmentOrReference> assignments ) { for( AssignmentOrReference assignment : assignments ) { if( assignment.getStmt() instanceof IStatement ) { IStatement s = (IStatement)assignment.getStmt(); ParseException parseException = new ParseException( s.getLineNum(), 1, s.getLocation().getColumn(), s.getLocation().getOffset(), s.getLocation().getExtent(), new StandardSymbolTable(), Res.MSG_CANNOT_ASSIGN_VALUE_TO_FINAL_VAR, varStmt.getSymbol().getName() ); s.addParseException( parseException ); } } }
private static ISymbolTable findCompileTimeSymbols( IGosuClassInternal enclosingClass, int iLocation ) { ISymbolTable symTable = new StandardSymbolTable( false ); while( enclosingClass.getClassStatement().getLocation() == null ) { enclosingClass = (IGosuClassInternal)enclosingClass.getEnclosingType(); } IParseTree deepestLocation = enclosingClass.getClassStatement().getLocation().getDeepestLocation( iLocation, false ); collectLocalSymbols( enclosingClass, symTable, deepestLocation.getParsedElement(), iLocation ); return symTable; }
private void implementToString() { Identifier thisId = new Identifier(); thisId.setSymbol( new Symbol( Keyword.KW_this.getName(), this, null ), new StandardSymbolTable() ); thisId.setType( this ); BeanMethodCallExpression toStrCall = new BeanMethodCallExpression(); toStrCall.setMethodDescriptor( JavaTypes.IBLOCK().getTypeInfo().getMethod( "toString" ) ); toStrCall.setRootExpression( thisId ); toStrCall.setType( JavaTypes.STRING() ); ReturnStatement returnStmt = new ReturnStatement(); returnStmt.setValue( toStrCall ); }
private void implementToString() { Identifier thisId = new Identifier(); thisId.setSymbol( new Symbol( Keyword.KW_this.getName(), this, null ), new StandardSymbolTable() ); thisId.setType( this ); BeanMethodCallExpression toStrCall = new BeanMethodCallExpression(); toStrCall.setMethodDescriptor( JavaTypes.IBLOCK().getTypeInfo().getMethod( "toString" ) ); toStrCall.setRootExpression( thisId ); toStrCall.setType( JavaTypes.STRING() ); ReturnStatement returnStmt = new ReturnStatement(); returnStmt.setValue( toStrCall ); }