Package ptolemy.cg.kernel.generic
Interface ParseTreeCodeGenerator
-
- All Known Implementing Classes:
CParseTreeCodeGenerator,JavaParseTreeCodeGenerator,ProceduralParseTreeCodeGenerator
public interface ParseTreeCodeGeneratorAn interface to a parse tree. FIXME: More.- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Christopher Brooks
- See Also:
ASTPtRootNode- Pt.AcceptedRating:
- Red
- Pt.ProposedRating:
- Red
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringescapeForTargetLanguage(java.lang.String string)Given a string, escape special characters as necessary for the target language.TokenevaluateParseTree(ASTPtRootNode node, ParserScope scope)Evaluate the parse tree with the specified root node using the specified scope to resolve the values of variables.java.lang.StringgenerateFireCode()Generate code that corresponds with the fire() method.java.lang.StringtraceParseTreeEvaluation(ASTPtRootNode node, ParserScope scope)Trace the evaluation of the parse tree with the specified root node using the specified scope to resolve the values of variables.
-
-
-
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.
-
-