|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.data.expr.AbstractParseTreeVisitor
ptolemy.copernicus.java.ParseTreeCodeGenerator
public class ParseTreeCodeGenerator
This class visits parse trees and generates soot instructions that evaluate the parse tree.
ASTPtRootNode
Red (cxh) |
Red (neuendor) |
Field Summary | |
---|---|
protected soot.jimple.JimpleBody |
_body
The code body under construction. |
protected soot.Unit |
_insertPoint
The insertion point. |
protected java.util.HashMap |
_nodeToLocal
A map from the node to the local variable. |
protected CodeGenerationScope |
_scope
The scope of the parse tree. |
protected soot.util.Chain |
_units
The units of the parse tree. |
Constructor Summary | |
---|---|
ParseTreeCodeGenerator()
|
Method Summary | |
---|---|
protected void |
_assert(boolean flag,
ASTPtRootNode node,
java.lang.String message)
Assert that the given boolean value, which describes the given parse tree node is true. |
protected void |
_debug(ASTPtRootNode node)
Print a debugging message. |
protected void |
_generateAllChildren(ASTPtRootNode node)
Loop through all of the children of this node, visiting each one of them, which will cause their token value to be determined. |
protected void |
_generateChild(ASTPtRootNode node,
int i)
Visit the child with the given index of the given node. |
protected soot.Local |
_getChildTokensLocal(int start,
ASTPtRootNode node)
Create a new local that references an array of tokens. |
protected soot.Local |
_getLocalForName(java.lang.String name)
|
protected boolean |
_isValidName(java.lang.String name)
|
soot.Local |
generateCode(ASTPtRootNode node,
soot.jimple.JimpleBody body,
CodeGenerationScope scope)
|
soot.Local |
generateCode(ASTPtRootNode node,
soot.jimple.JimpleBody body,
soot.Unit insertPoint,
CodeGenerationScope scope)
|
void |
visitArrayConstructNode(ASTPtArrayConstructNode node)
|
void |
visitBitwiseNode(ASTPtBitwiseNode node)
|
void |
visitFunctionalIfNode(ASTPtFunctionalIfNode node)
|
void |
visitFunctionApplicationNode(ASTPtFunctionApplicationNode node)
|
void |
visitFunctionDefinitionNode(ASTPtFunctionDefinitionNode node)
|
void |
visitLeafNode(ASTPtLeafNode node)
|
void |
visitLogicalNode(ASTPtLogicalNode node)
|
void |
visitMatrixConstructNode(ASTPtMatrixConstructNode node)
|
void |
visitMethodCallNode(ASTPtMethodCallNode node)
|
void |
visitPowerNode(ASTPtPowerNode node)
|
void |
visitProductNode(ASTPtProductNode node)
|
void |
visitRecordConstructNode(ASTPtRecordConstructNode node)
|
void |
visitRelationalNode(ASTPtRelationalNode node)
|
void |
visitShiftNode(ASTPtShiftNode node)
|
void |
visitSumNode(ASTPtSumNode node)
|
void |
visitUnaryNode(ASTPtUnaryNode node)
|
Methods inherited from class ptolemy.data.expr.AbstractParseTreeVisitor |
---|
_unsupportedVisitException, _visitAllChildren, _visitChild, visitAssignmentNode, visitUnionConstructNode |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.HashMap _nodeToLocal
protected soot.jimple.JimpleBody _body
protected soot.util.Chain _units
protected CodeGenerationScope _scope
protected soot.Unit _insertPoint
Constructor Detail |
---|
public ParseTreeCodeGenerator()
Method Detail |
---|
public soot.Local generateCode(ASTPtRootNode node, soot.jimple.JimpleBody body, CodeGenerationScope scope) throws IllegalActionException
IllegalActionException
public soot.Local generateCode(ASTPtRootNode node, soot.jimple.JimpleBody body, soot.Unit insertPoint, CodeGenerationScope scope) throws IllegalActionException
IllegalActionException
public void visitArrayConstructNode(ASTPtArrayConstructNode node) throws IllegalActionException
visitArrayConstructNode
in interface ParseTreeVisitor
visitArrayConstructNode
in class AbstractParseTreeVisitor
IllegalActionException
public void visitBitwiseNode(ASTPtBitwiseNode node) throws IllegalActionException
visitBitwiseNode
in interface ParseTreeVisitor
visitBitwiseNode
in class AbstractParseTreeVisitor
IllegalActionException
public void visitFunctionApplicationNode(ASTPtFunctionApplicationNode node) throws IllegalActionException
visitFunctionApplicationNode
in interface ParseTreeVisitor
visitFunctionApplicationNode
in class AbstractParseTreeVisitor
IllegalActionException
public void visitFunctionalIfNode(ASTPtFunctionalIfNode node) throws IllegalActionException
visitFunctionalIfNode
in interface ParseTreeVisitor
visitFunctionalIfNode
in class AbstractParseTreeVisitor
IllegalActionException
public void visitFunctionDefinitionNode(ASTPtFunctionDefinitionNode node) throws IllegalActionException
visitFunctionDefinitionNode
in interface ParseTreeVisitor
visitFunctionDefinitionNode
in class AbstractParseTreeVisitor
IllegalActionException
public void visitLeafNode(ASTPtLeafNode node) throws IllegalActionException
visitLeafNode
in interface ParseTreeVisitor
visitLeafNode
in class AbstractParseTreeVisitor
IllegalActionException
public void visitLogicalNode(ASTPtLogicalNode node) throws IllegalActionException
visitLogicalNode
in interface ParseTreeVisitor
visitLogicalNode
in class AbstractParseTreeVisitor
IllegalActionException
public void visitMatrixConstructNode(ASTPtMatrixConstructNode node) throws IllegalActionException
visitMatrixConstructNode
in interface ParseTreeVisitor
visitMatrixConstructNode
in class AbstractParseTreeVisitor
IllegalActionException
public void visitMethodCallNode(ASTPtMethodCallNode node) throws IllegalActionException
visitMethodCallNode
in interface ParseTreeVisitor
visitMethodCallNode
in class AbstractParseTreeVisitor
IllegalActionException
public void visitPowerNode(ASTPtPowerNode node) throws IllegalActionException
visitPowerNode
in interface ParseTreeVisitor
visitPowerNode
in class AbstractParseTreeVisitor
IllegalActionException
public void visitProductNode(ASTPtProductNode node) throws IllegalActionException
visitProductNode
in interface ParseTreeVisitor
visitProductNode
in class AbstractParseTreeVisitor
IllegalActionException
public void visitRecordConstructNode(ASTPtRecordConstructNode node) throws IllegalActionException
visitRecordConstructNode
in interface ParseTreeVisitor
visitRecordConstructNode
in class AbstractParseTreeVisitor
IllegalActionException
public void visitRelationalNode(ASTPtRelationalNode node) throws IllegalActionException
visitRelationalNode
in interface ParseTreeVisitor
visitRelationalNode
in class AbstractParseTreeVisitor
IllegalActionException
public void visitShiftNode(ASTPtShiftNode node) throws IllegalActionException
visitShiftNode
in interface ParseTreeVisitor
visitShiftNode
in class AbstractParseTreeVisitor
IllegalActionException
public void visitSumNode(ASTPtSumNode node) throws IllegalActionException
visitSumNode
in interface ParseTreeVisitor
visitSumNode
in class AbstractParseTreeVisitor
IllegalActionException
public void visitUnaryNode(ASTPtUnaryNode node) throws IllegalActionException
visitUnaryNode
in interface ParseTreeVisitor
visitUnaryNode
in class AbstractParseTreeVisitor
IllegalActionException
protected void _assert(boolean flag, ASTPtRootNode node, java.lang.String message)
protected void _debug(ASTPtRootNode node)
protected void _generateAllChildren(ASTPtRootNode node) throws IllegalActionException
IllegalActionException
protected void _generateChild(ASTPtRootNode node, int i) throws IllegalActionException
IllegalActionException
protected soot.Local _getLocalForName(java.lang.String name) throws IllegalActionException
IllegalActionException
protected boolean _isValidName(java.lang.String name) throws IllegalActionException
IllegalActionException
protected soot.Local _getChildTokensLocal(int start, ASTPtRootNode node)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |