1 #ifndef INC_ASTFactory_hpp__
2 #define INC_ASTFactory_hpp__
19 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
54 ASTFactory(
const char* factory_node_name, factory_type factory );
56 virtual ~ASTFactory();
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
125 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;
140 inline RefAST getNodeOfType(
unsigned int type )
142 return RefAST(nodeFactories[type]->second());
145 const char* getASTNodeType(
unsigned int type )
147 return nodeFactories[type]->first;
149 factory_type getASTNodeFactory(
unsigned int type )
151 return nodeFactories[type]->second;
157 ASTFactory(
const ASTFactory& );
158 ASTFactory& operator=(
const ASTFactory& );
161 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
165 #endif //INC_ASTFactory_hpp__