1#ifndef INC_ASTFactory_hpp__
2#define INC_ASTFactory_hpp__
19#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
111#ifdef ANTLR_SUPPORT_XML
123#ifdef ANTLR_VECTOR_HAS_AT
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;
161#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
std ::pair< const char *, factory_type_ > factory_descriptor_
Definition ASTFactory.hpp:25
RefAST(* factory_type_)()
Definition ASTFactory.hpp:24
std ::vector< factory_descriptor_ * > factory_descriptor_list_
Definition ASTFactory.hpp:26
ASTRefCount< AST > RefAST
Definition ASTRefCount.hpp:92
TokenRefCount< Token > RefToken
Definition TokenRefCount.hpp:92
Definition ASTArray.hpp:23
RefAST create(const std ::string &txt, std ::istream &infile)
Create new AST node and initialize contents from a stream.
void registerFactory(int type, const char *ast_name, factory_type factory)
Register a node factory for the node type type with name ast_name.
Definition ASTFactory.cpp:69
factory_descriptor_list_ factory_descriptor_list
Definition ASTFactory.hpp:40
factory_type getASTNodeFactory(unsigned int type)
Definition ASTFactory.hpp:149
RefAST dupList(RefAST t)
Duplicate tree including siblings of root.
Definition ASTFactory.cpp:200
factory_descriptor default_factory_descriptor
Definition ASTFactory.hpp:44
factory_descriptor_list nodeFactories
Definition ASTFactory.hpp:45
RefAST make(std ::vector< RefAST > &nodes)
Definition ASTFactory.cpp:232
const char * getASTNodeType(unsigned int type)
get the name of the node 'type'
Definition ASTFactory.hpp:145
void loadChildren(std ::istream &infile, RefAST current)
factory_descriptor_ factory_descriptor
Definition ASTFactory.hpp:39
ASTFactory & operator=(const ASTFactory &)
factory_type_ factory_type
Definition ASTFactory.hpp:38
RefAST getNodeOfType(unsigned int type)
Definition ASTFactory.hpp:140
void setASTNodeFactory(const char *factory_node_name, factory_type factory)
Definition ASTFactory.cpp:298
void addASTChild(ASTPair ¤tAST, RefAST child)
Add a child to the current AST.
Definition ASTFactory.cpp:161
bool checkCloseTag(std ::istream &infile)
void makeASTRoot(ASTPair ¤tAST, RefAST root)
Make an AST the root of current AST.
Definition ASTFactory.cpp:284
virtual RefAST create()
Create new empty AST node. The right default type shou.
Definition ASTFactory.cpp:95
ASTFactory(const ASTFactory &)
void setMaxNodeType(int type)
Set the maximum node (AST) type this factory may encounter.
Definition ASTFactory.cpp:86
void loadSiblings(std ::istream &infile, RefAST current)
RefAST dup(RefAST t)
Definition ASTFactory.cpp:191
RefAST dupTree(RefAST t)
Definition ASTFactory.cpp:217
ASTFactory()
Make new factory. Per default (Ref)CommonAST instances are generated.
Definition ASTFactory.cpp:39
Definition ASTPair.hpp:26
#define ANTLR_USE_NAMESPACE(_x_)
Definition config.hpp:18
#define ANTLR_API
Definition config.hpp:22
Definition ANTLRException.hpp:15