public class ExpressionCompiler extends Object implements ExpressionVisitor<SrcExpression,LspsRuntimeException>
Modifier and Type | Method and Description |
---|---|
static SrcExpression |
compile(CommonCompiler commonCompiler,
javassist.ClassPool classPool,
javassist.CtClass cls,
javassist.CtClass moduleCls,
Expression exp,
ExpressionOrigin expressionOrigin,
Map<String,Type> params,
Set<String> requiredParameters,
Type returnType,
CommonCompiler.JavaTypesResolver javaTypeResolver,
boolean isInRecord,
boolean isInForm,
boolean isInExpression,
boolean isStatic)
Compiles expression to java code.
|
static SrcExpression |
compileClosure(CommonCompiler namespaceCompiler,
javassist.ClassPool classPool,
javassist.CtClass cls,
javassist.CtClass moduleCls,
Expression exp,
ExpressionOrigin expressionOrigin,
Map<String,Type> params,
Set<String> requiredParameters,
Type returnType,
CommonCompiler.JavaTypesResolver javaTypeResolver,
boolean isInRecord,
boolean isInForm,
boolean isStatic)
Compiles closure to java code.
|
static SrcExpression |
compileExpression(CommonCompiler commonCompiler,
javassist.ClassPool classPool,
javassist.CtClass cls,
javassist.CtClass moduleCls,
Expression exp,
ExpressionOrigin expressionOrigin,
List<LocalParameter> params,
SrcExpression ctxExp,
Type returnType,
CommonCompiler.JavaTypesResolver javaTypeResolver,
boolean isInRecord,
boolean isInForm,
boolean isStatic,
boolean canReturn)
Compiles expression.
|
static MissingReturnExpression |
getMissingReturnExpression(Expression exp) |
SrcExpression |
visit(AssignmentExpression assignmentExpression)
Visits an assignment expression.
|
SrcExpression |
visit(BlockExpression expression)
Visits a block expression.
|
SrcExpression |
visit(BreakExpression expression)
Visits a break expression.
|
SrcExpression |
visit(CastExpression castExpression)
Visits a cast expression.
|
SrcExpression |
visit(ChainedExpression chainedExpression)
Visits a chained expression.
|
SrcExpression |
visit(ClosureExpression closure)
Visits a closure.
|
SrcExpression |
visit(ClosureInvocationExpression closureCall)
Visits a closure invocation expression.
|
SrcExpression |
visit(CompoundAssignmentExpression expression)
Visits an compound assignment expression.
|
SrcExpression |
visit(ConditionalExpression conditionalExpression)
Visits a conditional expression.
|
SrcExpression |
visit(ConstantExpression constant)
Visits a constant.
|
SrcExpression |
visit(ContinueExpression expression)
Visits a continue expression.
|
SrcExpression |
visit(CustomConstantExpression constantExpression)
Visits a custom constant expression (a constant defined by user).
|
SrcExpression |
visit(DebugExpression expression)
Visits a debug expression.
|
SrcExpression |
visit(DefExpression defExpression)
Visits a define expression.
|
SrcExpression |
visit(DereferenceExpression dereferenceExpression)
Visits a dereference expression.
|
SrcExpression |
visit(EnumerationExpression enumerationExpression)
Visits an enumeration expression.
|
SrcExpression |
visit(ForeachExpression foreachExpression)
Visits a foreach expression.
|
SrcExpression |
visit(ForExpression forExpression)
Visits a for expression.
|
SrcExpression |
visit(FunctionCallExpression closureCall)
Visits a function call.
|
SrcExpression |
visit(FunctionCallWithNamedArgs expression)
Visits a function call with named args expression.
|
SrcExpression |
visit(FunctionExpression operationExpression)
Visits a function expression.
|
SrcExpression |
visit(IfnullExpression ifnullExpression)
Visits an ifnull expression.
|
SrcExpression |
visit(IncDecExpression expression)
Visits a increment/decrement expression.
|
SrcExpression |
visit(InstanceofExpression expression)
Visits an instanceof expression.
|
SrcExpression |
visit(ListExpression listExpression)
Visits a list expression.
|
SrcExpression |
visit(MapExpression mapExpression)
Visits a map expression.
|
SrcExpression |
visit(MethodCallExpression closureCall)
Visits a method call.
|
SrcExpression |
visit(MethodExpression methodExpression)
Visits a method expression.
|
SrcExpression |
visit(PropertyExpression propertyExpression)
Visits a property expression.
|
SrcExpression |
visit(PropertyLiteralExpression expression)
Visits a property literal expression.
|
SrcExpression |
visit(RecordConstructorExpression expression)
Visits a record constructor expression.
|
SrcExpression |
visit(RecordExpression recordExpression)
Visits a record expression.
|
SrcExpression |
visit(ReferenceExpression referenceExpression)
Visits a reference expression.
|
SrcExpression |
visit(SetExpression setExpression)
Visits a set expression.
|
SrcExpression |
visit(SuperConstructorExpression expression)
Visits a super constructor expression.
|
SrcExpression |
visit(SwitchExpression switchExpression)
Visits a switch expression.
|
SrcExpression |
visit(SyntheticExpression expression)
Visits an synthetic expression.
|
SrcExpression |
visit(ThisConstructorExpression expression)
Visits a this constructor expression.
|
SrcExpression |
visit(ThisExpression thisExpression)
Visits this.
|
SrcExpression |
visit(TryCatchExpression tryCatchExpression)
Visits a try-catch expression.
|
SrcExpression |
visit(TypeExpression expression)
Visits a type literal expression.
|
SrcExpression |
visit(UnknownExpression expression)
Visits an unknown expression.
|
SrcExpression |
visit(VariableExpression variable)
Visits a variable.
|
SrcExpression |
visit(WhileExpression whileExpression)
Visits a while expresion.
|
public static SrcExpression compile(CommonCompiler commonCompiler, javassist.ClassPool classPool, javassist.CtClass cls, javassist.CtClass moduleCls, Expression exp, ExpressionOrigin expressionOrigin, Map<String,Type> params, Set<String> requiredParameters, Type returnType, CommonCompiler.JavaTypesResolver javaTypeResolver, boolean isInRecord, boolean isInForm, boolean isInExpression, boolean isStatic)
commonCompiler
- classPool
- cls
- moduleCls
- exp
- expressionOrigin
- params
- requiredParameters
- returnType
- javaTypeResolver
- isInRecord
- isInForm
- isInExpression
- isStatic
- public static SrcExpression compileClosure(CommonCompiler namespaceCompiler, javassist.ClassPool classPool, javassist.CtClass cls, javassist.CtClass moduleCls, Expression exp, ExpressionOrigin expressionOrigin, Map<String,Type> params, Set<String> requiredParameters, Type returnType, CommonCompiler.JavaTypesResolver javaTypeResolver, boolean isInRecord, boolean isInForm, boolean isStatic)
namespaceCompiler
- classPool
- cls
- moduleCls
- exp
- expressionOrigin
- params
- requiredParameters
- returnType
- javaTypeResolver
- isInRecord
- isInForm
- isStatic
- public static SrcExpression compileExpression(CommonCompiler commonCompiler, javassist.ClassPool classPool, javassist.CtClass cls, javassist.CtClass moduleCls, Expression exp, ExpressionOrigin expressionOrigin, List<LocalParameter> params, SrcExpression ctxExp, Type returnType, CommonCompiler.JavaTypesResolver javaTypeResolver, boolean isInRecord, boolean isInForm, boolean isStatic, boolean canReturn)
commonCompiler
- classPool
- cls
- moduleCls
- exp
- params
- ctxExp
- returnType
- javaTypeResolver
- isInRecord
- isInForm
- isStatic
- canReturn
- public static MissingReturnExpression getMissingReturnExpression(Expression exp)
public SrcExpression visit(ConstantExpression constant) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(SyntheticExpression expression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(VariableExpression variable) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(FunctionCallExpression closureCall) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(MethodCallExpression closureCall) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(ClosureInvocationExpression closureCall) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(ClosureExpression closure) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(ListExpression listExpression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(SetExpression setExpression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(MapExpression mapExpression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(RecordExpression recordExpression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(RecordConstructorExpression expression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(ThisConstructorExpression expression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(SuperConstructorExpression expression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(ReferenceExpression referenceExpression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(PropertyExpression propertyExpression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(MethodExpression methodExpression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(FunctionExpression operationExpression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(TryCatchExpression tryCatchExpression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(SwitchExpression switchExpression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(AssignmentExpression assignmentExpression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(CompoundAssignmentExpression expression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(ChainedExpression chainedExpression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(DereferenceExpression dereferenceExpression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(DefExpression defExpression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(ConditionalExpression conditionalExpression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(EnumerationExpression enumerationExpression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(CustomConstantExpression constantExpression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(WhileExpression whileExpression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(UnknownExpression expression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(ForExpression forExpression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(ForeachExpression foreachExpression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(CastExpression castExpression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(InstanceofExpression expression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(IfnullExpression ifnullExpression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(PropertyLiteralExpression expression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(TypeExpression expression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(FunctionCallWithNamedArgs expression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(IncDecExpression expression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(DebugExpression expression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(BlockExpression expression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(BreakExpression expression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(ContinueExpression expression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
public SrcExpression visit(ThisExpression thisExpression) throws LspsRuntimeException
ExpressionVisitor
visit
in interface ExpressionVisitor<SrcExpression,LspsRuntimeException>
LspsRuntimeException
Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.