Package org.mvel2.util
Class CompilerTools
java.lang.Object
org.mvel2.util.CompilerTools
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidexpectType(ParserContext pCtx, ASTNode node, Class type, boolean compileMode) static voidexpectType(ParserContext pCtx, Accessor expression, Class type, boolean compileMode) static AccessorReturns an ordered Map of all functions declared within an compiled script.static ASTLinkedListfinalizePayload(ASTLinkedList astLinkedList, boolean secondPassOptimization, ParserContext pCtx) Finalize the payload, by reducing any stack-based-operations to dedicated nodes where possible.static ClassgetReturnType(ASTIterator input, boolean strongTyping) static ClassgetReturnTypeFromOp(int operation, Class left, Class right) static NumbersignNumber(Object number)
-
Constructor Details
-
CompilerTools
public CompilerTools()
-
-
Method Details
-
finalizePayload
public static ASTLinkedList finalizePayload(ASTLinkedList astLinkedList, boolean secondPassOptimization, ParserContext pCtx) Finalize the payload, by reducing any stack-based-operations to dedicated nodes where possible.- Parameters:
astLinkedList- - AST to be optimized.secondPassOptimization- - perform a second pass optimization to optimize boolean expressions.pCtx- - The parser context- Returns:
- optimized AST
-
getReturnType
-
extractAllDeclaredFunctions
Returns an ordered Map of all functions declared within an compiled script.- Parameters:
compile- compile- Returns:
- - ordered Map
-
expectType
public static void expectType(ParserContext pCtx, Accessor expression, Class type, boolean compileMode) -
expectType
-
getReturnTypeFromOp
-
extractAccessor
-
getInjectedImports
-
signNumber
-