Interface ParseTreeCodeGenerator

    • Method Detail

      • evaluateParseTree

        Token evaluateParseTree​(ASTPtRootNode node,
                                ParserScope scope)
                         throws IllegalActionException
        Evaluate the parse tree with the specified root node using the specified scope to resolve the values of variables.
        Parameters:
        node - The root of the parse tree.
        scope - The scope for evaluation.
        Returns:
        The result of evaluation.
        Throws:
        IllegalActionException - If an error occurs during evaluation.
      • escapeForTargetLanguage

        java.lang.String escapeForTargetLanguage​(java.lang.String string)
        Given a string, escape special characters as necessary for the target language.
        Parameters:
        string - The string to escape.
        Returns:
        A new string with special characters replaced.
      • generateFireCode

        java.lang.String generateFireCode()
        Generate code that corresponds with the fire() method.
        Returns:
        The generated code.
      • traceParseTreeEvaluation

        java.lang.String traceParseTreeEvaluation​(ASTPtRootNode node,
                                                  ParserScope scope)
                                           throws IllegalActionException
        Trace the evaluation of the parse tree with the specified root node using the specified scope to resolve the values of variables.
        Parameters:
        node - The root of the parse tree.
        scope - The scope for evaluation.
        Returns:
        The trace of the evaluation.
        Throws:
        IllegalActionException - If an error occurs during evaluation.