OpenASIP
2.0
|
#include <OperationDAGLanguageParser.hh>
Public Member Functions | |
TokenTreeNode () | |
TokenTreeNode (Token &token) | |
bool | isFunctionCall () const |
bool | isAssignment () const |
bool | isInteger () const |
long | intValue () const |
void | addToTokenTree (Token &token) |
const Token & | token () const |
int | leafCount () const |
TokenTreeNode & | leaf (int index) const |
std::string | toStr () const |
Static Private Member Functions | |
static void | addToTokenTree (TokenTreeNode *currNode, TokenTreeNode *newToken) |
Private Attributes | |
Token * | data_ |
Token of token tree node. More... | |
std::vector< TokenTreeNode * > | leafs_ |
Leafs of this node. More... | |
One node of tree of tokens.
Each node contains reference to it's token and it's sub-token-nodes..
root \ function / \ name postfix / | name name
Definition at line 397 of file OperationDAGLanguageParser.hh.
|
inline |
Definition at line 399 of file OperationDAGLanguageParser.hh.
|
inline |
Definition at line 400 of file OperationDAGLanguageParser.hh.
|
inline |
Adds newly parsed token to tree under this token tree node.
token | Token to add token tree. |
Definition at line 485 of file OperationDAGLanguageParser.hh.
|
inlinestaticprivate |
Adds token tree node to under other token tree node.
currNode | Node where to add new node. |
newToken | Token tree node to add to currNode. |
Definition at line 561 of file OperationDAGLanguageParser.hh.
References data_, TokenizerData::Token::end_, leafs_, and TokenizerData::Token::start_.
|
inline |
Definition at line 460 of file OperationDAGLanguageParser.hh.
References assert.
Referenced by OperationDAGBuilder::getBinding().
|
inline |
Returns true if node contain tokens of assignment
leafs must be: ANY, ASSIGNMENT_OPERATOR, ANY
Definition at line 427 of file OperationDAGLanguageParser.hh.
Referenced by OperationDAGBuilder::parseNode().
|
inline |
Returns true if node contain tokens of function call.
leafs must be: PRIMARY_EXPRESSION, POSTFIX_EXPRESSION
Definition at line 410 of file OperationDAGLanguageParser.hh.
Referenced by OperationDAGBuilder::getBinding(), OperationDAGBuilder::getVariableName(), and OperationDAGBuilder::parseNode().
|
inline |
Returns true if node contain integer value.
leafs must be: none, or (+|-, isIntegerLiteral)
Definition at line 442 of file OperationDAGLanguageParser.hh.
Referenced by OperationDAGBuilder::getBinding().
|
inline |
Returns leaf of requested index.
index | Index of leaf to return. |
Definition at line 513 of file OperationDAGLanguageParser.hh.
References assert.
Referenced by OperationDAGBuilder::getIOOperand(), OperationDAGBuilder::parse(), and OperationDAGBuilder::parseNode().
|
inline |
Returns number of leafs that this token tree node has.
Definition at line 503 of file OperationDAGLanguageParser.hh.
Referenced by OperationDAGBuilder::getIOOperand(), OperationDAGBuilder::parse(), and OperationDAGBuilder::parseNode().
|
inline |
Returns referred token of token tree node.
Definition at line 494 of file OperationDAGLanguageParser.hh.
Referenced by OperationDAGBuilder::assignVariable(), OperationDAGBuilder::declareVariable(), OperationDAGBuilder::getBinding(), OperationDAGBuilder::getIOOperand(), OperationDAGBuilder::getVariableName(), and OperationDAGBuilder::parseNode().
|
inline |
Returns node and its sub nodes as a string.
Definition at line 524 of file OperationDAGLanguageParser.hh.
References TokenizerData::idString().
Referenced by OperationDAGBuilder::parseNode().
|
private |
Token of token tree node.
Definition at line 607 of file OperationDAGLanguageParser.hh.
Referenced by addToTokenTree().
|
private |
Leafs of this node.
Definition at line 610 of file OperationDAGLanguageParser.hh.
Referenced by addToTokenTree().