OpenMD 3.0
Molecular Dynamics in the Open
Loading...
Searching...
No Matches
ASTNULLType.cpp
1/* ANTLR Translator Generator
2 * Project led by Terence Parr at http://www.jGuru.com
3 * Software rights: http://www.antlr.org/license.html
4 *
5 * $Id$
6 */
7
8#include "antlr/config.hpp"
9#include "antlr/AST.hpp"
10#include "antlr/ASTNULLType.hpp"
11
12#include <iostream>
13
14ANTLR_USING_NAMESPACE(std)
15
16#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
17namespace antlr {
18#endif
19
21{
22 return RefAST(this);
23}
24
28
30{
31 return 0;
32}
33
35{
36 return false;
37}
38
40{
41 return false;
42}
43
45{
46 return false;
47}
48
50{
51 return false;
52}
53
55{
56 return false;
57}
58
60{
61 return vector<RefAST>();
62}
63
65{
66 return vector<RefAST>();
67}
68
70{
71 return this;
72}
73
75{
76 return this;
77}
78
80{
81 return "<ASTNULL>";
82}
83
85{
86 return Token::NULL_TREE_LOOKAHEAD;
87}
88
89void ASTNULLType::initialize( int, const string& )
90{
91}
92
93void ASTNULLType::initialize( RefAST )
94{
95}
96
97void ASTNULLType::initialize( RefToken )
98{
99}
100
101#ifdef ANTLR_SUPPORT_XML
102void ASTNULLType::initialize( istream& )
103{
104}
105#endif
106
110
114
115void ASTNULLType::setText( const string& )
116{
117}
118
120{
121}
122
124{
125 return getText();
126}
127
129{
130 return getText();
131}
132
133string ASTNULLType::toStringTree() const
134{
135 return getText();
136}
137
138#ifdef ANTLR_SUPPORT_XML
139bool ASTNULLType::attributesToStream( ostream& ) const
140{
141 return false;
142}
143
144void ASTNULLType::toStream( ostream& out ) const
145{
146 out << "</ASTNULL>" << endl;
147}
148#endif
149
150const char* ASTNULLType::typeName( void ) const
151{
152 return "ASTNULLType";
153}
154
155#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
156}
157#endif
void addChild(RefAST c)
Add a node to the end of the child list for this node.
std::string toStringList() const
Print out a child-sibling tree in LISP notation.
void setNextSibling(RefAST n)
Set the next sibling after this one.
std ::vector< RefAST > findAll(RefAST tree)
Walk the tree looking for all exact subtree matches.
RefAST getFirstChild() const
Get the first child of this node; null if no children.
std::string toString() const
Return this AST node as a string.
void setText(const std ::string &text)
Set the token text for this node.
RefAST clone(void) const
Clone this AST node.
bool equalsListPartial(RefAST t) const
Is 't' a subtree of this list? The siblings of the root are NOT ignored.
bool equals(RefAST t) const
Is node t equal to this in terms of token type and text?
size_t getNumberOfChildren() const
Get the number of children. Returns 0 if the node is a leaf.
std::string getText() const
Get the token text for this node.
const char * typeName(void) const
Return the type name for this AST node. (for XML output)
void setType(int ttype)
Set the token type for this node.
std ::vector< RefAST > findAllPartial(RefAST subtree)
Walk the tree looking for all subtrees.
RefAST getNextSibling() const
Get the next sibling in line after this one.
void initialize(int t, const std ::string &txt)
Various initialization routines.
bool equalsList(RefAST t) const
Is t an exact structural and equals() match of this tree.
bool equalsTreePartial(RefAST t) const
Is 't' a subtree of the tree rooted at 'this'? The siblings of 'this' are ignored.
void setFirstChild(RefAST c)
Set the first child of a node.
int getType() const
Get the token type for this node.
bool equalsTree(RefAST t) const
Is tree rooted at 'this' equal to 't'? The siblings of 'this' are ignored.