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);
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 ();
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 ();
162
thisJoinPoint->action ().trigger ();
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 ();
172
thisJoinPoint->action ().trigger ();
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 ();
182
thisJoinPoint->action ().trigger ();
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 ();
192
thisJoinPoint->action ().trigger ();
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 ();
202
thisJoinPoint->action ().trigger ();
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 ();
212
thisJoinPoint->action ().trigger ();
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 ();
222
thisJoinPoint->action ().trigger ();
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 ();
232
thisJoinPoint->action ().trigger ();
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 ();
242
thisJoinPoint->action ().trigger ();
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 ();
252
thisJoinPoint->action ().trigger ();
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 ();
262
thisJoinPoint->action ().trigger ();
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 ();
272
thisJoinPoint->action ().trigger ();
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 ();
282
thisJoinPoint->action ().trigger ();
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 ();
292
thisJoinPoint->action ().trigger ();
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 ();
162
thisJoinPoint->action ().trigger ();
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 ();
172
thisJoinPoint->action ().trigger ();
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 ();
182
thisJoinPoint->action ().trigger ();
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 ();
192
thisJoinPoint->action ().trigger ();
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 ();
202
thisJoinPoint->action ().trigger ();
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 ();
212
thisJoinPoint->action ().trigger ();
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 ();
222
thisJoinPoint->action ().trigger ();
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 ();
232
thisJoinPoint->action ().trigger ();
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 ();
242
thisJoinPoint->action ().trigger ();
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 ();
252
thisJoinPoint->action ().trigger ();
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 ();
262
thisJoinPoint->action ().trigger ();
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 ();
272
thisJoinPoint->action ().trigger ();
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 ();
282
thisJoinPoint->action ().trigger ();
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 ();
292
thisJoinPoint->action ().trigger ();
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 ();
302
302
thisJoinPoint->action ().trigger ();
345
345
// introduce wildcard rules to CSyntax
346
346
slice class Puma::CMatchCSyntax {
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 ();
358
358
// introduce wildcard rules to CCSyntax
359
359
slice class Puma::CMatchCCSyntax {
361
virtual CTree *wildcards ();
361
virtual Puma::CTree *wildcards ();
364
364
// extend CBuilder
365
365
slice class Puma::CMatchCBuilder {
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 ();
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) :
399
builder ().wildcards () : (CTree*)0;
399
builder ().wildcards () : (Puma::CTree*)0;
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) :
411
411
return builder ().wildcards ();
412
412
return ! DO_parsed ?
413
CSyntax::wildcards () : (CTree*)0;
413
Puma::CSyntax::wildcards () : (Puma::CTree*)0;
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);
422
slice CTree *Puma::CMatchCBuilder::any () {
424
return new CT_Any (get_node (0));
425
return new CT_Any (get_node (0), get_node (1));
428
slice CTree *Puma::CMatchCBuilder::any_list () {
430
return new CT_AnyList (get_node (0));
431
return new CT_AnyList (get_node (0), get_node (1));
434
slice CTree *Puma::CMatchCBuilder::is_name () {
422
slice Puma::CTree *Puma::CMatchCBuilder::any () {
424
return new Puma::CT_Any (get_node (0));
425
return new Puma::CT_Any (get_node (0), get_node (1));
428
slice Puma::CTree *Puma::CMatchCBuilder::any_list () {
430
return new Puma::CT_AnyList (get_node (0));
431
return new Puma::CT_AnyList (get_node (0), get_node (1));
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));
439
439
/*****************************************************************************/
443
443
/*****************************************************************************/
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;
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));
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,
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),
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));
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;
479
slice CTree *Puma::CMatchCBuilder::wc_arguments () {
479
slice Puma::CTree *Puma::CMatchCBuilder::wc_arguments () {
480
480
return container ();
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;
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));
496
slice CTree *Puma::CMatchCSyntax::wc_condition1 () {
497
return (parse (TOK_WC_NOT) || parse (TOK_WC_COLLECT) ?
498
parse (&CSyntax::wc_condition) :
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;
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)));
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;
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));
542
slice CTree *Puma::CMatchCSyntax::wc_match_list () {
543
return (parse (TOK_WC_ELEMENT) &&
544
(parse (TOK_OPEN_ROUND) ?
545
(parse (&CSyntax::wc_element) ?
547
parse (&CSyntax::wc_element) : true) : true) &&
548
parse (TOK_CLOSE_ROUND) : true)) ?
549
builder ().wc_match_list () : (CTree*)0;
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));
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;
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));
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;
571
slice CTree *Puma::CMatchCBuilder::wc_element () {
562
return new Puma::CT_AnyCondition (get_node (0), get_node (2), get_node (4));
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;
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));
577
577
#endif /* __CMatchSyntax_ah__ */