ANTLR Support Libraries 2.7.1+
|
Go to the documentation of this file. 1 #ifndef INC_ASTFactory_hpp__
2 #define INC_ASTFactory_hpp__
19 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
59 void registerFactory(
int type,
const char* ast_name,
factory_type factory );
61 void setMaxNodeType(
int type );
109 void setASTNodeFactory(
const char* factory_node_name,
factory_type factory );
111 #ifdef ANTLR_SUPPORT_XML
123 #ifdef ANTLR_VECTOR_HAS_AT
124 inline RefAST getNodeOfType(
unsigned int type )
127 return RefAST(nodeFactories.at(type)->second());
130 const char* getASTNodeType(
unsigned int type )
132 return nodeFactories.at(type)->first;
135 factory_type getASTNodeFactory(
unsigned int type )
137 return nodeFactories.at(type)->second;
142 return RefAST(nodeFactories[type]->second());
147 return nodeFactories[type]->first;
151 return nodeFactories[type]->second;
161 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
165 #endif //INC_ASTFactory_hpp__
bool checkCloseTag(std ::istream &infile)
factory_descriptor_list_ factory_descriptor_list
Definition: ASTFactory.hpp:40
factory_descriptor_ factory_descriptor
Definition: ASTFactory.hpp:39
std ::pair< const char *, factory_type_ > factory_descriptor_
Definition: ASTFactory.hpp:25
std ::vector< factory_descriptor_ * > factory_descriptor_list_
Definition: ASTFactory.hpp:26
RefAST create(const std ::string &txt, std ::istream &infile)
Create new AST node and initialize contents from a stream.
Definition: ASTFactory.hpp:36
RefAST(* factory_type_)()
Definition: ASTFactory.hpp:24
RefAST getNodeOfType(unsigned int type)
Definition: ASTFactory.hpp:140
Definition: ASTPair.hpp:26
factory_descriptor_list nodeFactories
Definition: ASTFactory.hpp:45
ASTFactory & operator=(const ASTFactory &)
ASTFactory(const ASTFactory &)
void loadChildren(std ::istream &infile, RefAST current)
factory_type_ factory_type
Definition: ASTFactory.hpp:38
factory_type getASTNodeFactory(unsigned int type)
Definition: ASTFactory.hpp:149
Definition: ASTArray.hpp:23
void loadSiblings(std ::istream &infile, RefAST current)
factory_descriptor default_factory_descriptor
Definition: ASTFactory.hpp:44
#define ANTLR_API
Definition: config.hpp:22
const char * getASTNodeType(unsigned int type)
get the name of the node 'type'
Definition: ASTFactory.hpp:145
Definition: ANTLRException.hpp:15
#define ANTLR_USE_NAMESPACE(_x_)
Definition: config.hpp:18
ASTRefCount< AST > RefAST
Definition: ASTRefCount.hpp:92