Class CompilerTools


  • public class CompilerTools
    extends Object
    • Constructor Detail

      • CompilerTools

        public CompilerTools()
    • Method Detail

      • 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

        public static Class getReturnType​(ASTIterator input,
                                          boolean strongTyping)
      • extractAllDeclaredFunctions

        public static Map<String,​Function> extractAllDeclaredFunctions​(CompiledExpression compile)
        Returns an ordered Map of all functions declared within an compiled script.
        Parameters:
        compile - compile
        Returns:
        - ordered Map
      • getReturnTypeFromOp

        public static Class getReturnTypeFromOp​(int operation,
                                                Class left,
                                                Class right)
      • signNumber

        public static Number signNumber​(Object number)