Uses of Interface
org.ek9lang.compiler.symbols.IScope
Packages that use IScope
Package
Description
B - For the EK9 compiler itself.
Common parts of processing that can be reused across various phases.
E - Initial Symbol definition by traversing the 'ANTLR' - 'AST'.
G - Full Symbol Resolution can now take place.
I - PRE Intermediate Representation generation checks.
K - Intermediate Representation Generation.
Used primarily to hold structures that are related to searching for symbols.
Contains critical general components used in the
Ek9Compiler listeners.
This is the main source of EK9 Symbols used within the compiler.
-
Uses of IScope in org.ek9lang.compiler
Methods in org.ek9lang.compiler that return IScopeModifier and TypeMethodDescriptionParsedModule.getRecordedScope(org.antlr.v4.runtime.tree.ParseTree node) Locate and return a recorded scope against part of the parse tree, this may return null if nothing has been recorded.ParsedModuleTransientData.getRecordedScope(org.antlr.v4.runtime.tree.ParseTree node) Locate and return a recorded scope against part of the parse tree, this may return null if nothing has been recorded.Methods in org.ek9lang.compiler with parameters of type IScopeModifier and TypeMethodDescriptionvoidParsedModule.recordScope(org.antlr.v4.runtime.tree.ParseTree node, IScope withScope) Record a particular node context during listen/visit of a context with a particular scope.voidParsedModuleTransientData.recordScope(org.antlr.v4.runtime.tree.ParseTree node, IScope withScope) Record a particular node context during listen/visit of a context with a particular scope. -
Uses of IScope in org.ek9lang.compiler.common
Methods in org.ek9lang.compiler.common that return IScopeModifier and TypeMethodDescriptionSymbolsAndScopes.enterScope(org.antlr.v4.runtime.tree.ParseTree ctx) Ensure that the correct scope is pushed on to the stack.SymbolsAndScopes.getParentOfTopScope()SymbolsAndScopes.getRecordedScope(org.antlr.v4.runtime.tree.ParseTree node) SymbolsAndScopes.getTopScope()Provides access to the top of the scope stack.ScopeStack.getVeryBaseScope()ScopeStack.peek()Take a look at the top of the stack.ScopeStack.pop()Pop a scope of the stack (exception is empty.Push a scope on to this stack.Methods in org.ek9lang.compiler.common that return types with arguments of type IScopeModifier and TypeMethodDescriptionScopeStack.traverseBackUpStack(IScope.ScopeType scopeType) Navigates back up the scope stack to find the first match of the scope type passed in.SymbolsAndScopes.traverseBackUpStack(IScope.ScopeType scopeType) Navigates back up the scope stack to find the first match of the scope type passed in.Methods in org.ek9lang.compiler.common with parameters of type IScopeModifier and TypeMethodDescriptionbooleanCodeFlowAnalyzer.doesSymbolMeetAcceptableCriteria(ISymbol identifierSymbol, IScope inScope) booleanCodeFlowMap.doesSymbolMeetAcceptableCriteria(ISymbol identifierSymbol, IScope inScope) Check if a variable meets the criteria of being acceptable.voidSymbolsAndScopes.enterNewScope(IScope scope, org.antlr.v4.runtime.tree.ParseTree node) Enter a new scope and record in both the parsed module and push on to the working scope stack.voidSymbolsAndScopes.enterScope(IScope scope) To be used to ensure that a scope has been pushed on to the scopeStack.CodeFlowAnalyzer.getSymbolsNotMeetingAcceptableCriteria(IScope inScope) CodeFlowMap.getSymbolsNotMeetingAcceptableCriteria(IScope inScope) Just provide a list of variables that have not been marked as meeting acceptable criteria in the scope.SymbolsAndScopes.getUninitialisedVariables(IScope inScope) booleanSymbolsAndScopes.isVariableInitialised(ISymbol identifierSymbol, IScope inScope) voidSymbolsAndScopes.markErrorResultAccessSafe(ISymbol identifierSymbol, IScope inScope) voidSymbolsAndScopes.markGetOptionalAccessSafe(ISymbol identifierSymbol, IScope inScope) voidSymbolsAndScopes.markNextIteratorAccessSafe(ISymbol identifierSymbol, IScope inScope) voidSymbolsAndScopes.markOkResultAccessSafe(ISymbol identifierSymbol, IScope inScope) voidSymbolsAndScopes.markSymbolAccessSafe(ISymbol identifierSymbol, IScope inScope) Record an identifier as being safe to access.voidSymbolsAndScopes.markSymbolAsInitialised(ISymbol identifierSymbol, IScope inScope) Record an identifier was initialised.voidCodeFlowAnalyzer.markSymbolAsMeetingAcceptableCriteria(ISymbol identifierSymbol, IScope inScope) voidCodeFlowMap.markSymbolAsMeetingAcceptableCriteria(ISymbol identifierSymbol, IScope inScope) Ensures that an identifier symbol is now marked as meeting the criteria of being acceptable.Push a scope on to this stack.voidSymbolsAndScopes.recordScopeForStackConsistency(IScope scope, org.antlr.v4.runtime.tree.ParseTree node) There are times in parsing/listening when symbols are already defined (due to a developer error).voidCodeFlowAnalyzer.recordSymbol(ISymbol identifierSymbol, IScope inScope) voidCodeFlowMap.recordSymbol(ISymbol identifierSymbol, IScope inScope) Records a symbol against the specific scope if it is a variable to be analysed.voidSymbolsAndScopes.recordSymbolDeclaration(ISymbol identifierSymbol, IScope inScope) Record variable declaration against a specific scope.Constructors in org.ek9lang.compiler.common with parameters of type IScopeModifierConstructorDescriptionScopeStack(IScope base) TypeDefResolver(IScope scopeForResolution) Create new resolver. -
Uses of IScope in org.ek9lang.compiler.phase1
Classes in org.ek9lang.compiler.phase1 that implement interfaces with type arguments of type IScopeModifier and TypeClassDescription(package private) final classJust resolves a number of built-in types so that internal compiler code can be more explicit.(package private) final classJust check is a scope has normal termination.Methods in org.ek9lang.compiler.phase1 with parameters of type IScope -
Uses of IScope in org.ek9lang.compiler.phase3
Classes in org.ek9lang.compiler.phase3 that implement interfaces with type arguments of type IScopeModifier and TypeClassDescription(package private) final classUsed for resolving and recoding of fields on specific types.Methods in org.ek9lang.compiler.phase3 that return IScopeModifier and TypeMethodDescriptionSymbolAccessData.fromScope()Returns the value of thefromScoperecord component.SymbolAccessData.inScope()Returns the value of theinScoperecord component.Methods in org.ek9lang.compiler.phase3 with parameters of type IScopeModifier and TypeMethodDescriptionPropertyFieldOrError.apply(EK9Parser.IdentifierContext ctx, IScope scopeToResolveIn) Constructors in org.ek9lang.compiler.phase3 with parameters of type IScope -
Uses of IScope in org.ek9lang.compiler.phase5
Classes in org.ek9lang.compiler.phase5 that implement interfaces with type arguments of type IScopeModifier and TypeClassDescription(package private) classOnce an expression has been assessed as being simple enough to process, this consumer is called to mark the appropriate symbol(s) used in the expression as safe if the appropriate methods are called.(package private) final classChecks if return variables are initialised.(package private) final classIt may be that before calling this you have determined that 'isSet' has been called or you 'know' that the value of the variable is present and set.Methods in org.ek9lang.compiler.phase5 with parameters of type IScopeModifier and TypeMethodDescriptionvoidExpressionSafeSymbolMarker.accept(EK9Parser.ExpressionContext ctx, IScope scopeMadeSafe) voidReturningVariableOrError.accept(IScope mainScope, EK9Parser.OperationDetailsContext ctx) voidprotected voidAbstractSafeSymbolMarker.assessIsSetCall(ISymbol toBeAssessed, IScope scopeMadeSafe) protected voidAbstractSafeGenericAccessMarker.processExpression(EK9Parser.ExpressionContext ctx, IScope wouldBeSafeScope) protected voidAbstractSafeGenericAccessMarker.processPreFlow(EK9Parser.PreFlowStatementContext ctx, IScope wouldBeSafeScope) protected voidPossibleExpressionConstruct.pullUpAcceptableCriteriaToHigherScope(CodeFlowAnalyzer analyzer, List<IScope> allAppropriateBlocks, IScope outerScope) protected voidPossibleExpressionConstruct.returningVariableValidOrError(EK9Parser.ReturningParamContext ctx, IScope constructScope, boolean noGuardExpression) Method parameters in org.ek9lang.compiler.phase5 with type arguments of type IScopeModifier and TypeMethodDescriptionprotected booleanPossibleExpressionConstruct.isVariableInitialisedInScopes(CodeFlowAnalyzer analyzer, ISymbol variable, List<IScope> scopes) protected voidPossibleExpressionConstruct.pullUpAcceptableCriteriaToHigherScope(CodeFlowAnalyzer analyzer, List<IScope> allAppropriateBlocks, IScope outerScope) -
Uses of IScope in org.ek9lang.compiler.phase7
Methods in org.ek9lang.compiler.phase7 with parameters of type IScopeModifier and TypeMethodDescriptionprotected voidAbstractDfnGenerator.createInitOperation(IRConstruct construct, IScope aggregateSymbol, ISymbol superType) Create c_init operation for class/static initialization.protected voidAbstractDfnGenerator.createInstanceInitOperation(IRConstruct construct, IScope symbol, EK9Parser.AggregatePartsContext ctx) Create i_init operation for instance initialization.protected OperationInstrAbstractDfnGenerator.newSyntheticInitOperation(IScope scope, String methodName) -
Uses of IScope in org.ek9lang.compiler.search
Methods in org.ek9lang.compiler.search that return IScopeModifier and TypeMethodDescriptionMethodSearchInScope.scopeToSearch()Returns the value of thescopeToSearchrecord component.Constructors in org.ek9lang.compiler.search with parameters of type IScopeModifierConstructorDescriptionMethodSearchInScope(IScope scopeToSearch, MethodSymbolSearch search) Creates an instance of aMethodSearchInScoperecord class. -
Uses of IScope in org.ek9lang.compiler.support
Classes in org.ek9lang.compiler.support that implement interfaces with type arguments of type IScopeModifier and TypeClassDescriptionfinal classUsed when trying to locate the current class or dynamic class, to be able to check if access to fields or methods should be allowed, or even resolve methods without 'this' prefix.classDesigned to check if variable name and method names collide with Type/Function names.Methods in org.ek9lang.compiler.support that return IScopeMethods in org.ek9lang.compiler.support with parameters of type IScopeModifier and TypeMethodDescriptionprotected List<AggregateSymbol> CommonFactory.createAndRegisterParameterisedSymbols(EK9Parser.ParameterisedParamsContext ctx, ISymbol functionOrClass, IScope scope) AggregateManipulator.createGenericT(String name, String genericParent, IScope scope) Create a generic parameter of specific name.booleanNoNameCollisionOrError.errorsIfResolved(IScope inScope, ISymbol symbol, SymbolSearch search, ErrorListener.SemanticClassification classificationError) If a symbol is resolved then this will emit an error.booleanSymbolChecker.errorsIfSymbolAlreadyDefined(IScope inScope, ISymbol symbol, boolean limitVarSearchToBlockScope) Check for exising symbol in the scope.BasicSymbolFactory.newCall(EK9Parser.CallContext ctx, IScope scope) Symbol to model some type of call to a function, dynamic function, constructor, this, super etc.SymbolFactory.newCall(EK9Parser.CallContext ctx, IScope scope) Symbol to model some type of call to a function, dynamic function, constructor, this, super etc.OperationFactory.newCaseExpressionCall(EK9Parser.CaseExpressionContext ctx, IScope scope) New CallSymbol for switch case expression operator.SymbolFactory.newCaseExpressionCall(EK9Parser.CaseExpressionContext ctx, IScope scope) Create a new CallSymbol for switch case expression operator.BasicSymbolFactory.newDict(EK9Parser.DictContext ctx, IScope scope) Create a new EK9 Dictionary - like a Map.SymbolFactory.newDict(EK9Parser.DictContext ctx, IScope scope) Create a new EK9 Dictionary - like a Map.BasicSymbolFactory.newDictEntry(EK9Parser.InitValuePairContext ctx, IScope scope) Create a new entry for the Dictionary, basically a tuple.SymbolFactory.newDictEntry(EK9Parser.InitValuePairContext ctx, IScope scope) Create a new entry for the Dictionary, basically a tuple.BasicSymbolFactory.newDynamicVariableCapture(ICanCaptureVariables scope, IScope enclosingBlockScope) SymbolFactory.newDynamicVariableCapture(ICanCaptureVariables scope, IScope enclosingBlockScope) Create a new local scope just for variables to be defined/captured in for dynamic classes/functions.SymbolFactory.newForLoop(org.antlr.v4.runtime.ParserRuleContext ctx, IScope scope) Create a new symbol that represents an EK9 'for' loop.BasicSymbolFactory.newList(EK9Parser.ListContext ctx, IScope scope) Create a new EK9 List (a generic type).SymbolFactory.newList(EK9Parser.ListContext ctx, IScope scope) Create a new EK9 List (a generic type).OperationFactory.newOperationCall(EK9Parser.OperationCallContext ctx, IScope scope) New call but modelled as an operator if marked as such.SymbolFactory.newOperationCall(EK9Parser.OperationCallContext ctx, IScope scope) New call but modelled as an operator if marked as such.OperationFactory.newOperatorCall(String operator, EK9Parser.ExpressionContext ctx, IScope scope) Create a CallSymbol for an operator in an expression.SymbolFactory.newOperatorCall(String operator, EK9Parser.ExpressionContext ctx, IScope scope) Create a new CallSymbol for an operator in an expression.ServiceFactory.newServiceOperation(EK9Parser.ServiceOperationDeclarationContext ctx, IScope scope) Create a new aggregate that represents an EK9 service operation - a specialised method.SymbolFactory.newServiceOperation(EK9Parser.ServiceOperationDeclarationContext ctx, IScope scope) Create a new aggregate that represents an EK9 service operation - a specialised method.StreamFactory.newStreamCat(EK9Parser.StreamCatContext ctx, IScope scope) Create a new symbol that represents an EK9 'cat' part of a stream pipeline.SymbolFactory.newStreamCat(EK9Parser.StreamCatContext ctx, IScope scope) Create a new symbol that represents an EK9 'cat' part of a stream pipeline.StreamFactory.newStreamFor(EK9Parser.StreamForContext ctx, IScope scope) Create a new symbol that represents an EK9 'for' part of a stream pipeline.SymbolFactory.newStreamFor(EK9Parser.StreamForContext ctx, IScope scope) Create a new symbol that represents an EK9 'for' part of a stream pipeline.StreamFactory.newStreamPart(EK9Parser.StreamPartContext ctx, IScope scope) Create a new symbol that represents an EK9 stream function part of a stream pipeline.SymbolFactory.newStreamPart(EK9Parser.StreamPartContext ctx, IScope scope) Create a new symbol that represents an EK9 stream function part of a stream pipeline.StreamFactory.newStreamTermination(org.antlr.v4.runtime.ParserRuleContext ctx, String operation, IScope scope) Create a new symbol that represents an EK9 terminal part of a stream pipeline.SymbolFactory.newStreamTermination(org.antlr.v4.runtime.ParserRuleContext ctx, String operation, IScope scope) Create a new symbol that represents an EK9 terminal part of a stream pipeline.SymbolFactory.newSwitch(EK9Parser.SwitchStatementExpressionContext ctx, IScope scope) Create a new symbol that represents an EK9 'switch' block.SymbolFactory.newTextBody(EK9Parser.TextBodyDeclarationContext ctx, IScope scope) Create a new aggregate that represents an EK9 text body - this is represented by a method.TextFactory.newTextBody(EK9Parser.TextBodyDeclarationContext ctx, IScope scope) Create a new aggregate that represents an EK9 text body - this is represented by a method.SymbolFactory.newTry(EK9Parser.TryStatementExpressionContext ctx, IScope scope) Create a new symbol that represents an EK9 'try' block.SymbolFactory.newWhileLoop(EK9Parser.WhileStatementExpressionContext ctx, IScope scope) Create a new while or do/while scoped symbol.AggregateManipulator.resolveBoolean(IScope scope) Resolve Boolean from cached ek9 types of full scope hierarchy resolution.AggregateManipulator.resolveInteger(IScope scope) Resolve Integer from cached ek9 types of full scope hierarchy resolution.AggregateManipulator.resolveJson(IScope scope) Resolve JSON from cached ek9 types of full scope hierarchy resolution.AggregateManipulator.resolveString(IScope scope) Resolve String from cached ek9 types of full scope hierarchy resolution.AggregateManipulator.resolveVoid(IScope scope) Resolve Void from cached ek9 types of full scope hierarchy resolution.booleanCheck for exising symbol in the scope.Constructors in org.ek9lang.compiler.support with parameters of type IScope -
Uses of IScope in org.ek9lang.compiler.symbols
Subinterfaces of IScope in org.ek9lang.compiler.symbolsModifier and TypeInterfaceDescriptioninterfaceInterface for an aggregate, typically a class or something like that.interfaceInterface to abstract FunctionSymbol away as concrete implementation.interfaceFor symbols that are both a pure symbol but can also define a scope.Classes in org.ek9lang.compiler.symbols that implement IScopeModifier and TypeClassDescriptionclassThis is typically a 'class' or an interface type where it can include the definitions of new properties.classAn aggregate, but one that can have zero or more traits (like interfaces).classSpecial type that is super of Aggregate and super of Function (if they don't have supers).classJust re-uses the bulk of method symbol for when we want to make a symbol that is a call to an actual method.classUsed to actually hold the captured symbols.classJust focuses on the ability to possible capture variables from an enclosing scope.classEK9 switch/try control type symbol - this can effectively return a value if it is configured with returning part.classEK9 'for' type symbol - we need a scope because we declare a new variable as the loop variable.classScope for functions that are part of a module.classUsed in many ways via composition.classRepresents some type of method that exists on an aggregate type scope.classThis is a very special scope, because the same 'module name' can be defined in multiple files.classAdded as a common symbol type for both Functions and Aggregates that could possibly be generic in nature and also be a parameterised type.classRepresents a symbol that also has a scope.classScope for callable methods (operations) that are part of a Service.classUsed when duplicate symbols are found, where we need to add a placeholder.classJust re-uses the bulk of method symbol.classEK9 switch statement - this can effectively return a value if it is configured with returning part.classWe need to support simple things like classes which are unique per symbol table Or the fully qualified class names like 'com.some.A and com.other.A' so they won't collide.classEK9 try statement - this can effectively return a value if it is configured with returning part.classEK9 'while' or 'do/while' type symbol - we need a scope because we can declare new variables as part of the pre-flow semantics.Methods in org.ek9lang.compiler.symbols that return IScopeModifier and TypeMethodDescriptionIScope.getEnclosingScope()LocalScope.getEnclosingScope()ScopedSymbol.getEnclosingScope()SymbolTable.getEnclosingScope()CaptureScopedSymbol.getModuleScope()MethodSymbol.getParentScope()For actual methods this will be the aggregate they are part of.Methods in org.ek9lang.compiler.symbols that return types with arguments of type IScopeModifier and TypeMethodDescriptionAggregateSymbol.getAnySuperTypeOrFunction()FunctionSymbol.getAnySuperTypeOrFunction()ScopedSymbol.getAnySuperTypeOrFunction()Methods in org.ek9lang.compiler.symbols with parameters of type IScopeModifier and TypeMethodDescriptionClone the symbol and re-parent if this symbol like a method should have a parent.protected SymbolTableSymbolTable.cloneIntoSymbolTable(SymbolTable rtn, IScope withParentAsAppropriate) booleanIScope.isScopeAMatchForEnclosingScope(IScope toCheck) booleanLocalScope.isScopeAMatchForEnclosingScope(IScope toCheck) Useful to be able to check if the scope you have in hand is the same the enclosing scope for this.booleanScopedSymbol.isScopeAMatchForEnclosingScope(IScope toCheck) booleanSymbolTable.isScopeAMatchForEnclosingScope(IScope toCheck) voidCaptureScopedSymbol.setModuleScope(IScope moduleScope) Constructors in org.ek9lang.compiler.symbols with parameters of type IScopeModifierConstructorDescriptionAggregateSymbol(String name, Optional<ISymbol> type, IScope enclosingScope) A simple straight forward aggregate type, like a class or record.AggregateSymbol(String name, IScope enclosingScope) A simple straight forward aggregate type, like a class or record.AggregateSymbol(String name, IScope enclosingScope, List<ISymbol> typeParameterOrArguments) An aggregate that can be parameterised, i.e.AggregateWithTraitsSymbol(String name, Optional<ISymbol> type, IScope enclosingScope) AggregateWithTraitsSymbol(String name, IScope enclosingScope) AnyTypeSymbol(String name, IScope enclosingScope) CallSymbol(String name, IScope enclosingScope) CaptureScope(IScope enclosingScope) CaptureScopedSymbol(String name, Optional<ISymbol> type, IScope enclosingScope) CaptureScopedSymbol(String name, IScope enclosingScope) ControlSymbol(String name, IScope enclosingScope) Create a new Control Symbol.FunctionSymbol(String name, IScope enclosingScope) Create a new Function Symbol with a specific unique name (in the enclosing scope).FunctionSymbol(String name, IScope enclosingScope, List<AggregateSymbol> typeParameterOrArguments) A function that can be parameterised, i.e.LocalScope(String scopeName, IScope enclosingScope) Create a new named local scope with an outer enclosing scope.LocalScope(IScope enclosingScope) LocalScope(IScope.ScopeType scopeType, String scopeName, IScope enclosingScope) Create a new named local scope with an outer enclosing scope.MethodSymbol(String name, Optional<ISymbol> type, IScope enclosingScope) Create new method symbol of a specific name with an enclosing scope (i.e.MethodSymbol(String name, IScope enclosingScope) Create new method symbol of a specific name with an enclosing scope (i.e.MethodSymbol(String name, ISymbol type, IScope enclosingScope) Typically used for cloning constructors.PossibleGenericSymbol(String name, Optional<ISymbol> type, IScope enclosingScope) PossibleGenericSymbol(String name, IScope enclosingScope) ScopedSymbol(String name, Optional<ISymbol> type, IScope enclosingScope) ScopedSymbol(String name, IScope enclosingScope) ScopedSymbol(IScope.ScopeType scopeType, String scopeName, IScope enclosingScope) ServiceOperationSymbol(String name, Optional<ISymbol> type, IScope enclosingScope) ServiceOperationSymbol(String name, IScope enclosingScope) StackConsistencyScope(IScope enclosingScope) StackConsistencyScope(IScope enclosingScope, IScope.ScopeType scopeType) StreamCallSymbol(String name, IScope enclosingScope) SwitchSymbol(IScope enclosingScope) WhileSymbol(IScope enclosingScope, boolean doWhile)