/** * @param symbol */ public synchronized void putSymbol( ISymbol symbol ) { getThreadLocalSymbolTable().putSymbol( symbol ); }
public ISymbol getSymbol( String name ) { return _table.getSymbol( name ); } }
private static void debugInfo( ISymbolTable compileTimeLocalContextSymbols ) { if( compileTimeLocalContextSymbols != null ) { Map symbols = compileTimeLocalContextSymbols.getSymbols(); for( Object key : symbols.keySet() ) { Object o = symbols.get( key ); System.out.println( "SYMBOL NAME: " + key + " SYMBOL: " + o ); } } }
private boolean isLocalVarTopLevelFunctionBodyStmt() { if( _symTable.getScopeCount() > 1 ) { return _symTable.peekScope( 1 ).getActivationCtx() != null; } return false; }
private void addStaticSymbols(ISymbolTable symbolTable, GosuParser parser, IGosuClassInternal supertype) { supertype.putClassMembers( parser, symbolTable, supertype, true ); for(Object entryObj : symbolTable.getSymbols().entrySet()) { @SuppressWarnings({"unchecked"}) Entry<CharSequence, ISymbol> entry = (Entry<CharSequence, ISymbol>) entryObj; if((entry.getValue()).isPrivate()) { symbolTable.removeSymbol(entry.getKey()); } } }
public void compile( Stack<IScriptPartId> scriptPartIdStack, ISymbolTable symTable, Map<String, List<IFunctionSymbol>> dfsDeclByName, ITypeUsesMap typeUsesMap, Stack<BlockExpression> blocks, ContextInferenceManager ctxInferenceMgr) throws TemplateParseException { symTable.pushScope(); if (ctxInferenceMgr != null) { ctxInferenceMgr.suspendRefCollection(); try symTable.putSymbol( PRINT_CONTENT_SYMBOL.get() ); symTable.putSymbol( PRINT_RANGE_SYMBOL.get() ); symTable.putSymbol(s); _compileTimeSymbolTable = symTable.copy(); symTable.popScope(); if (ctxInferenceMgr != null) { ctxInferenceMgr.resumeRefCollection();
private void maybeAddLocalsOfEnclosingType() { if( shouldSnapshotSymbols() ) { // add in outer class symbols if this is an editor parser ISymbolTable completionSymbolTable = getSymbolTable(); ICompilableTypeInternal gosuClass = getGosuClass(); if( gosuClass != null ) { ICompilableTypeInternal enclosingType = gosuClass.getEnclosingType(); while( enclosingType != null) { ISymbolTable symbolTableForClass = getSymbolTableForClass( enclosingType ); if( symbolTableForClass != null ) { for( Object key : symbolTableForClass.getSymbols().keySet() ) { String name = key.toString(); if( completionSymbolTable.getSymbol( name ) == null ) { completionSymbolTable.putSymbol( symbolTableForClass.getSymbol( name ) ); } } } enclosingType = enclosingType.getEnclosingType(); } } } }
for( Object entryObj : _symTable.getSymbols().entrySet() ) { _symTable.removeSymbol( entry.getKey() ); if( processDirectives ) { for( ISymbol param : params ) { getSymbolTable().putSymbol( param );
ArrayList<ISymbol> symbols = new ArrayList<ISymbol>( _interactiveSymbolTable.getSymbols().values() ); Collections.sort( symbols, new Comparator<ISymbol>() if ( _interactiveSymbolTable.getSymbol( sym ) == null ) try _interactiveSymbolTable.removeSymbol( sym );
private void putStaticProperties( ISymbolTable table, IGosuClassInternal gsContextClass, boolean bSuperClass, boolean bStaticImport ) { List<DynamicPropertySymbol> staticProperties = getStaticProperties(); for( int i = 0; i < staticProperties.size(); i++ ) { DynamicPropertySymbol dps = staticProperties.get( i ); if( !bSuperClass || (isAccessible( gsContextClass, dps ) && !isHidden( dps )) ) { if( isParameterizedType() ) { dps = dps.getParameterizedVersion( (IGosuClass) getOrCreateTypeReference()); } if( !bStaticImport || table.getSymbol( dps.getName() ) == null ) { table.putSymbol( dps ); } } } }
public ISymbol removeSymbol( CharSequence name ) { ISymbolTable targetSymTable = getTargetSymbolTable(); return targetSymTable.removeSymbol( name ); }
public ISymbol getThisSymbolFromStackOrMap() { ISymbolTable targetSymTable = getTargetSymbolTable(); return targetSymTable.getThisSymbolFromStackOrMap(); }
public ISymbolTable copy() { ISymbolTable targetSymTable = getTargetSymbolTable(); return targetSymTable.copy(); }
public IScope peekIsolatedScope() { ISymbolTable symbolTable = getTargetSymbolTable(); return symbolTable.peekIsolatedScope(); }
public boolean isSymbolWithinScope( ISymbol sym, IScope scope ) { ISymbolTable symbolTable = getTargetSymbolTable(); return symbolTable.isSymbolWithinScope( sym, scope ); }
public int getScopeCount() { ISymbolTable targetSymTable = getTargetSymbolTable(); return targetSymTable.getScopeCount(); }
public void compile( java.util.Stack<IScriptPartId> scriptPartIdStack, ISymbolTable symTable, Map<String, Set<IFunctionSymbol>> dfsDeclByName, ITypeUsesMap typeUsesMap, Stack<BlockExpression> blocks, ContextInferenceManager ctxInferenceMgr) throws TemplateParseException { symTable.pushScope(); if (ctxInferenceMgr != null) { ctxInferenceMgr.suspendRefCollection(); try symTable.putSymbol( PRINT_CONTENT_SYMBOL.get() ); symTable.putSymbol( PRINT_RANGE_SYMBOL.get() ); symTable.putSymbol(s); _compileTimeSymbolTable = symTable.copy(); symTable.popScope(); if (ctxInferenceMgr != null) { ctxInferenceMgr.resumeRefCollection();
private void maybeAddLocalsOfEnclosingType() { if( shouldSnapshotSymbols() ) { // add in outer class symbols if this is an editor parser ISymbolTable completionSymbolTable = getSymbolTable(); ICompilableTypeInternal gosuClass = getGosuClass(); if( gosuClass != null ) { ICompilableTypeInternal enclosingType = gosuClass.getEnclosingType(); while( enclosingType != null) { ISymbolTable symbolTableForClass = getSymbolTableForClass( enclosingType ); if( symbolTableForClass != null ) { for( Object key : symbolTableForClass.getSymbols().keySet() ) { String name = key.toString(); if( completionSymbolTable.getSymbol( name ) == null ) { completionSymbolTable.putSymbol( symbolTableForClass.getSymbol( name ) ); } } } enclosingType = enclosingType.getEnclosingType(); } } } }
for( Object entryObj : _symTable.getSymbols().entrySet() ) if( entry.getValue().isPrivate() ) _symTable.removeSymbol( entry.getKey() ); getSymbolTable().putSymbol( param );
ArrayList<ISymbol> symbols = new ArrayList<ISymbol>( _interactiveSymbolTable.getSymbols().values() ); Collections.sort( symbols, new Comparator<ISymbol>() if ( _interactiveSymbolTable.getSymbol( sym ) == null ) try _interactiveSymbolTable.removeSymbol( sym );