Package org.ek9lang.compiler.support
Class BasicSymbolFactory
java.lang.Object
org.ek9lang.compiler.support.CommonFactory
org.ek9lang.compiler.support.BasicSymbolFactory
Factory for fairly basic symbols.
-
Field Summary
Fields inherited from class org.ek9lang.compiler.support.CommonFactory
aggregateManipulator, checkContextNotNull, parsedModule
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCreate a new aggregate that represents an EK9 application.newCall
(EK9Parser.CallContext ctx, IScope scope) Symbol to model some type of call to a function, dynamic function, constructor, this, super etc.Create a new constant as declared in the constants section.newDict
(EK9Parser.DictContext ctx, IScope scope) Create a new EK9 Dictionary - like a Map.newDictEntry
(EK9Parser.InitValuePairContext ctx, IScope scope) Create a new entry for the Dictionary, basically a tuple.newDynamicVariableCapture
(ICanCaptureVariables scope, IScope enclosingBlockScope) Create a new expression that represents the expression part of and interpolated String.Create a new constant that represents the fixed text part of an interpolated String.newList
(EK9Parser.ListContext ctx, IScope scope) Create a new EK9 List (a generic type).newLiteral
(IToken start, String name) Create a new aggregate that represents an EK9 literal value.Create a new EK9 package aggregate.Create a new aggregate that represents an EK9 program.newVariable
(String name, IToken token, boolean nullAllowed, boolean injectionExpected) Create new variable typically when looking to create simulated variable.newVariable
(EK9Parser.IdentifierContext identifier, boolean nullAllowed, boolean injectionExpected) Create and initialise a new variable symbol.void
populateEnumeration
(AggregateSymbol enumerationSymbol, List<org.antlr.v4.runtime.tree.TerminalNode> identifiers) Populates the enumeration with each of the values supplied in the identifiers.Methods inherited from class org.ek9lang.compiler.support.CommonFactory
configureAggregate, configureSymbol, createAndRegisterParameterisedSymbols, getAggregateFactory, getDefaultOperatorInitializer, getDefaultOperatorSymbolInitializer
-
Constructor Details
-
BasicSymbolFactory
BasicSymbolFactory(ParsedModule parsedModule)
-
-
Method Details
-
newPackage
Create a new EK9 package aggregate. -
newProgram
Create a new aggregate that represents an EK9 program. -
newApplication
Create a new aggregate that represents an EK9 application. -
newDynamicVariableCapture
public CaptureScope newDynamicVariableCapture(ICanCaptureVariables scope, IScope enclosingBlockScope) -
populateEnumeration
public void populateEnumeration(AggregateSymbol enumerationSymbol, List<org.antlr.v4.runtime.tree.TerminalNode> identifiers) Populates the enumeration with each of the values supplied in the identifiers. This does check for duplicates and will raise errors if there are any. -
newCall
Symbol to model some type of call to a function, dynamic function, constructor, this, super etc. -
newList
Create a new EK9 List (a generic type). -
newDict
Create a new EK9 Dictionary - like a Map. -
newDictEntry
Create a new entry for the Dictionary, basically a tuple. -
newInterpolatedStringPart
Create a new constant that represents the fixed text part of an interpolated String. -
newInterpolatedExpressionPart
Create a new expression that represents the expression part of and interpolated String. -
newConstant
Create a new constant as declared in the constants section. -
newVariable
Create and initialise a new variable symbol. Typically, a variable like name ← "Steve", so 'name' is the variable. -
newVariable
public VariableSymbol newVariable(String name, IToken token, boolean nullAllowed, boolean injectionExpected) Create new variable typically when looking to create simulated variable. -
newVariable
public VariableSymbol newVariable(EK9Parser.IdentifierContext identifier, boolean nullAllowed, boolean injectionExpected) -
newLiteral
Create a new aggregate that represents an EK9 literal value.
-