ptolemy.codegen.kernel
Interface ParseTreeCodeGenerator

All Known Implementing Classes:
CParseTreeCodeGenerator, JavaParseTreeCodeGenerator, RTMaudeParseTreeCodeGenerator

public interface ParseTreeCodeGenerator

An interface to a parse tree.

Since:
Ptolemy II 6.0
Version:
$Id: ParseTreeCodeGenerator.java 47513 2007-12-07 06:32:21Z cxh $
Author:
Christopher Brooks
See Also:
ASTPtRootNode
Accepted Rating:
Red
Proposed Rating:
Red

Method Summary
 java.lang.String escapeForTargetLanguage(java.lang.String string)
          Given a string, escape special characters as necessary for the target language.
 Token evaluateParseTree(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.String generateFireCode()
          Generate code that corresponds with the fire() method.
 

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.