~ubuntu-branches/ubuntu/quantal/aspectc++/quantal

« back to all changes in this revision

Viewing changes to Puma/gen-release/step1/aspects/CMatchSyntax.ah

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2008-04-10 17:40:52 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080410174052-xdnsm7oi8hauyyf1
Tags: 1.0pre4~svn.20080409+dfsg-3
Fix another missing include, this time in Ag++/StdSystem.cc

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#ifndef __CMatchSyntax_ah__
20
20
#define __CMatchSyntax_ah__
21
21
 
 
22
#include <string.h>
 
23
 
22
24
#include "Puma/CWildcardTokens.h"
23
25
#include "Puma/CTokens.h"
24
26
#include "Puma/StrCol.h"
41
43
} // namespace Puma
42
44
 
43
45
 
44
 
using namespace Puma;
45
 
 
46
46
namespace Puma {
47
47
  slice class CMatchCSyntax;
48
48
  slice class CMatchCCSyntax;
73
73
  advice csemantic () : slice class {
74
74
  public:
75
75
    virtual CTree *wc_extension () {
76
 
      CT_AnyExtension *ext = (CT_AnyExtension*)builder ().wc_extension ();
 
76
      Puma::CT_AnyExtension *ext = (Puma::CT_AnyExtension*)builder ().wc_extension ();
77
77
      if (ext->String ()) {
78
 
        char *name = StrCol::dup (ext->String ()->token ()->text ());
 
78
        char *name = Puma::StrCol::dup (ext->String ()->token ()->text ());
79
79
        name++;
80
80
        name[strlen (name) - 1] = '\0';
81
 
        ext->SemValue ()->setValue (new CStrLiteral (name, strlen (name), 0));
 
81
        ext->SemValue ()->setValue (new Puma::CStrLiteral (name, strlen (name), 0));
82
82
      }
83
83
      return ext;
84
84
    }
89
89
   execution ("%::CTree * Puma::%::trans_unit()") : around () { 
90
90
    if (match_expr &&
91
91
        thisJoinPoint->that ()->parse (&JoinPoint::That::wildcards)) 
92
 
      *(CTree**)thisJoinPoint->result () = 
 
92
      *(Puma::CTree**)thisJoinPoint->result () = 
93
93
        thisJoinPoint->that ()->builder ().get_node (); 
94
94
    else 
95
95
      thisJoinPoint->action ().trigger (); 
99
99
 
100
100
  advice within (derived (csyntax ())) && 
101
101
   execution ("%::CTree * Puma::%::literal()") : around () { 
102
 
    if (match_expr && thisJoinPoint->that ()->parse (TOK_ANY_EXPR)) {
 
102
    if (match_expr && thisJoinPoint->that ()->parse (Puma::TOK_ANY_EXPR)) {
103
103
      thisJoinPoint->that ()->parse (&JoinPoint::That::wc_extension); 
104
 
      *(CTree**)thisJoinPoint->result () = 
 
104
      *(Puma::CTree**)thisJoinPoint->result () = 
105
105
        thisJoinPoint->that ()->builder ().any (); 
106
106
    } else 
107
107
      thisJoinPoint->action ().trigger (); 
109
109
 
110
110
  advice within (derived (csyntax ())) && 
111
111
   execution ("%::CTree * Puma::%::expr_list()") : around () { 
112
 
    if (match_expr && thisJoinPoint->that ()->parse (TOK_ANY_EXPR_LIST)) {
 
112
    if (match_expr && thisJoinPoint->that ()->parse (Puma::TOK_ANY_EXPR_LIST)) {
113
113
      thisJoinPoint->that ()->parse (&JoinPoint::That::wc_extension); 
114
 
      *(CTree**)thisJoinPoint->result () = 
 
114
      *(Puma::CTree**)thisJoinPoint->result () = 
115
115
        thisJoinPoint->that ()->builder ().any_list (); 
116
116
    } else 
117
117
      thisJoinPoint->action ().trigger (); 
119
119
 
120
120
  advice within (derived (csyntax ())) && 
121
121
   execution ("%::CTree * Puma::%::id_expr()") : around () { 
122
 
    if (match_expr && thisJoinPoint->that ()->parse (TOK_ANY_ID_EXPR)) {
 
122
    if (match_expr && thisJoinPoint->that ()->parse (Puma::TOK_ANY_ID_EXPR)) {
123
123
      thisJoinPoint->that ()->parse (&JoinPoint::That::wc_extension); 
124
 
      *(CTree**)thisJoinPoint->result () = 
 
124
      *(Puma::CTree**)thisJoinPoint->result () = 
125
125
        thisJoinPoint->that ()->builder ().any (); 
126
126
    } else 
127
127
      thisJoinPoint->action ().trigger (); 
128
128
  }
129
129
 
130
130
  advice within (derived (csyntax ())) && 
131
 
   execution ("%::CTree * Puma::%::identifier()") : around () { 
132
 
    if (match_expr && thisJoinPoint->that ()->parse (TOK_ANY_IDENTIFIER)) {
 
131
   execution ("%::Puma::CTree * Puma::%::identifier()") : around () { 
 
132
    if (match_expr && thisJoinPoint->that ()->parse (Puma::TOK_ANY_IDENTIFIER)) {
133
133
      thisJoinPoint->that ()->parse (&JoinPoint::That::wc_extension); 
134
 
      *(CTree**)thisJoinPoint->result () = 
 
134
      *(Puma::CTree**)thisJoinPoint->result () = 
135
135
        thisJoinPoint->that ()->builder ().any (); 
136
136
    } else 
137
137
      thisJoinPoint->action ().trigger (); 
139
139
 
140
140
  advice within (derived (csyntax ())) &&
141
141
    execution ("bool Puma::%::init_decl_spec()") : after () {
142
 
      tjp->that ()->_decl_spec_1.set (TOK_ANY_DECL_SPEC);
 
142
      tjp->that ()->_decl_spec_1.set (Puma::TOK_ANY_DECL_SPEC);
143
143
  }
144
144
  
145
145
  advice within (derived (csyntax ())) && 
146
 
   execution ("%::CTree * Puma::%::rule_decl_spec()") : after () { 
147
 
    CTree *&result = *(CTree**)tjp->result ();
 
146
   execution ("%::Puma::CTree * Puma::%::rule_decl_spec()") : after () { 
 
147
    Puma::CTree *&result = *(Puma::CTree**)tjp->result ();
148
148
    if (match_expr && !result &&
149
 
        tjp->that ()->parse (TOK_ANY_DECL_SPEC) &&
 
149
        tjp->that ()->parse (Puma::TOK_ANY_DECL_SPEC) &&
150
150
        tjp->that ()->parse (&JoinPoint::That::wc_extension)) {
151
151
      result = tjp->that ()->builder().any ();
152
152
    }
153
153
  }
154
154
 
155
155
  advice within (derived (csyntax ())) && 
156
 
   execution ("%::CTree * Puma::%::decl_spec_seq()") : around () { 
157
 
    if (match_expr && thisJoinPoint->that ()->parse (TOK_ANY_DECL_SPEC_SEQ)) {
158
 
      thisJoinPoint->that ()->parse (&JoinPoint::That::wc_extension); 
159
 
      *(CTree**)thisJoinPoint->result () = 
160
 
        thisJoinPoint->that ()->builder ().any_list (); 
161
 
    } else 
162
 
      thisJoinPoint->action ().trigger (); 
163
 
  }
164
 
 
165
 
  advice within (derived (csyntax ())) && 
166
 
   execution ("%::CTree * Puma::%::init_declarator_list()") : around () { 
167
 
    if (match_expr && thisJoinPoint->that ()->parse (TOK_ANY_INIT_DECLARATOR_LIST)) {
168
 
      thisJoinPoint->that ()->parse (&JoinPoint::That::wc_extension); 
169
 
      *(CTree**)thisJoinPoint->result () = 
170
 
        thisJoinPoint->that ()->builder ().any_list (); 
171
 
    } else 
172
 
      thisJoinPoint->action ().trigger (); 
173
 
  }
174
 
 
175
 
  advice within (derived (csyntax ())) && 
176
 
   execution ("%::CTree * Puma::%::init_declarator()") : around () { 
177
 
    if (match_expr && thisJoinPoint->that ()->parse (TOK_ANY_INIT_DECLARATOR)) {
178
 
      thisJoinPoint->that ()->parse (&JoinPoint::That::wc_extension); 
179
 
      *(CTree**)thisJoinPoint->result () = 
180
 
        thisJoinPoint->that ()->builder ().any (); 
181
 
    } else 
182
 
      thisJoinPoint->action ().trigger (); 
183
 
  }
184
 
 
185
 
  advice within (derived (csyntax ())) && 
186
 
   execution ("%::CTree * Puma::%::declarator()") : around () { 
187
 
    if (match_expr && thisJoinPoint->that ()->parse (TOK_ANY_DECLARATOR)) {
188
 
      thisJoinPoint->that ()->parse (&JoinPoint::That::wc_extension); 
189
 
      *(CTree**)thisJoinPoint->result () = 
190
 
        thisJoinPoint->that ()->builder ().any (); 
191
 
    } else 
192
 
      thisJoinPoint->action ().trigger (); 
193
 
  }
194
 
 
195
 
  advice within (derived (csyntax ())) && 
196
 
   execution ("%::CTree * Puma::%::init()") : around () { 
197
 
    if (match_expr && thisJoinPoint->that ()->parse (TOK_ANY_INIT)) {
198
 
      thisJoinPoint->that ()->parse (&JoinPoint::That::wc_extension); 
199
 
      *(CTree**)thisJoinPoint->result () = 
200
 
        thisJoinPoint->that ()->builder ().any (); 
201
 
    } else 
202
 
      thisJoinPoint->action ().trigger (); 
203
 
  }
204
 
 
205
 
  advice within (derived (csyntax ())) && 
206
 
   execution ("%::CTree * Puma::%::arg_decl_seq()") : around () { 
207
 
    if (match_expr && thisJoinPoint->that ()->parse (TOK_ANY_ARG_DECL_SEQ)) {
208
 
      thisJoinPoint->that ()->parse (&JoinPoint::That::wc_extension); 
209
 
      *(CTree**)thisJoinPoint->result () = 
210
 
        thisJoinPoint->that ()->builder ().any_list (); 
211
 
    } else 
212
 
      thisJoinPoint->action ().trigger (); 
213
 
  }
214
 
 
215
 
  advice within (derived (csyntax ())) && 
216
 
   execution ("%::CTree * Puma::%::fct_body()") : around () { 
217
 
    if (match_expr && thisJoinPoint->that ()->parse (TOK_ANY_FCT_BODY)) {
218
 
      thisJoinPoint->that ()->parse (&JoinPoint::That::wc_extension); 
219
 
      *(CTree**)thisJoinPoint->result () = 
220
 
        thisJoinPoint->that ()->builder ().any (); 
221
 
    } else 
222
 
      thisJoinPoint->action ().trigger (); 
223
 
  }
224
 
 
225
 
  advice within (derived (csyntax ())) && 
226
 
   execution ("%::CTree * Puma::%::class_spec()") : around () { 
227
 
    if (match_expr && thisJoinPoint->that ()->parse (TOK_ANY_CLASS_SPEC)) {
228
 
      thisJoinPoint->that ()->parse (&JoinPoint::That::wc_extension); 
229
 
      *(CTree**)thisJoinPoint->result () = 
230
 
        thisJoinPoint->that ()->builder ().any (); 
231
 
    } else 
232
 
      thisJoinPoint->action ().trigger (); 
233
 
  }
234
 
 
235
 
  advice within (derived (csyntax ())) && 
236
 
   execution ("%::CTree * Puma::%::member_spec()") : around () { 
237
 
    if (match_expr && thisJoinPoint->that ()->parse (TOK_ANY_MEMBER_SPEC)) {
238
 
      thisJoinPoint->that ()->parse (&JoinPoint::That::wc_extension); 
239
 
      *(CTree**)thisJoinPoint->result () = 
240
 
        thisJoinPoint->that ()->builder ().any_list (); 
241
 
    } else 
242
 
      thisJoinPoint->action ().trigger (); 
243
 
  }
244
 
 
245
 
  advice within (derived (csyntax ())) && 
246
 
   execution ("%::CTree * Puma::%::member_decl()") : around () { 
247
 
    if (match_expr && thisJoinPoint->that ()->parse (TOK_ANY_MEMBER_DECL)) {
248
 
      thisJoinPoint->that ()->parse (&JoinPoint::That::wc_extension); 
249
 
      *(CTree**)thisJoinPoint->result () = 
250
 
        thisJoinPoint->that ()->builder ().any (); 
251
 
    } else 
252
 
      thisJoinPoint->action ().trigger (); 
253
 
  }
254
 
 
255
 
  advice within (derived (csyntax ())) && 
256
 
   execution ("%::CTree * Puma::%::stmt()") : around () { 
257
 
    if (match_expr && thisJoinPoint->that ()->parse (TOK_ANY_STMT)) {
258
 
      thisJoinPoint->that ()->parse (&JoinPoint::That::wc_extension); 
259
 
      *(CTree**)thisJoinPoint->result () = 
260
 
        thisJoinPoint->that ()->builder ().any (); 
261
 
    } else 
262
 
      thisJoinPoint->action ().trigger (); 
263
 
  }
264
 
 
265
 
  advice within (derived (csyntax ())) && 
266
 
   execution ("%::CTree * Puma::%::stmt_seq()") : around () { 
267
 
    if (match_expr && thisJoinPoint->that ()->parse (TOK_ANY_STMT_SEQ)) {
268
 
      thisJoinPoint->that ()->parse (&JoinPoint::That::wc_extension); 
269
 
      *(CTree**)thisJoinPoint->result () = 
270
 
        thisJoinPoint->that ()->builder ().any_list (); 
271
 
    } else 
272
 
      thisJoinPoint->action ().trigger (); 
273
 
  }
274
 
 
275
 
  advice within (derived (ccsyntax ())) && 
276
 
   execution ("%::CTree * Puma::%::base_clause()") : around () { 
277
 
    if (match_expr && thisJoinPoint->that ()->parse (TOK_ANY_BASE_CLAUSE)) {
278
 
      thisJoinPoint->that ()->parse (&JoinPoint::That::wc_extension); 
279
 
      *(CTree**)thisJoinPoint->result () = 
280
 
        thisJoinPoint->that ()->builder ().any_list (); 
281
 
    } else 
282
 
      thisJoinPoint->action ().trigger (); 
283
 
  }
284
 
 
285
 
  advice within (derived (ccsyntax ())) && 
286
 
   execution ("%::CTree * Puma::%::ctor_init()") : around () { 
287
 
    if (match_expr && thisJoinPoint->that ()->parse (TOK_ANY_CTOR_INIT)) {
288
 
      thisJoinPoint->that ()->parse (&JoinPoint::That::wc_extension); 
289
 
      *(CTree**)thisJoinPoint->result () = 
290
 
        thisJoinPoint->that ()->builder ().any (); 
291
 
    } else 
292
 
      thisJoinPoint->action ().trigger (); 
293
 
  }
294
 
 
295
 
  advice within (derived (ccsyntax ())) && 
296
 
   execution ("%::CTree * Puma::%::mem_init()") : around () { 
297
 
    if (match_expr && thisJoinPoint->that ()->parse (TOK_ANY_MEM_INIT)) {
298
 
      thisJoinPoint->that ()->parse (&JoinPoint::That::wc_extension); 
299
 
      *(CTree**)thisJoinPoint->result () = 
 
156
   execution ("%::Puma::CTree * Puma::%::decl_spec_seq()") : around () { 
 
157
    if (match_expr && thisJoinPoint->that ()->parse (Puma::TOK_ANY_DECL_SPEC_SEQ)) {
 
158
      thisJoinPoint->that ()->parse (&JoinPoint::That::wc_extension); 
 
159
      *(Puma::CTree**)thisJoinPoint->result () = 
 
160
        thisJoinPoint->that ()->builder ().any_list (); 
 
161
    } else 
 
162
      thisJoinPoint->action ().trigger (); 
 
163
  }
 
164
 
 
165
  advice within (derived (csyntax ())) && 
 
166
   execution ("%::Puma::CTree * Puma::%::init_declarator_list()") : around () { 
 
167
    if (match_expr && thisJoinPoint->that ()->parse (Puma::TOK_ANY_INIT_DECLARATOR_LIST)) {
 
168
      thisJoinPoint->that ()->parse (&JoinPoint::That::wc_extension); 
 
169
      *(Puma::CTree**)thisJoinPoint->result () = 
 
170
        thisJoinPoint->that ()->builder ().any_list (); 
 
171
    } else 
 
172
      thisJoinPoint->action ().trigger (); 
 
173
  }
 
174
 
 
175
  advice within (derived (csyntax ())) && 
 
176
   execution ("%::Puma::CTree * Puma::%::init_declarator()") : around () { 
 
177
    if (match_expr && thisJoinPoint->that ()->parse (Puma::TOK_ANY_INIT_DECLARATOR)) {
 
178
      thisJoinPoint->that ()->parse (&JoinPoint::That::wc_extension); 
 
179
      *(Puma::CTree**)thisJoinPoint->result () = 
 
180
        thisJoinPoint->that ()->builder ().any (); 
 
181
    } else 
 
182
      thisJoinPoint->action ().trigger (); 
 
183
  }
 
184
 
 
185
  advice within (derived (csyntax ())) && 
 
186
   execution ("%::Puma::CTree * Puma::%::declarator()") : around () { 
 
187
    if (match_expr && thisJoinPoint->that ()->parse (Puma::TOK_ANY_DECLARATOR)) {
 
188
      thisJoinPoint->that ()->parse (&JoinPoint::That::wc_extension); 
 
189
      *(Puma::CTree**)thisJoinPoint->result () = 
 
190
        thisJoinPoint->that ()->builder ().any (); 
 
191
    } else 
 
192
      thisJoinPoint->action ().trigger (); 
 
193
  }
 
194
 
 
195
  advice within (derived (csyntax ())) && 
 
196
   execution ("%::Puma::CTree * Puma::%::init()") : around () { 
 
197
    if (match_expr && thisJoinPoint->that ()->parse (Puma::TOK_ANY_INIT)) {
 
198
      thisJoinPoint->that ()->parse (&JoinPoint::That::wc_extension); 
 
199
      *(Puma::CTree**)thisJoinPoint->result () = 
 
200
        thisJoinPoint->that ()->builder ().any (); 
 
201
    } else 
 
202
      thisJoinPoint->action ().trigger (); 
 
203
  }
 
204
 
 
205
  advice within (derived (csyntax ())) && 
 
206
   execution ("%::Puma::CTree * Puma::%::arg_decl_seq()") : around () { 
 
207
    if (match_expr && thisJoinPoint->that ()->parse (Puma::TOK_ANY_ARG_DECL_SEQ)) {
 
208
      thisJoinPoint->that ()->parse (&JoinPoint::That::wc_extension); 
 
209
      *(Puma::CTree**)thisJoinPoint->result () = 
 
210
        thisJoinPoint->that ()->builder ().any_list (); 
 
211
    } else 
 
212
      thisJoinPoint->action ().trigger (); 
 
213
  }
 
214
 
 
215
  advice within (derived (csyntax ())) && 
 
216
   execution ("%::Puma::CTree * Puma::%::fct_body()") : around () { 
 
217
    if (match_expr && thisJoinPoint->that ()->parse (Puma::TOK_ANY_FCT_BODY)) {
 
218
      thisJoinPoint->that ()->parse (&JoinPoint::That::wc_extension); 
 
219
      *(Puma::CTree**)thisJoinPoint->result () = 
 
220
        thisJoinPoint->that ()->builder ().any (); 
 
221
    } else 
 
222
      thisJoinPoint->action ().trigger (); 
 
223
  }
 
224
 
 
225
  advice within (derived (csyntax ())) && 
 
226
   execution ("%::Puma::CTree * Puma::%::class_spec()") : around () { 
 
227
    if (match_expr && thisJoinPoint->that ()->parse (Puma::TOK_ANY_CLASS_SPEC)) {
 
228
      thisJoinPoint->that ()->parse (&JoinPoint::That::wc_extension); 
 
229
      *(Puma::CTree**)thisJoinPoint->result () = 
 
230
        thisJoinPoint->that ()->builder ().any (); 
 
231
    } else 
 
232
      thisJoinPoint->action ().trigger (); 
 
233
  }
 
234
 
 
235
  advice within (derived (csyntax ())) && 
 
236
   execution ("%::Puma::CTree * Puma::%::member_spec()") : around () { 
 
237
    if (match_expr && thisJoinPoint->that ()->parse (Puma::TOK_ANY_MEMBER_SPEC)) {
 
238
      thisJoinPoint->that ()->parse (&JoinPoint::That::wc_extension); 
 
239
      *(Puma::CTree**)thisJoinPoint->result () = 
 
240
        thisJoinPoint->that ()->builder ().any_list (); 
 
241
    } else 
 
242
      thisJoinPoint->action ().trigger (); 
 
243
  }
 
244
 
 
245
  advice within (derived (csyntax ())) && 
 
246
   execution ("%::Puma::CTree * Puma::%::member_decl()") : around () { 
 
247
    if (match_expr && thisJoinPoint->that ()->parse (Puma::TOK_ANY_MEMBER_DECL)) {
 
248
      thisJoinPoint->that ()->parse (&JoinPoint::That::wc_extension); 
 
249
      *(Puma::CTree**)thisJoinPoint->result () = 
 
250
        thisJoinPoint->that ()->builder ().any (); 
 
251
    } else 
 
252
      thisJoinPoint->action ().trigger (); 
 
253
  }
 
254
 
 
255
  advice within (derived (csyntax ())) && 
 
256
   execution ("%::Puma::CTree * Puma::%::stmt()") : around () { 
 
257
    if (match_expr && thisJoinPoint->that ()->parse (Puma::TOK_ANY_STMT)) {
 
258
      thisJoinPoint->that ()->parse (&JoinPoint::That::wc_extension); 
 
259
      *(Puma::CTree**)thisJoinPoint->result () = 
 
260
        thisJoinPoint->that ()->builder ().any (); 
 
261
    } else 
 
262
      thisJoinPoint->action ().trigger (); 
 
263
  }
 
264
 
 
265
  advice within (derived (csyntax ())) && 
 
266
   execution ("%::Puma::CTree * Puma::%::stmt_seq()") : around () { 
 
267
    if (match_expr && thisJoinPoint->that ()->parse (Puma::TOK_ANY_STMT_SEQ)) {
 
268
      thisJoinPoint->that ()->parse (&JoinPoint::That::wc_extension); 
 
269
      *(Puma::CTree**)thisJoinPoint->result () = 
 
270
        thisJoinPoint->that ()->builder ().any_list (); 
 
271
    } else 
 
272
      thisJoinPoint->action ().trigger (); 
 
273
  }
 
274
 
 
275
  advice within (derived (ccsyntax ())) && 
 
276
   execution ("%::Puma::CTree * Puma::%::base_clause()") : around () { 
 
277
    if (match_expr && thisJoinPoint->that ()->parse (Puma::TOK_ANY_BASE_CLAUSE)) {
 
278
      thisJoinPoint->that ()->parse (&JoinPoint::That::wc_extension); 
 
279
      *(Puma::CTree**)thisJoinPoint->result () = 
 
280
        thisJoinPoint->that ()->builder ().any_list (); 
 
281
    } else 
 
282
      thisJoinPoint->action ().trigger (); 
 
283
  }
 
284
 
 
285
  advice within (derived (ccsyntax ())) && 
 
286
   execution ("%::Puma::CTree * Puma::%::ctor_init()") : around () { 
 
287
    if (match_expr && thisJoinPoint->that ()->parse (Puma::TOK_ANY_CTOR_INIT)) {
 
288
      thisJoinPoint->that ()->parse (&JoinPoint::That::wc_extension); 
 
289
      *(Puma::CTree**)thisJoinPoint->result () = 
 
290
        thisJoinPoint->that ()->builder ().any (); 
 
291
    } else 
 
292
      thisJoinPoint->action ().trigger (); 
 
293
  }
 
294
 
 
295
  advice within (derived (ccsyntax ())) && 
 
296
   execution ("%::Puma::CTree * Puma::%::mem_init()") : around () { 
 
297
    if (match_expr && thisJoinPoint->that ()->parse (Puma::TOK_ANY_MEM_INIT)) {
 
298
      thisJoinPoint->that ()->parse (&JoinPoint::That::wc_extension); 
 
299
      *(Puma::CTree**)thisJoinPoint->result () = 
300
300
        thisJoinPoint->that ()->builder ().any (); 
301
301
    } else 
302
302
      thisJoinPoint->action ().trigger (); 
305
305
  // extend the syntax to be able to parse match trees
306
306
 
307
307
  advice within (derived (csyntax ())) && 
308
 
   execution ("%::CTree * Puma::%::typedef_name()") : around () { 
309
 
    if (match_expr && thisJoinPoint->that ()->parse (TOK_IS_TYPEDEF)) {
310
 
      *(CTree**)thisJoinPoint->result () = 
311
 
        thisJoinPoint->that ()->parse (TOK_ID) ? 
312
 
        thisJoinPoint->that ()->builder ().is_name () : (CTree*)0; 
313
 
    } else 
314
 
      thisJoinPoint->action ().trigger (); 
315
 
  }
316
 
 
317
 
  advice within (derived (ccsyntax ())) && 
318
 
   execution ("%::CTree * Puma::%::class_name()") : around () { 
319
 
    if (match_expr && thisJoinPoint->that ()->parse (TOK_IS_CLASS)) {
320
 
      *(CTree**)thisJoinPoint->result () = 
321
 
        thisJoinPoint->that ()->parse (TOK_ID) ? 
322
 
        thisJoinPoint->that ()->builder ().is_name () : (CTree*)0; 
323
 
    } else 
324
 
      thisJoinPoint->action ().trigger (); 
325
 
  }
326
 
 
327
 
  advice within (derived (ccsyntax ())) && 
328
 
   execution ("%::CTree * Puma::%::enum_name()") : around () { 
329
 
    if (match_expr && thisJoinPoint->that ()->parse (TOK_IS_ENUM)) {
330
 
      *(CTree**)thisJoinPoint->result () = 
331
 
        thisJoinPoint->that ()->parse (TOK_ID) ? 
332
 
        thisJoinPoint->that ()->builder ().is_name () : (CTree*)0; 
 
308
   execution ("%::Puma::CTree * Puma::%::typedef_name()") : around () { 
 
309
    if (match_expr && thisJoinPoint->that ()->parse (Puma::TOK_IS_TYPEDEF)) {
 
310
      *(Puma::CTree**)thisJoinPoint->result () = 
 
311
        thisJoinPoint->that ()->parse (Puma::TOK_ID) ? 
 
312
        thisJoinPoint->that ()->builder ().is_name () : (Puma::CTree*)0; 
 
313
    } else 
 
314
      thisJoinPoint->action ().trigger (); 
 
315
  }
 
316
 
 
317
  advice within (derived (ccsyntax ())) && 
 
318
   execution ("%::Puma::CTree * Puma::%::class_name()") : around () { 
 
319
    if (match_expr && thisJoinPoint->that ()->parse (Puma::TOK_IS_CLASS)) {
 
320
      *(Puma::CTree**)thisJoinPoint->result () = 
 
321
        thisJoinPoint->that ()->parse (Puma::TOK_ID) ? 
 
322
        thisJoinPoint->that ()->builder ().is_name () : (Puma::CTree*)0; 
 
323
    } else 
 
324
      thisJoinPoint->action ().trigger (); 
 
325
  }
 
326
 
 
327
  advice within (derived (ccsyntax ())) && 
 
328
   execution ("%::Puma::CTree * Puma::%::enum_name()") : around () { 
 
329
    if (match_expr && thisJoinPoint->that ()->parse (Puma::TOK_IS_ENUM)) {
 
330
      *(Puma::CTree**)thisJoinPoint->result () = 
 
331
        thisJoinPoint->that ()->parse (Puma::TOK_ID) ? 
 
332
        thisJoinPoint->that ()->builder ().is_name () : (Puma::CTree*)0; 
333
333
    } else 
334
334
      thisJoinPoint->action ().trigger (); 
335
335
  }
337
337
  // configure parsing match expressions
338
338
  
339
339
  advice args (config) && within (derived ("Puma::Syntax")) && 
340
 
   execution ("void Puma::%::configure(...)") : before (Config &config) {
 
340
   execution ("void Puma::%::configure(...)") : before (Puma::Config &config) {
341
341
    match_expr = (config.Option ("--match-expr"));
342
342
  }
343
343
};
345
345
// introduce wildcard rules to CSyntax
346
346
slice class Puma::CMatchCSyntax {
347
347
public:
348
 
  virtual CTree *wildcards ();
349
 
  virtual CTree *wc_extension ();
350
 
  virtual CTree *wc_arguments ();
351
 
  virtual CTree *wc_condition ();
352
 
  virtual CTree *wc_condition1 ();
353
 
  virtual CTree *wc_match ();
354
 
  virtual CTree *wc_match_list ();
355
 
  virtual CTree *wc_element ();
 
348
  virtual Puma::CTree *wildcards ();
 
349
  virtual Puma::CTree *wc_extension ();
 
350
  virtual Puma::CTree *wc_arguments ();
 
351
  virtual Puma::CTree *wc_condition ();
 
352
  virtual Puma::CTree *wc_condition1 ();
 
353
  virtual Puma::CTree *wc_match ();
 
354
  virtual Puma::CTree *wc_match_list ();
 
355
  virtual Puma::CTree *wc_element ();
356
356
};
357
357
 
358
358
// introduce wildcard rules to CCSyntax
359
359
slice class Puma::CMatchCCSyntax {
360
360
public:
361
 
  virtual CTree *wildcards ();
 
361
  virtual Puma::CTree *wildcards ();
362
362
};
363
363
 
364
364
// extend CBuilder
365
365
slice class Puma::CMatchCBuilder {
366
366
public:
367
 
  virtual CTree *any ();
368
 
  virtual CTree *any_list ();
369
 
  virtual CTree *is_name ();
370
 
  virtual CTree *wildcards ();
371
 
  virtual CTree *wc_extension ();
372
 
  virtual CTree *wc_arguments ();
373
 
  virtual CTree *wc_condition ();
374
 
  virtual CTree *wc_condition1 ();
375
 
  virtual CTree *wc_match ();
376
 
  virtual CTree *wc_match_list ();
377
 
  virtual CTree *wc_element ();
 
367
  virtual Puma::CTree *any ();
 
368
  virtual Puma::CTree *any_list ();
 
369
  virtual Puma::CTree *is_name ();
 
370
  virtual Puma::CTree *wildcards ();
 
371
  virtual Puma::CTree *wc_extension ();
 
372
  virtual Puma::CTree *wc_arguments ();
 
373
  virtual Puma::CTree *wc_condition ();
 
374
  virtual Puma::CTree *wc_condition1 ();
 
375
  virtual Puma::CTree *wc_match ();
 
376
  virtual Puma::CTree *wc_match_list ();
 
377
  virtual Puma::CTree *wc_element ();
378
378
};
379
379
 
380
 
slice CTree *Puma::CMatchCSyntax::wildcards () {
381
 
  return (parse (TOK_DO_EXPR) ? parse (&CSyntax::expr) :
382
 
          parse (TOK_DO_EXPR_LIST) ? parse (&CSyntax::expr_list) : 
383
 
          look_ahead (TOK_DO_ID_EXPR) ? consume () && id_expr () : 
384
 
          look_ahead (TOK_DO_IDENTIFIER) ? consume () && identifier () : 
385
 
          look_ahead (TOK_DO_DECL_SPEC) ? consume () && decl_spec () : 
386
 
          parse (TOK_DO_DECL_SPEC_SEQ) ? parse (&CSyntax::decl_spec_seq) : 
387
 
          parse (TOK_DO_INIT_DECLARATOR_LIST) ? parse (&CSyntax::init_declarator_list) : 
388
 
          parse (TOK_DO_INIT_DECLARATOR) ? parse (&CSyntax::init_declarator) : 
389
 
          parse (TOK_DO_DECLARATOR) ? parse (&CSyntax::declarator) : 
390
 
          parse (TOK_DO_INIT) ? parse (&CSyntax::init) : 
391
 
          parse (TOK_DO_ARG_DECL_SEQ) ? parse (&CSyntax::arg_decl_seq) : 
392
 
          parse (TOK_DO_FCT_BODY) ? parse (&CSyntax::fct_body) : 
393
 
          look_ahead (TOK_DO_CLASS_SPEC) ? consume () && class_spec () : 
394
 
          parse (TOK_DO_MEMBER_SPEC) ? parse (&CSyntax::member_spec) : 
395
 
          parse (TOK_DO_MEMBER_DECL) ? parse (&CSyntax::member_decl) : 
396
 
          parse (TOK_DO_STMT) ? parse (&CSyntax::stmt) : 
397
 
          parse (TOK_DO_STMT_SEQ) ? parse (&CSyntax::stmt_seq) : 
 
380
slice Puma::CTree *Puma::CMatchCSyntax::wildcards () {
 
381
  return (parse (Puma::TOK_DO_EXPR) ? parse (&Puma::CSyntax::expr) :
 
382
          parse (Puma::TOK_DO_EXPR_LIST) ? parse (&Puma::CSyntax::expr_list) : 
 
383
          look_ahead (Puma::TOK_DO_ID_EXPR) ? consume () && id_expr () : 
 
384
          look_ahead (Puma::TOK_DO_IDENTIFIER) ? consume () && identifier () : 
 
385
          look_ahead (Puma::TOK_DO_DECL_SPEC) ? consume () && decl_spec () : 
 
386
          parse (Puma::TOK_DO_DECL_SPEC_SEQ) ? parse (&Puma::CSyntax::decl_spec_seq) : 
 
387
          parse (Puma::TOK_DO_INIT_DECLARATOR_LIST) ? parse (&Puma::CSyntax::init_declarator_list) : 
 
388
          parse (Puma::TOK_DO_INIT_DECLARATOR) ? parse (&Puma::CSyntax::init_declarator) : 
 
389
          parse (Puma::TOK_DO_DECLARATOR) ? parse (&Puma::CSyntax::declarator) : 
 
390
          parse (Puma::TOK_DO_INIT) ? parse (&Puma::CSyntax::init) : 
 
391
          parse (Puma::TOK_DO_ARG_DECL_SEQ) ? parse (&Puma::CSyntax::arg_decl_seq) : 
 
392
          parse (Puma::TOK_DO_FCT_BODY) ? parse (&Puma::CSyntax::fct_body) : 
 
393
          look_ahead (Puma::TOK_DO_CLASS_SPEC) ? consume () && class_spec () : 
 
394
          parse (Puma::TOK_DO_MEMBER_SPEC) ? parse (&Puma::CSyntax::member_spec) : 
 
395
          parse (Puma::TOK_DO_MEMBER_DECL) ? parse (&Puma::CSyntax::member_decl) : 
 
396
          parse (Puma::TOK_DO_STMT) ? parse (&Puma::CSyntax::stmt) : 
 
397
          parse (Puma::TOK_DO_STMT_SEQ) ? parse (&Puma::CSyntax::stmt_seq) : 
398
398
          false) ?
399
 
    builder ().wildcards () : (CTree*)0;
 
399
    builder ().wildcards () : (Puma::CTree*)0;
400
400
}
401
401
         
402
 
slice CTree *Puma::CMatchCCSyntax::wildcards () {
 
402
slice Puma::CTree *Puma::CMatchCCSyntax::wildcards () {
403
403
  bool DO_parsed = false;
404
 
  if (parse (TOK_DO_BASE_CLAUSE) && (DO_parsed=true) ? 
 
404
  if (parse (Puma::TOK_DO_BASE_CLAUSE) && (DO_parsed=true) ? 
405
405
        parse (&CCSyntax::base_clause) : 
406
 
      parse (TOK_DO_CTOR_INIT) && (DO_parsed=true) ? 
 
406
      parse (Puma::TOK_DO_CTOR_INIT) && (DO_parsed=true) ? 
407
407
        parse (&CCSyntax::ctor_init) : 
408
 
      parse (TOK_DO_MEM_INIT) && (DO_parsed=true) ? 
 
408
      parse (Puma::TOK_DO_MEM_INIT) && (DO_parsed=true) ? 
409
409
        parse (&CCSyntax::mem_init) : 
410
410
      false)
411
411
    return builder ().wildcards ();
412
412
  return ! DO_parsed ? 
413
 
    CSyntax::wildcards () : (CTree*)0;
 
413
    Puma::CSyntax::wildcards () : (Puma::CTree*)0;
414
414
}
415
415
 
416
 
slice CTree *Puma::CMatchCBuilder::wildcards () {
 
416
slice Puma::CTree *Puma::CMatchCBuilder::wildcards () {
417
417
  // ignore DO token und return parsed tree
418
418
  delete get_node (0);
419
419
  return get_node (1);
420
420
}
421
421
 
422
 
slice CTree *Puma::CMatchCBuilder::any () {
423
 
  if (nodes () == 1)
424
 
    return new CT_Any (get_node (0));
425
 
  return new CT_Any (get_node (0), get_node (1));
426
 
}
427
 
 
428
 
slice CTree *Puma::CMatchCBuilder::any_list () {
429
 
  if (nodes () == 1)
430
 
    return new CT_AnyList (get_node (0));
431
 
  return new CT_AnyList (get_node (0), get_node (1));
432
 
}
433
 
 
434
 
slice CTree *Puma::CMatchCBuilder::is_name () {
 
422
slice Puma::CTree *Puma::CMatchCBuilder::any () {
 
423
  if (nodes () == 1)
 
424
    return new Puma::CT_Any (get_node (0));
 
425
  return new Puma::CT_Any (get_node (0), get_node (1));
 
426
}
 
427
 
 
428
slice Puma::CTree *Puma::CMatchCBuilder::any_list () {
 
429
  if (nodes () == 1)
 
430
    return new Puma::CT_AnyList (get_node (0));
 
431
  return new Puma::CT_AnyList (get_node (0), get_node (1));
 
432
}
 
433
 
 
434
slice Puma::CTree *Puma::CMatchCBuilder::is_name () {
435
435
  delete get_node (0);
436
 
  return new CT_SimpleName (get_node (1));
 
436
  return new Puma::CT_SimpleName (get_node (1));
437
437
}
438
438
 
439
439
/*****************************************************************************/
442
442
/*                                                                           */
443
443
/*****************************************************************************/
444
444
 
445
 
slice CTree *Puma::CMatchCSyntax::wc_extension () {
446
 
  return (parse (TOK_OPEN_ROUND) && 
447
 
          (parse (&CSyntax::wc_arguments), parse (TOK_CLOSE_ROUND))) ?
448
 
    semantic ().wc_extension () : (CTree*)0;
 
445
slice Puma::CTree *Puma::CMatchCSyntax::wc_extension () {
 
446
  return (parse (Puma::TOK_OPEN_ROUND) && 
 
447
          (parse (&Puma::CSyntax::wc_arguments), parse (Puma::TOK_CLOSE_ROUND))) ?
 
448
    semantic ().wc_extension () : (Puma::CTree*)0;
449
449
}
450
450
 
451
 
slice CTree *Puma::CMatchCBuilder::wc_extension () {
 
451
slice Puma::CTree *Puma::CMatchCBuilder::wc_extension () {
452
452
  if (nodes () == 2)
453
 
    return new CT_AnyExtension (get_node (0), 0, 0, 0, get_node (1));
 
453
    return new Puma::CT_AnyExtension (get_node (0), 0, 0, 0, get_node (1));
454
454
  else {
455
 
    CTree *result;
 
455
    Puma::CTree *result;
456
456
    Container *c = (Container*)get_node (1);
457
457
    if (c->Sons () == 1) {
458
 
      if (c->Son (0)->token ()->type () == TOK_STRING_VAL)
459
 
        result = new CT_AnyExtension (get_node (0), c->Son (0), 0, 0, 
 
458
      if (c->Son (0)->token ()->type () == Puma::TOK_STRING_VAL)
 
459
        result = new Puma::CT_AnyExtension (get_node (0), c->Son (0), 0, 0, 
460
460
                                      get_node (2));
461
461
      else 
462
 
        result = new CT_AnyExtension (get_node (0), 0, 0, c->Son (0), 
 
462
        result = new Puma::CT_AnyExtension (get_node (0), 0, 0, c->Son (0), 
463
463
                                      get_node (2));
464
464
    } else
465
 
      result = new CT_AnyExtension (get_node (0), c->Son (0), c->Son (1), 
 
465
      result = new Puma::CT_AnyExtension (get_node (0), c->Son (0), c->Son (1), 
466
466
                                    c->Son (2), get_node (2));
467
467
    delete c;
468
468
    return result;
469
469
  }
470
470
}
471
471
 
472
 
slice CTree *Puma::CMatchCSyntax::wc_arguments () {
473
 
  return (parse (TOK_STRING_VAL) ?
474
 
           (parse (TOK_COMMA) ? parse (&CSyntax::wc_condition) : true) :
475
 
          parse (&CSyntax::wc_condition)) ?
476
 
    builder ().wc_arguments () : (CTree*)0;
 
472
slice Puma::CTree *Puma::CMatchCSyntax::wc_arguments () {
 
473
  return (parse (Puma::TOK_STRING_VAL) ?
 
474
           (parse (Puma::TOK_COMMA) ? parse (&Puma::CSyntax::wc_condition) : true) :
 
475
          parse (&Puma::CSyntax::wc_condition)) ?
 
476
    builder ().wc_arguments () : (Puma::CTree*)0;
477
477
}
478
478
 
479
 
slice CTree *Puma::CMatchCBuilder::wc_arguments () {
 
479
slice Puma::CTree *Puma::CMatchCBuilder::wc_arguments () {
480
480
  return container ();
481
481
}
482
482
 
483
 
slice CTree *Puma::CMatchCSyntax::wc_condition () {
484
 
  static int ops[] = { TOK_WC_SEQ, TOK_WC_OR, TOK_WC_XOR, TOK_WC_AND, 0 };
485
 
  return list (&CSyntax::wc_condition1, ops) ? 
486
 
    builder ().wc_condition () : (CTree*)0;
 
483
slice Puma::CTree *Puma::CMatchCSyntax::wc_condition () {
 
484
  static int ops[] = { Puma::TOK_WC_SEQ, Puma::TOK_WC_OR, Puma::TOK_WC_XOR, Puma::TOK_WC_AND, 0 };
 
485
  return list (&Puma::CSyntax::wc_condition1, ops) ? 
 
486
    builder ().wc_condition () : (Puma::CTree*)0;
487
487
}
488
488
 
489
 
slice CTree *Puma::CMatchCBuilder::wc_condition () {
490
 
  CTree *result = get_node (0);
 
489
slice Puma::CTree *Puma::CMatchCBuilder::wc_condition () {
 
490
  Puma::CTree *result = get_node (0);
491
491
  for (int n = 1; n < nodes (); n += 2)
492
 
    result = new CT_AnyCondition (result, get_node (n), get_node (n + 1));
 
492
    result = new Puma::CT_AnyCondition (result, get_node (n), get_node (n + 1));
493
493
  return result;
494
494
}
495
495
 
496
 
slice CTree *Puma::CMatchCSyntax::wc_condition1 () {
497
 
  return (parse (TOK_WC_NOT) || parse (TOK_WC_COLLECT) ? 
498
 
           parse (&CSyntax::wc_condition) :
499
 
          parse (TOK_WC_IF) ? 
500
 
           parse (&CSyntax::wc_condition) && 
501
 
           (parse (TOK_WC_ELIF) ? 
502
 
            parse (&CSyntax::wc_condition) : true) &&
503
 
           parse (TOK_WC_ENDIF) :
504
 
          parse (TOK_WC_NODENAME) ?
505
 
           parse (TOK_STRING_VAL) :
506
 
          parse (TOK_OPEN_ROUND) ?
507
 
           parse (&CSyntax::wc_condition) && parse (TOK_CLOSE_ROUND) :
508
 
          parse (&CSyntax::wc_match)) ?
509
 
    builder ().wc_condition1 () : (CTree*)0;
 
496
slice Puma::CTree *Puma::CMatchCSyntax::wc_condition1 () {
 
497
  return (parse (Puma::TOK_WC_NOT) || parse (Puma::TOK_WC_COLLECT) ? 
 
498
           parse (&Puma::CSyntax::wc_condition) :
 
499
          parse (Puma::TOK_WC_IF) ? 
 
500
           parse (&Puma::CSyntax::wc_condition) && 
 
501
           (parse (Puma::TOK_WC_ELIF) ? 
 
502
            parse (&Puma::CSyntax::wc_condition) : true) &&
 
503
           parse (Puma::TOK_WC_ENDIF) :
 
504
          parse (Puma::TOK_WC_NODENAME) ?
 
505
           parse (Puma::TOK_STRING_VAL) :
 
506
          parse (Puma::TOK_OPEN_ROUND) ?
 
507
           parse (&Puma::CSyntax::wc_condition) && parse (Puma::TOK_CLOSE_ROUND) :
 
508
          parse (&Puma::CSyntax::wc_match)) ?
 
509
    builder ().wc_condition1 () : (Puma::CTree*)0;
510
510
}
511
511
            
512
 
slice CTree *Puma::CMatchCBuilder::wc_condition1 () {
 
512
slice Puma::CTree *Puma::CMatchCBuilder::wc_condition1 () {
513
513
  if (nodes () == 1)
514
514
    return get_node ();
515
515
  if (nodes () == 2)
516
 
    return new CT_AnyCondition (get_node (0), get_node (1));
517
 
  if (get_node ()->token ()->type () == TOK_OPEN_ROUND)
518
 
    return new CT_AnyCondition (get_node (0), get_node (1), get_node (2));
 
516
    return new Puma::CT_AnyCondition (get_node (0), get_node (1));
 
517
  if (get_node ()->token ()->type () == Puma::TOK_OPEN_ROUND)
 
518
    return new Puma::CT_AnyCondition (get_node (0), get_node (1), get_node (2));
519
519
  if (nodes () == 3)
520
 
    return new CT_AnyCondition (get_node (0), get_node (1), get_node (2));
521
 
  return new CT_AnyCondition (get_node (0), get_node (1), 
522
 
    new CT_AnyCondition (get_node (2), get_node (3), get_node (4)));
 
520
    return new Puma::CT_AnyCondition (get_node (0), get_node (1), get_node (2));
 
521
  return new Puma::CT_AnyCondition (get_node (0), get_node (1), 
 
522
    new Puma::CT_AnyCondition (get_node (2), get_node (3), get_node (4)));
523
523
}
524
524
 
525
 
slice CTree *Puma::CMatchCSyntax::wc_match () {
526
 
  static int match_mode[] = { TOK_WC_EXACT, TOK_WC_FIRST, TOK_WC_LAST, 
527
 
                              TOK_WC_LEAF, TOK_WC_PRUNE, 0 };
528
 
  return (parse (&CSyntax::wc_match_list),
 
525
slice Puma::CTree *Puma::CMatchCSyntax::wc_match () {
 
526
  static int match_mode[] = { Puma::TOK_WC_EXACT, Puma::TOK_WC_FIRST, Puma::TOK_WC_LAST, 
 
527
                              Puma::TOK_WC_LEAF, Puma::TOK_WC_PRUNE, 0 };
 
528
  return (parse (&Puma::CSyntax::wc_match_list),
529
529
          parse (match_mode),
530
 
          parse (&CSyntax::wildcards)) ?
531
 
    builder ().wc_match () : (CTree*)0;
 
530
          parse (&Puma::CSyntax::wildcards)) ?
 
531
    builder ().wc_match () : (Puma::CTree*)0;
532
532
}
533
533
 
534
 
slice CTree *Puma::CMatchCBuilder::wc_match () {
 
534
slice Puma::CTree *Puma::CMatchCBuilder::wc_match () {
535
535
  if (nodes () == 1)
536
 
    return new CT_AnyCondition (get_node (0));
 
536
    return new Puma::CT_AnyCondition (get_node (0));
537
537
  if (nodes () == 2)
538
 
    return new CT_AnyCondition (get_node (0), get_node (1));    
539
 
  return new CT_AnyCondition (get_node (0), get_node (1), get_node (2));
540
 
}
541
 
 
542
 
slice CTree *Puma::CMatchCSyntax::wc_match_list () {
543
 
  return (parse (TOK_WC_ELEMENT) &&
544
 
          (parse (TOK_OPEN_ROUND) ? 
545
 
           (parse (&CSyntax::wc_element) ? 
546
 
            (parse (TOK_COMMA) ? 
547
 
             parse (&CSyntax::wc_element) : true) : true) &&
548
 
           parse (TOK_CLOSE_ROUND) : true)) ?
549
 
    builder ().wc_match_list () : (CTree*)0;
550
 
}
551
 
 
552
 
slice CTree *Puma::CMatchCBuilder::wc_match_list () {
 
538
    return new Puma::CT_AnyCondition (get_node (0), get_node (1));    
 
539
  return new Puma::CT_AnyCondition (get_node (0), get_node (1), get_node (2));
 
540
}
 
541
 
 
542
slice Puma::CTree *Puma::CMatchCSyntax::wc_match_list () {
 
543
  return (parse (Puma::TOK_WC_ELEMENT) &&
 
544
          (parse (Puma::TOK_OPEN_ROUND) ? 
 
545
           (parse (&Puma::CSyntax::wc_element) ? 
 
546
            (parse (Puma::TOK_COMMA) ? 
 
547
             parse (&Puma::CSyntax::wc_element) : true) : true) &&
 
548
           parse (Puma::TOK_CLOSE_ROUND) : true)) ?
 
549
    builder ().wc_match_list () : (Puma::CTree*)0;
 
550
}
 
551
 
 
552
slice Puma::CTree *Puma::CMatchCBuilder::wc_match_list () {
553
553
  if (nodes () == 1)
554
 
    return new CT_AnyCondition (get_node (0));
 
554
    return new Puma::CT_AnyCondition (get_node (0));
555
555
  delete get_node (1);
556
556
  delete get_node (nodes () - 1);
557
557
  if (nodes () == 3) 
558
 
    return new CT_AnyCondition (get_node (0));
 
558
    return new Puma::CT_AnyCondition (get_node (0));
559
559
  if (nodes () == 4) 
560
 
    return new CT_AnyCondition (get_node (0), get_node (2));
 
560
    return new Puma::CT_AnyCondition (get_node (0), get_node (2));
561
561
  delete get_node (3);
562
 
  return new CT_AnyCondition (get_node (0), get_node (2), get_node (4));
563
 
}
564
 
 
565
 
slice CTree *Puma::CMatchCSyntax::wc_element () {
566
 
  static int sign[] = { TOK_PLUS, TOK_MINUS, 0 };
567
 
  return (parse (sign), parse (TOK_INT)) ?
568
 
    builder ().wc_element () : (CTree*)0;
569
 
}
570
 
 
571
 
slice CTree *Puma::CMatchCBuilder::wc_element () {
 
562
  return new Puma::CT_AnyCondition (get_node (0), get_node (2), get_node (4));
 
563
}
 
564
 
 
565
slice Puma::CTree *Puma::CMatchCSyntax::wc_element () {
 
566
  static int sign[] = { Puma::TOK_PLUS, Puma::TOK_MINUS, 0 };
 
567
  return (parse (sign), parse (Puma::TOK_INT)) ?
 
568
    builder ().wc_element () : (Puma::CTree*)0;
 
569
}
 
570
 
 
571
slice Puma::CTree *Puma::CMatchCBuilder::wc_element () {
572
572
  if (nodes () == 1)
573
 
    return new CT_AnyCondition (get_node (0));
574
 
  return new CT_AnyCondition (get_node (0), get_node (1));
 
573
    return new Puma::CT_AnyCondition (get_node (0));
 
574
  return new Puma::CT_AnyCondition (get_node (0), get_node (1));
575
575
}
576
576
 
577
577
#endif /* __CMatchSyntax_ah__ */