@Override public ISymbolTable getSymbolTable() { if( _symTable == null ) { _symTable = new StandardSymbolTable( true ); } return _symTable; }
public ISymbol getThisSymbolFromStackOrMap() { return getSymbol( ISymbol.THIS ); }
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 IScope pushScope() { return addScope( createScope( null ) ); }
StandardSymbolTable defaultSymbols = new StandardSymbolTable(true); @SuppressWarnings({"unchecked"}) ArrayList<ISymbol> symbols = new ArrayList<ISymbol>( _interactiveSymbolTable.getSymbols().values() ); for( ISymbol symbol : symbols ) if ( defaultSymbols.getSymbol( symbol.getName() ) != null ) _interactiveSymbolTable = new StandardSymbolTable( true ); return true;
private ISymbol getGlobalSymbol( CharSequence strName ) { int iSize = _stackScopes.size(); for( int i = 0; i < iSize; i++ ) { // The first activation record marks the floor of global symbols Object obj = _stackScopes.get( i ); IScope scope = (IScope)obj; IActivationContext activationCtx = scope.getActivationCtx(); if( activationCtx != null && !activationCtx.isTransparent() ) { ISymbol privateGlobal = getPrivateGlobalSymbol( strName ); if( privateGlobal != null ) { return privateGlobal; } int iGlobalFloor = i - 1; if( iGlobalFloor >= 0 ) { return getSymbol( strName, iGlobalFloor ); } else { return null; } } } return null; }
public IScope pushScope( IScope scope ) { return addScope( scope ); }
StandardSymbolTable defaultSymbols = new StandardSymbolTable(true); @SuppressWarnings({"unchecked"}) ArrayList<ISymbol> symbols = new ArrayList<ISymbol>( _interactiveSymbolTable.getSymbols().values() ); for( ISymbol symbol : symbols ) if ( defaultSymbols.getSymbol( symbol.getName() ) != null ) _interactiveSymbolTable = new StandardSymbolTable( true ); return true;
private ISymbol getGlobalSymbol( CharSequence strName ) { int iSize = _stackScopes.size(); for( int i = 0; i < iSize; i++ ) { // The first activation record marks the floor of global symbols Object obj = _stackScopes.get( i ); IScope scope = (IScope)obj; IActivationContext activationCtx = scope.getActivationCtx(); if( activationCtx != null && !activationCtx.isTransparent() ) { ISymbol privateGlobal = getPrivateGlobalSymbol( strName ); if( privateGlobal != null ) { return privateGlobal; } int iGlobalFloor = i - 1; if( iGlobalFloor >= 0 ) { return getSymbol( strName, iGlobalFloor ); } else { return null; } } } return null; }
public IScope pushScope() { return addScope( createScope( null ) ); }
public IScope pushScope( IScope scope ) { return addScope( scope ); }
@Override public ISymbolTable getSymbolTable() { if( _symTable == null ) { _symTable = new StandardSymbolTable( true ); } return _symTable; }
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 ); }
public IScope pushIsolatedScope( IActivationContext activationCtx ) { // Mark an activation record. if( activationCtx == null ) { throw new IllegalArgumentException( "The activation context must be non-null" ); } return addScope( createScope( activationCtx ) ); }
public ISymbol getThisSymbolFromStackOrMap() { return getSymbol( ISymbol.THIS ); }
public ISymbolTable createSymbolTable() { return new StandardSymbolTable(); }
private ISymbolTable makeSymTable( Location loc, IType outermostType ) { if( outermostType instanceof IGosuClass ) { return ContextSymbolTableUtil.getSymbolTableAtOffset( (IGosuClass)outermostType, StringUtil.getLineOffset( ((IGosuClass)outermostType).getSource(), loc.lineNumber() ) ); } StandardSymbolTable symTable = new StandardSymbolTable(); IType thisType = TypeSystem.getByFullNameIfValid( loc.declaringType().name().replace( '$', '.' ) ); if( thisType != null ) { symTable.putSymbol( GosuShop.createSymbol( Keyword.KW_this.getName(), thisType, null ) ); } return symTable; }
public IScope pushIsolatedScope( IActivationContext activationCtx ) { // Mark an activation record. if( activationCtx == null ) { throw new IllegalArgumentException( "The activation context must be non-null" ); } return addScope( createScope( activationCtx ) ); }
public ISymbol getSymbol( CharSequence name ) { return getSymbol( name, _stackScopes.size() - 1 ); }
public ThreadSafeSymbolTable( boolean bDefineCommonSymbols ) { _defaultSymTable = new StandardSymbolTable( bDefineCommonSymbols ); }