#include <ebnf_node.hh>
Inheritance diagram for EbnfNode:
Public Methods | |
EbnfNode (const Position &pos_) | |
virtual EbnfNode* | clone ()=0 |
virtual bool | isLeaf () |
virtual int | getChildCount ()=0 |
virtual EbnfNode& | operator[] (int index)=0 |
virtual bool | dfTraverse (EbnfNodeAlgo &algo) throw (EbnfNodeAlgoException) |
virtual bool | rdfTraverse (EbnfNodeAlgo &algo) throw (EbnfNodeAlgoException) |
virtual | ~EbnfNode () |
const Position& | getPos () const |
virtual void | dump (ostream &os) const=0 |
Private Attributes | |
Position | pos |
Definition at line 65 of file ebnf_node.hh.
|
Definition at line 69 of file ebnf_node.hh. |
|
Force virtual destructors. Definition at line 125 of file ebnf_node.hh. |
|
Virtual copy creation. Reimplemented in EbnfOrNode, EbnfCatNode, EbnfStarNode, EbnfNonterminalNode, EbnfTerminalNode, and EbnfLambdaNode. Referenced by EbnfNodeBuilder::createPlusNode(), and EbnfLl1CheckAlgo::operator()().
|
|
Returns true if this node is a leaf node. Definition at line 80 of file ebnf_node.hh. |
|
Returns the number of children nodes of this node. Reimplemented in EbnfOrNode, EbnfCatNode, EbnfStarNode, EbnfNonterminalNode, EbnfTerminalNode, and EbnfLambdaNode. Referenced by isLeaf().
|
|
Returns the index'th child of this node.
Reimplemented in EbnfOrNode, EbnfCatNode, EbnfStarNode, EbnfNonterminalNode, EbnfTerminalNode, and EbnfLambdaNode. |
|
Generic depth-first traversal method. At each node, the () operator of the EbnfNodeAlgo object is invoked, with *this as argument. It returns true if the whole tree was traversed, and false if the traversal was interrupted due to a call to the () operator of the EbnfNodeAlgo object returning false.
Definition at line 46 of file ebnf_node.cc. |
|
Generic depth-first reversed order traversal method. At each node, the () operator of the EbnfNodeAlgo object is invoked, with *this as argument. It returns true if the whole tree was traversed, and false if the traversal was interrupted due to a call to the () operator of the EbnfNodeAlgo object returning false. The difference between this and dfTraverse is that here the () operator is called for the root before recurring to the children nodes. This is particularly useful for inherited attributes.
Definition at line 55 of file ebnf_node.cc. |
|
Returns the position in the input file that corresponds to this node. Definition at line 130 of file ebnf_node.hh. Referenced by EbnfLl1CheckAlgo::operator()(), LRecDetectAlgo::operator()(), NontermFixAlgo::operator()(), and LaEpDeclWriter::operator()().
|
|
Reimplemented in EbnfOrNode, EbnfCatNode, EbnfStarNode, EbnfNonterminalNode, EbnfTerminalNode, and EbnfLambdaNode. Referenced by ProductionSpec::dump(), EbnfStarNode::dump(), EbnfCatNode::dump(), and EbnfOrNode::dump().
|
|
The position in the input grammar file that is closest to where this node belongs. Definition at line 144 of file ebnf_node.hh. |