Class OperationFactory
java.lang.Object
org.ek9lang.compiler.support.CommonFactory
org.ek9lang.compiler.support.OperationFactory
-
Field Summary
Fields inherited from class CommonFactory
aggregateManipulator, checkContextNotNull, parsedModule -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMethodsToAny(AggregateSymbol anyTypeSymbol) booleanA bit of a beast this method.New CallSymbol for switch case expression operator.newMethod(EK9Parser.MethodDeclarationContext ctx, String methodName, IScopedSymbol scopedSymbol) Create a new method with a specific name.newMethod(EK9Parser.MethodDeclarationContext ctx, IScopedSymbol scopedSymbol) Create a new method that represents an EK9 class/component method.newOperationCall(EK9Parser.OperationCallContext ctx, IScope scope) New call but modelled as an operator if marked as such.newOperator(EK9Parser.OperatorDeclarationContext ctx, IAggregateSymbol aggregate) Create a new aggregate that represents an EK9 operator, uses a method for this.newOperatorCall(String operator, EK9Parser.ExpressionContext ctx, IScope scope) Create a CallSymbol for an operator in an expression.Create a new aggregate that represents an EK9 type, constrained or enumeration.
-
Constructor Details
-
OperationFactory
OperationFactory(ParsedModule parsedModule)
-
-
Method Details
-
newOperator
public MethodSymbol newOperator(EK9Parser.OperatorDeclarationContext ctx, IAggregateSymbol aggregate) Create a new aggregate that represents an EK9 operator, uses a method for this. -
addMissingDefaultOperators
public boolean addMissingDefaultOperators(EK9Parser.DefaultOperatorContext ctx, IAggregateSymbol aggregate) A bit of a beast this method. Check if operator is not present if so add one in. But as it is used in very early phase of compilation not all types will be known. So here this method just uses the raw name of the method. -
newMethod
Create a new method that represents an EK9 class/component method. -
newMethod
public MethodSymbol newMethod(EK9Parser.MethodDeclarationContext ctx, String methodName, IScopedSymbol scopedSymbol) Create a new method with a specific name. -
newType
Create a new aggregate that represents an EK9 type, constrained or enumeration. -
newAny
-
addMethodsToAny
-
newOperationCall
New call but modelled as an operator if marked as such. -
newCaseExpressionCall
New CallSymbol for switch case expression operator. Every case expression represents an implicit operator call on the switch variable. If no explicit operator is provided, we infer equality (==). -
newOperatorCall
Create a CallSymbol for an operator in an expression. Same pattern as newCaseExpressionCall but for general binary/unary operators.
-