private boolean isTypeUsed( String strType ) { String strRelativeName = TypePopup.getRelativeTypeName( strType ); try { return _gsEditor.getParser().getTypeUsesMap().resolveType( strRelativeName ) != null || TypeSystem.parseType( strRelativeName, _gsEditor.getParser().getTypeUsesMap().copy() ) != null; } catch( Exception e ) { return false; } }
private boolean hasParseIssuesInUsesStatements() { if( (getTypeUsesMap() != null) && (getTypeUsesMap().getUsesStatements() != null) ) { for( IUsesStatement usesStatement : getTypeUsesMap().getUsesStatements() ) { if( usesStatement.hasParseIssues() ) { return true; } } } return false; }
private void maybeHandleUses( IGosuProgram program ) { if( program.getTypeUsesMap() != null && program.getTypeUsesMap().getUsesStatements() != null ) { for( IUsesStatement usesStmt : program.getTypeUsesMap().getUsesStatements() ) { _interactiveTypeUsesMap.addToTypeUses( usesStmt ); } } }
public ParserOptions withDefaultTypeUsesMap() { _typeUsesMap = TypeSystem.getDefaultTypeUsesMap().copy(); return this; }
usesMap = usesMap.copy(); usesMap.addToDefaultTypeUses( "gw.lang." );
void setNamespace( String strNamespace ) { _strNamespace = strNamespace; if( _strNamespace != null ) { getTypeUsesMap().addToTypeUses( strNamespace + ".*" ); } }
private IType getType( String name ) { IType type; try { type = TypeSystem.getByFullName( name ); } catch( Exception e ) { if( _typeUsesMap != null ) { type = _typeUsesMap.resolveType( name ); } else { type = null; } } return type; } }
private static void addEnclosingPackages( ITypeUsesMap map, IType type ) { type = TypeLord.getPureGenericType( type ); type = TypeLord.getOuterMostEnclosingClass( type ); map.addToDefaultTypeUses( GosuClassUtil.getPackage( type.getName() ) + "." ); } }
public void setTypeUsesMap( ITypeUsesMap typeUsesMap ) { _typeUsesMap = typeUsesMap == null ? null : typeUsesMap.copyLocalScope(); }
private void reset() { _stack.clear(); _stackDFS.clear(); _dfsDeclByName.clear(); _typeUsesMap.clearNonDefaultTypeUses(); _strNamespace = null; _locations.clear(); _parsingFunctions.clear(); _parsingFieldInitializer.clear(); _typeVarsByName.clear(); setParsed( false ); }
public ParserOptions withDefaultTypeUsesMap() { _typeUsesMap = TypeSystem.getDefaultTypeUsesMap().copy(); return this; }
usesMap = usesMap.copy(); usesMap.addToDefaultTypeUses( "gw.lang." );
void setNamespace( String strNamespace ) { _strNamespace = strNamespace; if( _strNamespace != null ) { getTypeUsesMap().addToTypeUses( strNamespace + ".*" ); } }
private IType getType( String name ) { IType type; try { type = TypeSystem.getByFullName( name ); } catch( Exception e ) { if( _typeUsesMap != null ) { type = _typeUsesMap.resolveType( name ); } else { type = null; } } return type; } }
private static void addEnclosingPackages(ITypeUsesMap map, IJavaClassInfo type) { map.addToDefaultTypeUses( type.getNamespace() + "."); if (type.getEnclosingType() != null) { addEnclosingPackages(map, type.getEnclosingClass()); } }
public void setTypeUsesMap( ITypeUsesMap typeUsesMap ) { _typeUsesMap = typeUsesMap == null ? null : typeUsesMap.copyLocalScope(); }
private void reset() { _stack.clear(); _stackDFS.clear(); _dfsDeclByName.clear(); _typeUsesMap.clearNonDefaultTypeUses(); _strNamespace = null; _locations.clear(); _parsingFunctions.clear(); _parsingFieldInitializer.clear(); _typeVarsByName.clear(); _typeCache.clear(); setParsed( false ); }
private boolean isTypeUsed( String strType ) { String strRelativeName = TypePopup.getRelativeTypeName( strType ); try { return _gsEditor.getParser().getTypeUsesMap().resolveType( strRelativeName ) != null || TypeSystem.parseType( strRelativeName, _gsEditor.getParser().getTypeUsesMap().copy() ) != null; } catch( Exception e ) { return false; } }
GosuParser( ISymbolTable symTable, IScriptabilityModifier scriptabilityConstraint, ITypeUsesMap tuMap ) { super(); setOwner( this ); setWarnOnCaseIssue( Settings.WARN_ON_CASE_DEFAULT.get() == Boolean.TRUE); setEditorParser( Settings.IDE_EDITOR_PARSER_DEFAULT.get() == Boolean.TRUE); _symTable = symTable; //noinspection unchecked _typeUsesMap = tuMap.copy(); _scriptabilityConstraint = scriptabilityConstraint; _dfsDeclByName = new HashMap<String, Set<IFunctionSymbol>>(); _stack = new Stack<ParsedElement>(); _stackDFS = new Stack<DynamicFunctionSymbol>(); _locations = new ArrayList<ParseTree>(); _parsingFunctions = new ArrayList<FunctionType>(); _parsingFieldInitializer = new ArrayList<VarStatement>(); _typeVarsByName = new HashMap<String, ITypeVariableDefinition>( 2 ); _parsingStaticFeature = new Stack<Boolean>(); _parsingAbstractConstructor = new Stack<Boolean>(); _typeCache = new HashMap<IScriptPartId, Map<String, IType>>(); _bParsed = false; _iReturnOk = 1; }
usesMap = usesMap.copy(); usesMap.addToDefaultTypeUses( "gw.lang." );