ANTLR Support Libraries 2.7.1+
Loading...
Searching...
No Matches
ASTNULLType.hpp
Go to the documentation of this file.
1#ifndef INC_ASTNULLType_hpp__
2#define INC_ASTNULLType_hpp__
3
4/* ANTLR Translator Generator
5 * Project led by Terence Parr at http://www.jGuru.com
6 * Software rights: http://www.antlr.org/license.html
7 *
8 * $Id: //depot/code/org.antlr/release/antlr-2.7.7/lib/cpp/antlr/ASTNULLType.hpp#2 $
9 */
10
11#include <antlr/config.hpp>
12#include <antlr/AST.hpp>
13#include <iostream>
14
15#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
16namespace antlr {
17#endif
18
20class ANTLR_API ASTNULLType : public AST {
21public:
22 const char* typeName( void ) const;
23 RefAST clone( void ) const;
24
25 void addChild(RefAST c);
26 size_t getNumberOfChildren() const;
27 void setFirstChild(RefAST c);
28 void setNextSibling(RefAST n);
29
30 bool equals(RefAST t) const;
31 bool equalsList(RefAST t) const;
32 bool equalsListPartial(RefAST t) const;
33 bool equalsTree(RefAST t) const;
34 bool equalsTreePartial(RefAST t) const;
35
36 ANTLR_USE_NAMESPACE(std)vector<RefAST> findAll(RefAST tree);
37 ANTLR_USE_NAMESPACE(std)vector<RefAST> findAllPartial(RefAST subtree);
38
39 RefAST getFirstChild() const;
40 RefAST getNextSibling() const;
41
42 ANTLR_USE_NAMESPACE(std)string getText() const;
43 int getType() const;
44
45 void initialize(int t, const ANTLR_USE_NAMESPACE(std)string& txt);
46 void initialize(RefAST t);
47 void initialize(RefToken t);
48 void initialize(ANTLR_USE_NAMESPACE(std)istream& infile);
49
50 void setText(const ANTLR_USE_NAMESPACE(std)string& text);
51 void setType(int ttype);
52 ANTLR_USE_NAMESPACE(std)string toString() const;
53 ANTLR_USE_NAMESPACE(std)string toStringList() const;
54 ANTLR_USE_NAMESPACE(std)string toStringTree() const;
55
56 bool attributesToStream( ANTLR_USE_NAMESPACE(std)ostream &out ) const;
57 void toStream( ANTLR_USE_NAMESPACE(std)ostream &out ) const;
58};
59
60#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
61}
62#endif
63
64#endif //INC_ASTNULLType_hpp__
ASTRefCount< AST > RefAST
Definition ASTRefCount.hpp:92
TokenRefCount< Token > RefToken
Definition TokenRefCount.hpp:92
Definition ASTNULLType.hpp:20
RefAST clone(void) const
Clone this AST node.
Definition ASTNULLType.cpp:20
size_t getNumberOfChildren() const
Get the number of children. Returns 0 if the node is a leaf.
Definition ASTNULLType.cpp:29
const char * typeName(void) const
Return the type name for this AST node. (for XML output)
Definition ASTNULLType.cpp:150
bool equalsListPartial(RefAST t) const
Definition ASTNULLType.cpp:44
bool attributesToStream(std ::ostream &out) const
std::string toStringList() const
Print out a child-sibling tree in LISP notation.
Definition ASTNULLType.cpp:128
int getType() const
Get the token type for this node.
Definition ASTNULLType.cpp:84
std ::vector< RefAST > findAllPartial(RefAST subtree)
Definition ASTNULLType.cpp:64
void initialize(int t, const std ::string &txt)
std::string toString() const
Return this AST node as a string.
Definition ASTNULLType.cpp:123
RefAST getFirstChild() const
Get the first child of this node; null if no children.
Definition ASTNULLType.cpp:69
bool equalsTree(RefAST t) const
Definition ASTNULLType.cpp:49
bool equalsTreePartial(RefAST t) const
Definition ASTNULLType.cpp:54
void setText(const std ::string &text)
Set the token text for this node.
Definition ASTNULLType.cpp:115
void setNextSibling(RefAST n)
Set the next sibling after this one.
Definition ASTNULLType.cpp:111
void setType(int ttype)
Set the token type for this node.
Definition ASTNULLType.cpp:119
void setFirstChild(RefAST c)
Set the first child of a node.
Definition ASTNULLType.cpp:107
bool equalsList(RefAST t) const
Definition ASTNULLType.cpp:39
std::string toStringTree() const
Definition ASTNULLType.cpp:133
bool equals(RefAST t) const
Is node t equal to this in terms of token type and text?
Definition ASTNULLType.cpp:34
std ::vector< RefAST > findAll(RefAST tree)
Definition ASTNULLType.cpp:59
void initialize(std ::istream &infile)
RefAST getNextSibling() const
Get the next sibling in line after this one.
Definition ASTNULLType.cpp:74
std::string getText() const
Get the token text for this node.
Definition ASTNULLType.cpp:79
void toStream(std ::ostream &out) const
void addChild(RefAST c)
Add a node to the end of the child list for this node.
Definition ASTNULLType.cpp:25
AST()
Definition AST.hpp:25
#define ANTLR_USE_NAMESPACE(_x_)
Definition config.hpp:18
#define ANTLR_API
Definition config.hpp:22
Definition ANTLRException.hpp:15