|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| 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 ParseTreeVisitorvisitArrayConstructNode in class AbstractParseTreeVisitorIllegalActionException
public void visitBitwiseNode(ASTPtBitwiseNode node)
throws IllegalActionException
visitBitwiseNode in interface ParseTreeVisitorvisitBitwiseNode in class AbstractParseTreeVisitorIllegalActionException
public void visitFunctionApplicationNode(ASTPtFunctionApplicationNode node)
throws IllegalActionException
visitFunctionApplicationNode in interface ParseTreeVisitorvisitFunctionApplicationNode in class AbstractParseTreeVisitorIllegalActionException
public void visitFunctionalIfNode(ASTPtFunctionalIfNode node)
throws IllegalActionException
visitFunctionalIfNode in interface ParseTreeVisitorvisitFunctionalIfNode in class AbstractParseTreeVisitorIllegalActionException
public void visitFunctionDefinitionNode(ASTPtFunctionDefinitionNode node)
throws IllegalActionException
visitFunctionDefinitionNode in interface ParseTreeVisitorvisitFunctionDefinitionNode in class AbstractParseTreeVisitorIllegalActionException
public void visitLeafNode(ASTPtLeafNode node)
throws IllegalActionException
visitLeafNode in interface ParseTreeVisitorvisitLeafNode in class AbstractParseTreeVisitorIllegalActionException
public void visitLogicalNode(ASTPtLogicalNode node)
throws IllegalActionException
visitLogicalNode in interface ParseTreeVisitorvisitLogicalNode in class AbstractParseTreeVisitorIllegalActionException
public void visitMatrixConstructNode(ASTPtMatrixConstructNode node)
throws IllegalActionException
visitMatrixConstructNode in interface ParseTreeVisitorvisitMatrixConstructNode in class AbstractParseTreeVisitorIllegalActionException
public void visitMethodCallNode(ASTPtMethodCallNode node)
throws IllegalActionException
visitMethodCallNode in interface ParseTreeVisitorvisitMethodCallNode in class AbstractParseTreeVisitorIllegalActionException
public void visitPowerNode(ASTPtPowerNode node)
throws IllegalActionException
visitPowerNode in interface ParseTreeVisitorvisitPowerNode in class AbstractParseTreeVisitorIllegalActionException
public void visitProductNode(ASTPtProductNode node)
throws IllegalActionException
visitProductNode in interface ParseTreeVisitorvisitProductNode in class AbstractParseTreeVisitorIllegalActionException
public void visitRecordConstructNode(ASTPtRecordConstructNode node)
throws IllegalActionException
visitRecordConstructNode in interface ParseTreeVisitorvisitRecordConstructNode in class AbstractParseTreeVisitorIllegalActionException
public void visitRelationalNode(ASTPtRelationalNode node)
throws IllegalActionException
visitRelationalNode in interface ParseTreeVisitorvisitRelationalNode in class AbstractParseTreeVisitorIllegalActionException
public void visitShiftNode(ASTPtShiftNode node)
throws IllegalActionException
visitShiftNode in interface ParseTreeVisitorvisitShiftNode in class AbstractParseTreeVisitorIllegalActionException
public void visitSumNode(ASTPtSumNode node)
throws IllegalActionException
visitSumNode in interface ParseTreeVisitorvisitSumNode in class AbstractParseTreeVisitorIllegalActionException
public void visitUnaryNode(ASTPtUnaryNode node)
throws IllegalActionException
visitUnaryNode in interface ParseTreeVisitorvisitUnaryNode in class AbstractParseTreeVisitorIllegalActionException
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 | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||