Uses of Interface
org.ek9lang.compiler.symbols.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.
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
Modifier 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.Modifier and TypeMethodDescriptionvoid
ParsedModule.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.void
ParsedModuleTransientData.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
Modifier and TypeMethodDescriptionSymbolsAndScopes.enterScope
(org.antlr.v4.runtime.tree.ParseTree ctx) Ensure that the correct scope is pushed on to the stack.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.Modifier 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.Modifier and TypeMethodDescriptionboolean
CodeFlowAnalyzer.doesSymbolMeetAcceptableCriteria
(ISymbol identifierSymbol, IScope inScope) boolean
CodeFlowMap.doesSymbolMeetAcceptableCriteria
(ISymbol identifierSymbol, IScope inScope) Check if a variable meets the criteria of being acceptable.void
SymbolsAndScopes.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.void
SymbolsAndScopes.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) boolean
SymbolsAndScopes.isSymbolAccessSafe
(ISymbol identifierSymbol, IScope inScope) true if identifier is safe to access.boolean
SymbolsAndScopes.isVariableInitialised
(ISymbol identifierSymbol, IScope inScope) void
SymbolsAndScopes.markSymbolAccessSafe
(ISymbol identifierSymbol, IScope inScope) Record an identifier as being safe to access.void
SymbolsAndScopes.markSymbolAsInitialised
(ISymbol identifierSymbol, IScope inScope) Record an identifier was initialised.void
CodeFlowAnalyzer.markSymbolAsMeetingAcceptableCriteria
(ISymbol identifierSymbol, IScope inScope) void
CodeFlowMap.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.void
SymbolsAndScopes.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).void
CodeFlowAnalyzer.recordSymbol
(ISymbol identifierSymbol, IScope inScope) void
CodeFlowMap.recordSymbol
(ISymbol identifierSymbol, IScope inScope) Records a symbol against the specific scope if it a variable to be analysed.void
SymbolsAndScopes.recordSymbolDeclaration
(ISymbol identifierSymbol, IScope inScope) Record variable declaration against a specific scope.ModifierConstructorDescriptionScopeStack
(IScope base) TypeDefResolver
(IScope scopeForResolution) Create new resolver. -
Uses of IScope in org.ek9lang.compiler.phase1
-
Uses of IScope in org.ek9lang.compiler.phase3
Modifier and TypeMethodDescriptionSymbolAccessData.fromScope()
Returns the value of thefromScope
record component.SymbolAccessData.inScope()
Returns the value of theinScope
record component.Modifier and TypeMethodDescriptionPropertyFieldOrError.apply
(EK9Parser.IdentifierContext ctx, IScope scopeToResolveIn) -
Uses of IScope in org.ek9lang.compiler.phase5
Modifier and TypeMethodDescriptionvoid
ReturningVariableOrError.accept
(IScope mainScope, EK9Parser.OperationDetailsContext ctx) protected void
PossibleExpressionConstruct.pullUpAcceptableCriteriaToHigherScope
(CodeFlowAnalyzer analyzer, List<IScope> allAppropriateBlocks, IScope outerScope) protected void
PossibleExpressionConstruct.returningVariableValidOrError
(EK9Parser.ReturningParamContext ctx, IScope constructScope, boolean noGuardExpression) Modifier and TypeMethodDescriptionprotected boolean
PossibleExpressionConstruct.isVariableInitialisedInScopes
(CodeFlowAnalyzer analyzer, ISymbol variable, List<IScope> scopes) protected void
PossibleExpressionConstruct.pullUpAcceptableCriteriaToHigherScope
(CodeFlowAnalyzer analyzer, List<IScope> allAppropriateBlocks, IScope outerScope) -
Uses of IScope in org.ek9lang.compiler.search
Modifier and TypeMethodDescriptionMethodSearchInScope.scopeToSearch()
Returns the value of thescopeToSearch
record component.ModifierConstructorDescriptionMethodSearchInScope
(IScope scopeToSearch, MethodSymbolSearch search) Creates an instance of aMethodSearchInScope
record class. -
Uses of IScope in org.ek9lang.compiler.support
Modifier and TypeMethodDescriptionAggregateFactory.createGenericT
(String name, IScope scope) Create a generic parameter of specific name.boolean
NoNameCollisionOrError.errorsIfResolved
(IScope inScope, ISymbol symbol, SymbolSearch search, ErrorListener.SemanticClassification classificationError) If a symbol is resolved then this will emit an error.boolean
SymbolChecker.errorsIfSymbolAlreadyDefined
(IScope inScope, ISymbol symbol, boolean limitVarSearchToBlockScope) Check for exising symbol in the scope.SymbolFactory.newCall
(EK9Parser.CallContext ctx, IScope scope) Symbol to model some type of call to a function, dynamic function, constructor, this, super etc.SymbolFactory.newDict
(EK9Parser.DictContext ctx, IScope scope) Create a new EK9 Dictionary - like a Map.SymbolFactory.newDictEntry
(EK9Parser.InitValuePairContext ctx, IScope scope) Create a new entry for the Dictionary, basically a tuple.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.SymbolFactory.newInterpolatedStringPart
(EK9Parser.StringPartContext ctx, IScope scope) Create a new constant that represents the fixed text part of an interpolated String.SymbolFactory.newList
(EK9Parser.ListContext ctx, IScope scope) Create a new EK9 List (a generic type).SymbolFactory.newOperationCall
(EK9Parser.OperationCallContext ctx, IScope scope) New call but modelled as an operator if marked as such.SymbolFactory.newServiceOperation
(EK9Parser.ServiceOperationDeclarationContext ctx, IScope scope) Create a new aggregate that represents an EK9 service operation - a specialised method.SymbolFactory.newStreamCat
(EK9Parser.StreamCatContext ctx, IScope scope) Create a new symbol that represents an EK9 'cat' 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.SymbolFactory.newStreamPart
(EK9Parser.StreamPartContext ctx, IScope scope) Create a new symbol that represents an EK9 stream function 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.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.AggregateFactory.resolveBoolean
(IScope scope) Resolve Boolean from cached ek9 types of full scope hierarchy resolution.AggregateFactory.resolveInteger
(IScope scope) Resolve Integer from cached ek9 types of full scope hierarchy resolution.AggregateFactory.resolveJson
(IScope scope) Resolve JSON from cached ek9 types of full scope hierarchy resolution.AggregateFactory.resolveString
(IScope scope) Resolve String from cached ek9 types of full scope hierarchy resolution.AggregateFactory.resolveVoid
(IScope scope) Resolve Void from cached ek9 types of full scope hierarchy resolution.boolean
Check for exising symbol in the scope. -
Uses of IScope in org.ek9lang.compiler.symbols
Modifier and TypeInterfaceDescriptioninterface
Interface for an aggregate, typically a class or something like that.interface
For symbols that are both a pure symbol but can also define a scope.Modifier and TypeClassDescriptionclass
This is typically a 'class' or an interface type where it can include the definitions of new properties.class
An aggregate, but one that can have zero or more traits (like interfaces).class
Just re-uses the bulk of method symbol for when we want to make a symbol that is a call to an actual method.class
Used to actually hold the captured symbols.class
Just focuses on the ability to possible capture variables from an enclosing scope.class
EK9 switch/try control type symbol - this can effectively return a value if it is configured with returning part.class
EK9 'for' type symbol - we need a scope because we declare a new variable as the loop variable.class
Scope for functions that are part of a module.class
Used in many ways via composition.class
Represents some type of method that exists on an aggregate type scope.class
This is a very special scope, because the same 'module name' can be defined in multiple files.class
Added as a common symbol type for both Functions and Aggregates that could possibly be generic in nature and also be a parameterised type.class
Represents a symbol that also has a scope.class
Scope for callable methods (operations) that are part of a Service.class
Used when duplicate symbols are found, where we need to add a placeholder.class
Just re-uses the bulk of method symbol.class
EK9 switch statement - this can effectively return a value if it is configured with returning part.class
We 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.class
EK9 try statement - this can effectively return a value if it is configured with returning part.class
EK9 'while' or 'do/while' type symbol - we need a scope because we can declare new variables as part of the pre-flow semantics.Modifier 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.Modifier and TypeMethodDescriptionAggregateSymbol.getAnySuperTypeOrFunction()
FunctionSymbol.getAnySuperTypeOrFunction()
ScopedSymbol.getAnySuperTypeOrFunction()
Modifier and TypeMethodDescriptionClone the symbol and re-parent if this symbol like a method should have a parent.protected SymbolTable
SymbolTable.cloneIntoSymbolTable
(SymbolTable rtn, IScope withParentAsAppropriate) boolean
IScope.isScopeAMatchForEnclosingScope
(IScope toCheck) boolean
LocalScope.isScopeAMatchForEnclosingScope
(IScope toCheck) Useful to be able to check if the scope you have in hand is the same the enclosing scope for this.boolean
ScopedSymbol.isScopeAMatchForEnclosingScope
(IScope toCheck) boolean
SymbolTable.isScopeAMatchForEnclosingScope
(IScope toCheck) void
CaptureScopedSymbol.setModuleScope
(IScope moduleScope) ModifierConstructorDescriptionAggregateSymbol
(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) 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)