Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / TAO_IDL / include / ast_visitor.h
blob59ea51b7dfbb72880d544cfc31703a34dd4c6bf4
2 /* -*- c++ -*- */
3 //=============================================================================
4 /**
5 * @file ast_visitor.h
7 * The abstract AST visitor base class.
9 * @author Jeff Parsons <parsons@cs.wustl.edu>
11 //=============================================================================
14 #ifndef TAO_IDL_FE_DLL_AST_VISITOR_H
15 #define TAO_IDL_FE_DLL_AST_VISITOR_H
17 #include "TAO_IDL_FE_Export.h"
19 class AST_Decl;
20 class UTL_Scope;
21 class AST_Type;
22 class AST_PredefinedType;
23 class AST_Module;
24 class AST_Interface;
25 class AST_InterfaceFwd;
26 class AST_ValueBox;
27 class AST_ValueType;
28 class AST_ValueTypeFwd;
29 class AST_Component;
30 class AST_ComponentFwd;
31 class AST_PortType;
32 class AST_Provides;
33 class AST_Uses;
34 class AST_Publishes;
35 class AST_Emits;
36 class AST_Consumes;
37 class AST_Template_Module;
38 class AST_Template_Module_Inst;
39 class AST_Template_Module_Ref;
40 class AST_Extended_Port;
41 class AST_Mirror_Port;
42 class AST_Connector;
43 class AST_EventType;
44 class AST_EventTypeFwd;
45 class AST_Home;
46 class AST_Factory;
47 class AST_Finder;
48 class AST_Structure;
49 class AST_StructureFwd;
50 class AST_Exception;
51 class AST_Expression;
52 class AST_Enum;
53 class AST_Operation;
54 class AST_Field;
55 class AST_Argument;
56 class AST_Attribute;
57 class AST_Union;
58 class AST_UnionFwd;
59 class AST_UnionBranch;
60 class AST_UnionLabel;
61 class AST_Constant;
62 class AST_EnumVal;
63 class AST_Array;
64 class AST_Sequence;
65 class AST_Map;
66 class AST_String;
67 class AST_Typedef;
68 class AST_Root;
69 class AST_Native;
70 class AST_Param_Holder;
71 class AST_Fixed;
72 class AST_Annotation_Decl;
74 /**
75 * @class ast_visitor
77 * @brief ast_visitor.
79 * To implement BE processing we use the "Visitor Pattern", this
80 * is the abstract "Visitor". This class is the abstract base class
81 * for visitors that traverse the AST_<node> classes. Other abstract
82 * classes for C++ code generation, Java code generation, or IfR
83 * administration, for example, can be derived from this class and
84 * be the root of their own subtree of specialized visitor classes.
86 class TAO_IDL_FE_Export ast_visitor
88 public:
89 virtual ~ast_visitor ();
91 virtual int visit_decl (AST_Decl *d) = 0;
92 virtual int visit_scope (UTL_Scope *node) = 0;
93 virtual int visit_type (AST_Type *node) = 0;
94 virtual int visit_predefined_type (AST_PredefinedType *node) = 0;
95 virtual int visit_module (AST_Module *node) = 0;
96 virtual int visit_interface (AST_Interface *node) = 0;
97 virtual int visit_interface_fwd (AST_InterfaceFwd *node) = 0;
98 virtual int visit_valuetype (AST_ValueType *node) = 0;
99 virtual int visit_valuetype_fwd (AST_ValueTypeFwd *node) = 0;
100 virtual int visit_component (AST_Component *node) = 0;
101 virtual int visit_home (AST_Home *node) = 0;
102 virtual int visit_component_fwd (AST_ComponentFwd *node) = 0;
103 virtual int visit_template_module (AST_Template_Module *node) = 0;
104 virtual int visit_template_module_inst (AST_Template_Module_Inst *node) = 0;
105 virtual int visit_template_module_ref (AST_Template_Module_Ref *node) = 0;
106 virtual int visit_param_holder (AST_Param_Holder *node) = 0;
107 virtual int visit_porttype (AST_PortType *node) = 0;
108 virtual int visit_provides (AST_Provides *node) = 0;
109 virtual int visit_uses (AST_Uses *node) = 0;
110 virtual int visit_publishes (AST_Publishes *node) = 0;
111 virtual int visit_emits (AST_Emits *node) = 0;
112 virtual int visit_consumes (AST_Consumes *node) = 0;
113 virtual int visit_extended_port (AST_Extended_Port *node) = 0;
114 virtual int visit_mirror_port (AST_Mirror_Port *node) = 0;
115 virtual int visit_connector (AST_Connector *node) = 0;
116 virtual int visit_eventtype (AST_EventType *node) = 0;
117 virtual int visit_eventtype_fwd (AST_EventTypeFwd *node) = 0;
118 virtual int visit_factory (AST_Factory *node) = 0;
119 virtual int visit_finder (AST_Finder *node) = 0;
120 virtual int visit_structure (AST_Structure *node) = 0;
121 virtual int visit_structure_fwd (AST_StructureFwd *node) = 0;
122 virtual int visit_exception (AST_Exception *node) = 0;
123 virtual int visit_expression (AST_Expression *node) = 0;
124 virtual int visit_enum (AST_Enum *node) = 0;
125 virtual int visit_operation (AST_Operation *node) = 0;
126 virtual int visit_field (AST_Field *node) = 0;
127 virtual int visit_argument (AST_Argument *node) = 0;
128 virtual int visit_attribute (AST_Attribute *node) = 0;
129 virtual int visit_union (AST_Union *node) = 0;
130 virtual int visit_union_fwd (AST_UnionFwd *node) = 0;
131 virtual int visit_union_branch (AST_UnionBranch *node) = 0;
132 virtual int visit_union_label (AST_UnionLabel *node) = 0;
133 virtual int visit_constant (AST_Constant *node) = 0;
134 virtual int visit_enum_val (AST_EnumVal *node) = 0;
135 virtual int visit_array (AST_Array *node) = 0;
136 virtual int visit_sequence (AST_Sequence *node) = 0;
137 virtual int visit_string (AST_String *node) = 0;
138 virtual int visit_typedef (AST_Typedef *node) = 0;
139 virtual int visit_root (AST_Root *node) = 0;
140 virtual int visit_native (AST_Native *node) = 0;
141 virtual int visit_valuebox (AST_ValueBox *node) = 0;
143 // These are implemented as nops for backwards compatibility. New node types
144 // should go here.
145 virtual int visit_fixed (AST_Fixed *node);
146 virtual int visit_annotation_decl (AST_Annotation_Decl *node);
147 virtual int visit_map (AST_Map *node);
149 protected:
150 // For abstract class.
151 ast_visitor ();
154 #endif /* TAO_IDL_FE_DLL_AST_VISITOR_H */