org.mvel2.util
Class CompilerTools

java.lang.Object
  extended by org.mvel2.util.CompilerTools

public class CompilerTools
extends java.lang.Object


Constructor Summary
CompilerTools()
           
 
Method Summary
static void expectType(Accessor expression, java.lang.Class type, boolean compileMode)
           
static void expectType(ASTNode node, java.lang.Class type, boolean compileMode)
           
static Accessor extractAccessor(ASTNode n)
           
static java.util.Map<java.lang.String,Function> extractAllDeclaredFunctions(CompiledExpression compile)
          Returns an ordered Map of all functions declared within an compiled script.
static ASTLinkedList finalizePayload(ASTLinkedList astLinkedList, boolean secondPassOptimization, ParserContext ctx)
          Finalize the payload, by reducing any stack-based-operations to dedicated nodes where possible.
static java.util.Map<java.lang.String,java.lang.Object> getInjectedImports(VariableResolverFactory factory)
           
static java.lang.Class getReturnTypeFromOp(int operation, java.lang.Class left, java.lang.Class right)
           
static java.lang.Number signNumber(java.lang.Object number)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompilerTools

public CompilerTools()
Method Detail

finalizePayload

public static ASTLinkedList finalizePayload(ASTLinkedList astLinkedList,
                                            boolean secondPassOptimization,
                                            ParserContext ctx)
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.
ctx - - The parser context
Returns:
optimized AST

extractAllDeclaredFunctions

public static java.util.Map<java.lang.String,Function> extractAllDeclaredFunctions(CompiledExpression compile)
Returns an ordered Map of all functions declared within an compiled script.

Parameters:
compile -
Returns:
- ordered Map

expectType

public static void expectType(Accessor expression,
                              java.lang.Class type,
                              boolean compileMode)

expectType

public static void expectType(ASTNode node,
                              java.lang.Class type,
                              boolean compileMode)

getReturnTypeFromOp

public static java.lang.Class getReturnTypeFromOp(int operation,
                                                  java.lang.Class left,
                                                  java.lang.Class right)

extractAccessor

public static Accessor extractAccessor(ASTNode n)

getInjectedImports

public static java.util.Map<java.lang.String,java.lang.Object> getInjectedImports(VariableResolverFactory factory)

signNumber

public static java.lang.Number signNumber(java.lang.Object number)


Copyright © 2010. All Rights Reserved.