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 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 ); } } }
public Map getSymbols() { ISymbolTable targetSymTable = getTargetSymbolTable(); return targetSymTable.getSymbols(); }
public Map getSymbols() { ISymbolTable targetSymTable = getTargetSymbolTable(); return targetSymTable.getSymbols(); }
public Map getSymbols( int iScopeOffset, int iPrivateGlobalIndex ) { ISymbolTable targetSymTable = getTargetSymbolTable(); return targetSymTable.getSymbols( iScopeOffset, iPrivateGlobalIndex ); }
public Map getSymbols( int iScopeOffset, int iPrivateGlobalIndex ) { ISymbolTable targetSymTable = getTargetSymbolTable(); return targetSymTable.getSymbols( iScopeOffset, iPrivateGlobalIndex ); }
private void putSymbols( ISymbolTable symTable, HashMap<String, ISymbol> externalSymbolsMap ) { Map symbols = symTable.getSymbols(); if( symbols != null ) { //noinspection unchecked for( ISymbol sym : (Collection<ISymbol>)symbols.values() ) { if( !(sym instanceof CommonSymbolsScope.LockedDownSymbol) && sym != null ) { externalSymbolsMap.put( (String)sym.getName(), sym ); } } } } }
private void putSymbols( ISymbolTable symTable, HashMap<String, ISymbol> externalSymbolsMap ) { Map symbols = symTable.getSymbols(); if( symbols != null ) { //noinspection unchecked for( ISymbol sym : (Collection<ISymbol>)symbols.values() ) { if( !(sym instanceof CommonSymbolsScope.LockedDownSymbol) && sym != null ) { externalSymbolsMap.put( (String)sym.getName(), sym ); } } } }
public void putDfsDeclsInTable( ISymbolTable table ) { if( table == null ) { return; } for( Iterator iterator = table.getSymbols().values().iterator(); iterator.hasNext(); ) { ISymbol symbol = (ISymbol)iterator.next(); if( symbol instanceof IDynamicFunctionSymbol ) { putDfsDeclInSetByName( (IDynamicFunctionSymbol)symbol ); } } }
public void putDfsDeclsInTable( ISymbolTable table ) { if( table == null ) { return; } for( Iterator iterator = table.getSymbols().values().iterator(); iterator.hasNext(); ) { ISymbol symbol = (ISymbol)iterator.next(); if( symbol instanceof DynamicFunctionSymbol ) { putDfsDeclInSetByName( (DynamicFunctionSymbol)symbol ); } } }
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()); } } }
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()); } } }
private IType[] getAllBeans() { ArrayList<IType> beans = new ArrayList<IType>(); Collection<ISymbol> list = getEditor().getSymbolTable().getSymbols().values(); for( ISymbol sym : list ) { if( TypeSystem.isBeanType( sym.getType() ) ) { beans.add( sym.getType() ); } } return beans.toArray( new IType[beans.size()] ); }
private IType[] getAllBeans() { ArrayList<IType> beans = new ArrayList<IType>(); Collection<ISymbol> list = getEditor().getSymbolTable().getSymbols().values(); for( ISymbol sym : list ) { if( TypeSystem.isBeanType( sym.getType() ) ) { beans.add( sym.getType() ); } } return beans.toArray( new IType[beans.size()] ); }
private int handleIdentifier( List candidates, IParsedElement element ) { IIdentifierExpression identifier = (IIdentifierExpression)element; String prefix = identifier.getSymbol().getName(); ArrayList<String> symNames = new ArrayList<String>(); for( Object symbolName : _symbolTable.getSymbols().keySet() ) { symNames.add( symbolName.toString() ); } Collections.sort( symNames ); for( String name : symNames ) { if( name.startsWith( prefix ) ) { //noinspection unchecked candidates.add( name ); } } return identifier.getLocation().getColumn() - 1; } }
private int handleIdentifier( List candidates, IParsedElement element ) { IIdentifierExpression identifier = (IIdentifierExpression)element; String prefix = identifier.getSymbol().getName(); ArrayList<String> symNames = new ArrayList<String>(); for( Object symbolName : _symbolTable.getSymbols().keySet() ) { symNames.add( symbolName.toString() ); } Collections.sort( symNames ); for( String name : symNames ) { if( name.startsWith( prefix ) ) { //noinspection unchecked candidates.add( name ); } } return identifier.getLocation().getColumn() - 1; } }
public void addCapturedProgramSymbols( ISymbolTable classCompilationSymTable ) { ISymbolTable symTable = getSymbolTable(); if( symTable == null ) { return; } //External symbols are not allowed if there is an explicit super type if ( !Util.getGosuClassFrom( JavaTypes.OBJECT() ).equals( getSupertype() ) ) { return; } HashMap<String, ISymbol> externalSymbolsMap = new HashMap<String, ISymbol>( 8 ); getParseInfo().setExternalSymbols(new ExternalSymbolMapForMap(externalSymbolsMap)); Map symbols = symTable.getSymbols(); if( symbols == null ) { return; } //noinspection unchecked for( ISymbol sym : (Collection<ISymbol>)symbols.values() ) { if( !(sym instanceof CommonSymbolsScope.LockedDownSymbol) && sym != null ) { externalSymbolsMap.put( (String)sym.getName(), sym ); } } }
private void maybeSetExternalSymbols() { if( getGosuClass() instanceof IGosuProgram ) { ISourceFileHandle sfh = getGosuClass().getSourceFileHandle(); if( sfh instanceof StringSourceFileHandle ) { ISymbolTable extSyms = ((StringSourceFileHandle)sfh).getExternalSymbols(); if( extSyms != null ) { // If extSyms is non-null, it usually means this program is for context-sensitive evaluation e.g., in a debugger HashMap<String, ISymbol> map = new HashMap<String, ISymbol>(); //noinspection unchecked for( Symbol s: (Collection<Symbol>)extSyms.getSymbols().values() ) { map.put( s.getName(), s ); } ExternalSymbolMapForMap extMap = new ExternalSymbolMapForMap( map ); ((GosuProgramParseInfo)getGosuClass().getParseInfo()).setExternalSymbols( extMap ); } } } }
private void maybeSetExternalSymbols() { if( getGosuClass() instanceof IGosuProgram ) { ISourceFileHandle sfh = getGosuClass().getSourceFileHandle(); if( sfh instanceof StringSourceFileHandle ) { ISymbolTable extSyms = ((StringSourceFileHandle)sfh).getExternalSymbols(); if( extSyms != null ) { // If extSyms is non-null, it usually means this program is for context-sensitive evaluation e.g., in a debugger HashMap<String, ISymbol> map = new HashMap<>(); //noinspection unchecked for( Symbol s: (Collection<Symbol>)extSyms.getSymbols().values() ) { if( s.isLocal() ) { map.put( s.getName(), s ); } } ExternalSymbolMapForMap extMap = new ExternalSymbolMapForMap( map ); ((GosuProgramParseInfo)getGosuClass().getParseInfo()).setExternalSymbols( extMap ); } } } }
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(); } } } }