summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/include/ast_visitor.h
blob: 70c4fc73f7e6715b02e7ed4135b29c48286daf35 (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

/* -*- c++ -*- */
//=============================================================================
/**
 *  @file    ast_visitor.h
 *
 *  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_PortType;
class AST_Provides;
class AST_Uses;
class AST_Publishes;
class AST_Emits;
class AST_Consumes;
class AST_Template_Module;
class AST_Template_Module_Inst;
class AST_Template_Module_Ref;
class AST_Extended_Port;
class AST_Mirror_Port;
class AST_Connector;
class AST_EventType;
class AST_EventTypeFwd;
class AST_Home;
class AST_Factory;
class AST_Finder;
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 AST_Param_Holder;
class AST_Fixed;
class AST_Annotation_Decl;

/**
 * @class ast_visitor
 *
 * @brief ast_visitor.
 *
 * 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.
 */
class TAO_IDL_FE_Export ast_visitor
{
public:
  virtual ~ast_visitor ();

  virtual int visit_decl (AST_Decl *d) = 0;
  virtual int visit_scope (UTL_Scope *node) = 0;
  virtual int visit_type (AST_Type *node) = 0;
  virtual int visit_predefined_type (AST_PredefinedType *node) = 0;
  virtual int visit_module (AST_Module *node) = 0;
  virtual int visit_interface (AST_Interface *node) = 0;
  virtual int visit_interface_fwd (AST_InterfaceFwd *node) = 0;
  virtual int visit_valuetype (AST_ValueType *node) = 0;
  virtual int visit_valuetype_fwd (AST_ValueTypeFwd *node) = 0;
  virtual int visit_component (AST_Component *node) = 0;
  virtual int visit_home (AST_Home *node) = 0;
  virtual int visit_component_fwd (AST_ComponentFwd *node) = 0;
  virtual int visit_template_module (AST_Template_Module *node) = 0;
  virtual int visit_template_module_inst (AST_Template_Module_Inst *node) = 0;
  virtual int visit_template_module_ref (AST_Template_Module_Ref *node) = 0;
  virtual int visit_param_holder (AST_Param_Holder *node) = 0;
  virtual int visit_porttype (AST_PortType *node) = 0;
  virtual int visit_provides (AST_Provides *node) = 0;
  virtual int visit_uses (AST_Uses *node) = 0;
  virtual int visit_publishes (AST_Publishes *node) = 0;
  virtual int visit_emits (AST_Emits *node) = 0;
  virtual int visit_consumes (AST_Consumes *node) = 0;
  virtual int visit_extended_port (AST_Extended_Port *node) = 0;
  virtual int visit_mirror_port (AST_Mirror_Port *node) = 0;
  virtual int visit_connector (AST_Connector *node) = 0;
  virtual int visit_eventtype (AST_EventType *node) = 0;
  virtual int visit_eventtype_fwd (AST_EventTypeFwd *node) = 0;
  virtual int visit_factory (AST_Factory *node) = 0;
  virtual int visit_finder (AST_Finder *node) = 0;
  virtual int visit_structure (AST_Structure *node) = 0;
  virtual int visit_structure_fwd (AST_StructureFwd *node) = 0;
  virtual int visit_exception (AST_Exception *node) = 0;
  virtual int visit_expression (AST_Expression *node) = 0;
  virtual int visit_enum (AST_Enum *node) = 0;
  virtual int visit_operation (AST_Operation *node) = 0;
  virtual int visit_field (AST_Field *node) = 0;
  virtual int visit_argument (AST_Argument *node) = 0;
  virtual int visit_attribute (AST_Attribute *node) = 0;
  virtual int visit_union (AST_Union *node) = 0;
  virtual int visit_union_fwd (AST_UnionFwd *node) = 0;
  virtual int visit_union_branch (AST_UnionBranch *node) = 0;
  virtual int visit_union_label (AST_UnionLabel *node) = 0;
  virtual int visit_constant (AST_Constant *node) = 0;
  virtual int visit_enum_val (AST_EnumVal *node) = 0;
  virtual int visit_array (AST_Array *node) = 0;
  virtual int visit_sequence (AST_Sequence *node) = 0;
  virtual int visit_string (AST_String *node) = 0;
  virtual int visit_typedef (AST_Typedef *node) = 0;
  virtual int visit_root (AST_Root *node) = 0;
  virtual int visit_native (AST_Native *node) = 0;
  virtual int visit_valuebox (AST_ValueBox *node) = 0;
  virtual int visit_fixed (AST_Fixed *node);
  virtual int visit_annotation_decl (AST_Annotation_Decl *node);

protected:
  // For abstract class.
  ast_visitor ();
};

#endif /* TAO_IDL_FE_DLL_AST_VISITOR_H */