summaryrefslogtreecommitdiff
path: root/trunk/CIAO/CCF/CCF/IDL3/Parser.hpp
blob: 715045f2466b9a37f1fdfc72a1b336d190d8ee30 (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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
// file      : CCF/IDL3/Parser.hpp
// author    : Boris Kolpackov <boris@dre.vanderbilt.edu>
// cvs-id    : $Id$

#ifndef CCF_IDL3_PARSER_HPP
#define CCF_IDL3_PARSER_HPP

#include "CCF/IDL2/Parser.hpp"

#include "CCF/IDL3/LexicalAnalyzer.hpp"
#include "CCF/IDL3/SemanticAction.hpp"

namespace CCF
{
  namespace IDL3
  {
    using IDL2::ActionExecutor;
    using IDL2::NoArgAction;
    using IDL2::OneArgAction;
    using IDL2::TwoArgAction;

    class Parser : public virtual IDL2::Parser
    {
    protected:
      //
      // Primitives (alphabetic order).
      //

      KeywordParser COMPONENT;
      KeywordParser CONSUMES;
      KeywordParser EMITS;
      KeywordParser EVENTTYPE;
      KeywordParser HOME;
      KeywordParser FINDER;
      KeywordParser MANAGES;
      KeywordParser MULTIPLE;
      KeywordParser PROVIDES;
      KeywordParser PUBLISHES;
      KeywordParser USES;


      //
      // Language
      //

      Rule extension;

      // component
      //
      Rule component_decl;
      Rule component_inheritance_spec;
      Rule component_support_spec;
      Rule component_body;

      Rule provides_decl;
      Rule uses_decl;
      Rule emits_decl;
      Rule publishes_decl;
      Rule consumes_decl;

      // eventtype
      //
      Rule abstract_event_type_decl;
      Rule concrete_event_type_decl;
      Rule event_type_inheritance_spec;
      Rule event_type_supports_spec;
      Rule event_type_body;

      Rule event_type_factory_decl;
      Rule event_type_factory_parameter_list;
      Rule event_type_factory_parameter;
      Rule event_type_factory_raises_list;

      // home
      //
      Rule home_decl;
      Rule home_inheritance_spec;
      Rule home_support_spec;
      Rule home_body;

      Rule home_factory_decl;
      Rule home_factory_parameter_list;
      Rule home_factory_parameter;
      Rule home_factory_raises_list;

      Rule home_finder_decl;
      Rule home_finder_parameter_list;
      Rule home_finder_parameter;
      Rule home_finder_raises_list;

    public:
      Parser (CompilerElements::Context& context,
              Diagnostic::Stream& dout,
              LexicalAnalyzer const& l,
              SemanticAction::Factory& f);

    protected:
      // Component
      //
      OneArgAction<SimpleIdentifierPtr, SemanticAction::Component>
      act_component_begin_def, act_component_begin_fwd;

      OneArgAction<IdentifierPtr, SemanticAction::Component>
      act_component_inherits;

      OneArgAction<IdentifierPtr, SemanticAction::Component>
      act_component_supports;

      ScopeAction
      act_component_open_scope;

      ScopeAction
      act_component_close_scope;

      NoArgAction<SemanticAction::Component>
      act_component_end;


      // Provides
      //
      OneArgAction<IdentifierPtr, SemanticAction::Provides>
      act_provides_type;

      OneArgAction<SimpleIdentifierPtr, SemanticAction::Provides>
      act_provides_name;


      // Uses
      //
      NoArgAction<SemanticAction::Uses>
      act_uses_multiple;

      OneArgAction<IdentifierPtr, SemanticAction::Uses>
      act_uses_type;

      OneArgAction<SimpleIdentifierPtr, SemanticAction::Uses>
      act_uses_name;


      // Publishes
      //
      OneArgAction<IdentifierPtr, SemanticAction::Publishes>
      act_publishes_type;

      OneArgAction<SimpleIdentifierPtr, SemanticAction::Publishes>
      act_publishes_name;


      // Emits
      //
      OneArgAction<IdentifierPtr, SemanticAction::Emits>
      act_emits_type;

      OneArgAction<SimpleIdentifierPtr, SemanticAction::Emits>
      act_emits_name;


      // Consumes
      //
      OneArgAction<IdentifierPtr, SemanticAction::Consumes>
      act_consumes_type;

      OneArgAction<SimpleIdentifierPtr, SemanticAction::Consumes>
      act_consumes_name;


      // EventType
      //
      OneArgAction<SimpleIdentifierPtr, SemanticAction::EventType>
      act_event_type_begin_abstract_def,
      act_event_type_begin_abstract_fwd,
      act_event_type_begin_concrete_def,
      act_event_type_begin_concrete_fwd;

      OneArgAction<IdentifierPtr, SemanticAction::EventType>
      act_event_type_inherits, act_event_type_supports;

      ScopeAction
      act_event_type_open_scope;

      ScopeAction
      act_event_type_close_scope;

      NoArgAction<SemanticAction::EventType>
      act_event_type_end;

      // EventTypeFactory
      //
      OneArgAction<SimpleIdentifierPtr, SemanticAction::EventTypeFactory>
      act_event_type_factory_name;

      TwoArgAction<IdentifierPtr,
                   SimpleIdentifierPtr,
                   SemanticAction::EventTypeFactory>
      act_event_type_factory_parameter;

      OneArgAction<IdentifierPtr, SemanticAction::EventTypeFactory>
      act_event_type_factory_raises;


      // Home
      //
      OneArgAction<SimpleIdentifierPtr, SemanticAction::Home>
      act_home_begin;

      OneArgAction<IdentifierPtr, SemanticAction::Home>
      act_home_inherits;

      OneArgAction<IdentifierPtr, SemanticAction::Home>
      act_home_supports;

      OneArgAction<IdentifierPtr, SemanticAction::Home>
      act_home_manages;

      ScopeAction
      act_home_open_scope;

      ScopeAction
      act_home_close_scope;

      NoArgAction<SemanticAction::Home>
      act_home_end;


      // HomeFactory
      //
      OneArgAction<SimpleIdentifierPtr, SemanticAction::HomeFactory>
      act_home_factory_name;

      TwoArgAction<IdentifierPtr,
                   SimpleIdentifierPtr,
                   SemanticAction::HomeFactory>
      act_home_factory_parameter;

      OneArgAction<IdentifierPtr, SemanticAction::HomeFactory>
      act_home_factory_raises;


      // HomeFinder
      //
      OneArgAction<SimpleIdentifierPtr, SemanticAction::HomeFinder>
      act_home_finder_name;

      TwoArgAction<IdentifierPtr,
                   SimpleIdentifierPtr,
                   SemanticAction::HomeFinder>
      act_home_finder_parameter;

      OneArgAction<IdentifierPtr, SemanticAction::HomeFinder>
      act_home_finder_raises;

    };
  }
}

#endif  // CCF_IDL3_PARSER_HPP