3 //=============================================================================
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"
22 class AST_PredefinedType
;
25 class AST_InterfaceFwd
;
28 class AST_ValueTypeFwd
;
30 class AST_ComponentFwd
;
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
;
44 class AST_EventTypeFwd
;
49 class AST_StructureFwd
;
59 class AST_UnionBranch
;
70 class AST_Param_Holder
;
72 class AST_Annotation_Decl
;
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
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
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
);
150 // For abstract class.
154 #endif /* TAO_IDL_FE_DLL_AST_VISITOR_H */