summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/include/ast_visitor.h
blob: 1fbb566a7447873cf4da7dec2eb40c20cfc1f5f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
// $Id$

/* -*- c++ -*- */
// ============================================================================
//
// = LIBRARY
//    TAO_IDL_FE_DLL
//
// = FILENAME
//    ast_visitor.h
//
// = DESCRIPTION
//    The abstract AST visitor base class.
//
// = AUTHOR
//    Jeff Parsons <parsons@cs.wustl.edu>
//
// ============================================================================

#ifndef TAO_IDL_FE_DLL_AST_VISITOR_H
#define TAO_IDL_FE_DLL_AST_VISITOR_H

#include "TAO_IDL_FE_Export.h"

class AST_Decl;
class UTL_Scope;
class AST_Type;
class AST_PredefinedType;
class AST_Module;
class AST_Interface;
class AST_InterfaceFwd;
class AST_ValueBox;
class AST_ValueType;
class AST_ValueTypeFwd;
class AST_Component;
class AST_ComponentFwd;
class AST_EventType;
class AST_EventTypeFwd;
class AST_Home;
class AST_Factory;
class AST_Structure;
class AST_StructureFwd;
class AST_Exception;
class AST_Expression;
class AST_Enum;
class AST_Operation;
class AST_Field;
class AST_Argument;
class AST_Attribute;
class AST_Union;
class AST_UnionFwd;
class AST_UnionBranch;
class AST_UnionLabel;
class AST_Constant;
class AST_EnumVal;
class AST_Array;
class AST_Sequence;
class AST_String;
class AST_Typedef;
class AST_Root;
class AST_Native;

class TAO_IDL_FE_Export ast_visitor
{
  //
  // = TITLE
  //    ast_visitor.
  //
  // = DESCRIPTION
  //    To implement BE processing we use the "Visitor Pattern", this
  //    is the abstract "Visitor". This class is the abstract base class
  //    for visitors that traverse the AST_<node> classes. Other abstract
  //    classes for C++ code generation, Java code generation, or IfR
  //    administration, for example, can be derived from this class and
  //    be the root of their own subtree of specialized visitor classes.
  //
public:
  ast_visitor (void);
  // Constructor.

  virtual ~ast_visitor (void);
  // Destructor.

  virtual int visit_decl (AST_Decl *d) = 0;
  // Visit a decl node.

  virtual int visit_scope (UTL_Scope *node) = 0;
  // Visit the scope

  virtual int visit_type (AST_Type *node) = 0;
  // Visit the type.

  virtual int visit_predefined_type (AST_PredefinedType *node) = 0;
  // Visit the predefined type.

  virtual int visit_module (AST_Module *node) = 0;
  // Visit module.

  virtual int visit_interface (AST_Interface *node) = 0;
  // Visit interface.

  virtual int visit_interface_fwd (AST_InterfaceFwd *node) = 0;
  // Visit interface_fwd

  virtual int visit_valuetype (AST_ValueType *node) = 0;
  // Visit valuetype.

  virtual int visit_valuetype_fwd (AST_ValueTypeFwd *node) = 0;
  // Visit valuetype_fwd

  virtual int visit_component (AST_Component *node) = 0;
  // Visit component.

  virtual int visit_home (AST_Home *node) = 0;
  // Visit home.

  virtual int visit_component_fwd (AST_ComponentFwd *node) = 0;
  // Visit component_fwd

  virtual int visit_eventtype (AST_EventType *node) = 0;
  // Visit eventtype.

  virtual int visit_eventtype_fwd (AST_EventTypeFwd *node) = 0;
  // Visit eventtype_fwd

  virtual int visit_factory (AST_Factory *node) = 0;
  // Visit a OBV factory construct.

  virtual int visit_structure (AST_Structure *node) = 0;
  // Visit a structure.

  virtual int visit_structure_fwd (AST_StructureFwd *node) = 0;
  // Visit a structure.

  virtual int visit_exception (AST_Exception *node) = 0;
  // Visit exception

  virtual int visit_expression (AST_Expression *node) = 0;
  // Visit expression.

  virtual int visit_enum (AST_Enum *node) = 0;
  // Visit an enum.

  virtual int visit_operation (AST_Operation *node) = 0;
  // Visit an operation.

  virtual int visit_field (AST_Field *node) = 0;
  // Visit a field.

  virtual int visit_argument (AST_Argument *node) = 0;
  // Visit argument.

  virtual int visit_attribute (AST_Attribute *node) = 0;
  // Visit an attribute.

  virtual int visit_union (AST_Union *node) = 0;
  // Visit union.

  virtual int visit_union_fwd (AST_UnionFwd *node) = 0;
  // Visit union.

  virtual int visit_union_branch (AST_UnionBranch *node) = 0;
  // Visit union branch.

  virtual int visit_union_label (AST_UnionLabel *node) = 0;
  // Visit union label.

  virtual int visit_constant (AST_Constant *node) = 0;
  // Visit a constant.

  virtual int visit_enum_val (AST_EnumVal *node) = 0;
  // Visit enum val.

  virtual int visit_array (AST_Array *node) = 0;
  // Visit an array.

  virtual int visit_sequence (AST_Sequence *node) = 0;
  // Visit a sequence.

  virtual int visit_string (AST_String *node) = 0;
  // Visit a string.

  virtual int visit_typedef (AST_Typedef *node) = 0;
  // Visit a typedef.

  virtual int visit_root (AST_Root *node) = 0;
  // Visit a root.

  virtual int visit_native (AST_Native *node) = 0;
  // Visit a native.

  virtual int visit_valuebox (AST_ValueBox *node) = 0;
  // Visit a valuebox.
};

#endif /* TAO_IDL_FE_DLL_AST_VISITOR_H */