~ubuntu-branches/ubuntu/wily/aspectc++/wily

« back to all changes in this revision

Viewing changes to Puma/gen-release/step1/src/CMatchParser.cc

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2005-12-23 10:49:40 UTC
  • Revision ID: james.westby@ubuntu.com-20051223104940-ig4klhoi991zs7km
Tags: upstream-0.99+1.0pre2
ImportĀ upstreamĀ versionĀ 0.99+1.0pre2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Driver template for the LEMON parser generator.
 
2
** Copyright 1991-1995 by D. Richard Hipp.
 
3
**
 
4
** This library is free software; you can redistribute it and/or
 
5
** modify it under the terms of the GNU Library General Public
 
6
** License as published by the Free Software Foundation; either
 
7
** version 2 of the License, or (at your option) any later version.
 
8
** 
 
9
** This library is distributed in the hope that it will be useful,
 
10
** but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
12
** Library General Public License for more details.
 
13
** 
 
14
** You should have received a copy of the GNU Library General Public
 
15
** License along with this library; if not, write to the
 
16
** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
17
** Boston, MA  02111-1307, USA.
 
18
**
 
19
** Modified 1997 to make it suitable for use with makeheaders.
 
20
*/
 
21
/* First off, code is include which follows the "include" declaration
 
22
** in the input file. */
 
23
#include <stdio.h>
 
24
#line 39 "manip/CMatchParser.lem"
 
25
 
 
26
#include "Puma/CTreeMatcher.h"
 
27
#include "Puma/CMatchParser.h"
 
28
#include "Puma/CWildcardTokens.h"
 
29
#include "Puma/CTokens.h"
 
30
#include "Puma/CTree.h"
 
31
#include <stdlib.h>
 
32
 
 
33
using namespace Puma;
 
34
 
 
35
void *CMatchParserAlloc (void *(*mallocProc)(...));
 
36
void CMatchParser       (void *pParser, int tokenID, CTree *token, 
 
37
                           CTreeMatcher::match_state *mstate);
 
38
void CMatchParserFree   (void *pParser, void (*freeProc)(...));
 
39
void CMatchParserTrace  (FILE *TraceFILE, char *zTracePrompt);
 
40
 
 
41
namespace Puma {
 
42
 
 
43
 
 
44
// Traverse the match-condition tree.
 
45
void CTreeMatcher::travConditionTree (CTree *node, void *pParser, 
 
46
                                      match_state *mstate) const {
 
47
  if (! node || ! pParser || ! mstate) return;
 
48
 
 
49
  int id;
 
50
  CTree *son;
 
51
  const char *type;
 
52
  bool element_node = false;
 
53
 
 
54
  for (int i = 0; i < node->Sons () && mstate->value != -1; i++) {
 
55
    son = node->Son (i);
 
56
    if (! son) 
 
57
      continue;
 
58
    type = son->NodeName ();
 
59
    id = MATCHTREE;
 
60
 
 
61
    // Visit the current son.
 
62
    if (type == CT_AnyCondition::NodeId ()) {
 
63
      if (element_node)
 
64
        id = M_ELEMENT_NO;
 
65
      else {
 
66
        travConditionTree (son, pParser, mstate);
 
67
        continue;
 
68
      }
 
69
    } else if (type == CT_Token::NodeId ()) {
 
70
      if (! son->token ()) 
 
71
        continue;
 
72
 
 
73
      if (son->token ()->is_wildcard ()) {
 
74
        switch (son->token ()->type ()) {
 
75
          case TOK_WC_EXACT   : id = M_EXACT;      break;
 
76
          case TOK_WC_FIRST   : id = M_FIRST;      break;
 
77
          case TOK_WC_LAST    : id = M_LAST;       break;
 
78
          case TOK_WC_PRUNE   : id = M_PRUNE;      break;
 
79
          case TOK_WC_LEAF    : id = M_LEAF;       break;
 
80
          case TOK_WC_COLLECT : id = M_COLLECT;    break;
 
81
          case TOK_WC_NODENAME: id = M_NODENAME;   break;
 
82
          case TOK_WC_NOT     : id = M_NOT;        break;
 
83
          case TOK_WC_AND     : id = M_AND;        break;
 
84
          case TOK_WC_XOR     : id = M_XOR;        break;
 
85
          case TOK_WC_OR      : id = M_OR;         break;
 
86
          case TOK_WC_SEQ     : id = M_SEQ;        break;
 
87
          case TOK_WC_ELEMENT : id = M_ELEMENT;
 
88
            element_node = true;
 
89
            break;
 
90
          case TOK_WC_ELIF    : id = M_ELIF;       break;
 
91
          case TOK_WC_ENDIF   : id = M_ENDIF;      break;
 
92
          case TOK_WC_IF      : id = M_IF; 
 
93
            mstate->depth++;
 
94
            mstate->selected[mstate->depth] = 0; 
 
95
            break;
 
96
          default             : id = 0;            break;
 
97
        }
 
98
      } else if (son->token ()->is_core ()) {
 
99
        switch (son->token ()->type ()) {
 
100
          case TOK_OPEN_ROUND : id = M_OPEN_ROUND;  break;
 
101
          case TOK_CLOSE_ROUND: id = M_CLOSE_ROUND; break;
 
102
          default             : id = MATCHTREE;     break;
 
103
        }
 
104
      } else 
 
105
        id = son->token ()->type ();
 
106
    } 
 
107
        
 
108
    // Parse the current node.
 
109
    CMatchParser (pParser, id, son, mstate);
 
110
  }
 
111
}
 
112
 
 
113
// Evaluate the given match-condition.
 
114
bool CTreeMatcher::evalMatchCondition (CTree *tree, CTree *condition,
 
115
                                       CMatch *matchObj, int mode) const {
 
116
  if (! tree || ! condition || ! matchObj) 
 
117
    return false;
 
118
 
 
119
  Array<int> selected; 
 
120
  selected[0] = 0;
 
121
  match_state mstate = {0, tree, matchObj, mode, 0, selected,
 
122
                        (CTreeMatcher*)this};
 
123
 
 
124
  // Generate the Lemon parser.
 
125
  void *pParser = CMatchParserAlloc ((void* (*)(...))malloc);
 
126
  //CMatchParserTrace(stdout, "TRACE: ");
 
127
 
 
128
  // Parse the match-condition tree.
 
129
  travConditionTree (condition, pParser, &mstate);
 
130
 
 
131
  // Finish and then free the parser.
 
132
  CMatchParser (pParser, 0, (CTree*)0, &mstate);
 
133
  CMatchParserFree (pParser, (void (*)(...))::free);
 
134
 
 
135
  return (mstate.value <= 0) ? false : true;
 
136
}
 
137
 
 
138
 
 
139
} // namespace Puma
 
140
 
 
141
#line 142 "/home/inf4/spinczyk/ac-woven-1.0pre2/Puma/gen-release/step1/src/CMatchParser.cc"
 
142
/* Next is all token values, in a form suitable for use by makeheaders.
 
143
** This section will be null unless lemon is run with the -m switch.
 
144
*/
 
145
/* 
 
146
** These constants (all generated automatically by the parser generator)
 
147
** specify the various kinds of tokens (terminals) that the parser
 
148
** understands. 
 
149
**
 
150
** Each symbol here is a terminal symbol in the grammar.
 
151
*/
 
152
/* Make sure the INTERFACE macro is defined.
 
153
*/
 
154
#ifndef INTERFACE
 
155
# define INTERFACE 1
 
156
#endif
 
157
/* The next thing included is series of defines which control
 
158
** various aspects of the generated parser.
 
159
**    YYCODETYPE         is the data type used for storing terminal
 
160
**                       and nonterminal numbers.  "unsigned char" is
 
161
**                       used if there are fewer than 250 terminals
 
162
**                       and nonterminals.  "int" is used otherwise.
 
163
**    YYNOCODE           is a number of type YYCODETYPE which corresponds
 
164
**                       to no legal terminal or nonterminal number.  This
 
165
**                       number is used to fill in empty slots of the hash 
 
166
**                       table.
 
167
**    YYACTIONTYPE       is the data type used for storing terminal
 
168
**                       and nonterminal numbers.  "unsigned char" is
 
169
**                       used if there are fewer than 250 rules and
 
170
**                       states combined.  "int" is used otherwise.
 
171
**    CMatchParserTOKENTYPE     is the data type used for minor tokens given 
 
172
**                       directly to the parser from the tokenizer.
 
173
**    YYMINORTYPE        is the data type used for all minor tokens.
 
174
**                       This is typically a union of many types, one of
 
175
**                       which is CMatchParserTOKENTYPE.  The entry in the union
 
176
**                       for base tokens is called "yy0".
 
177
**    YYSTACKDEPTH       is the maximum depth of the parser's stack.
 
178
**    CMatchParserARGDECL       is a declaration of a 3rd argument to the
 
179
**                       parser, or null if there is no extra argument.
 
180
**    CMatchParserKRARGDECL     A version of CMatchParserARGDECL for K&R C.
 
181
**    CMatchParserANSIARGDECL   A version of CMatchParserARGDECL for ANSI C.
 
182
**    YYNSTATE           the combined number of states.
 
183
**    YYNRULE            the number of rules in the grammar
 
184
**    YYERRORSYMBOL      is the code number of the error symbol.  If not
 
185
**                       defined, then do no error processing.
 
186
*/
 
187
/*  */
 
188
#define YYCODETYPE unsigned char
 
189
#define YYNOCODE 29
 
190
#define YYACTIONTYPE unsigned char
 
191
#define CMatchParserTOKENTYPE CTree *
 
192
typedef union {
 
193
  CMatchParserTOKENTYPE yy0;
 
194
  int yy4;
 
195
  int yy57;
 
196
} YYMINORTYPE;
 
197
#define YYSTACKDEPTH 100
 
198
#define CMatchParserARGDECL ,mstate
 
199
#define CMatchParserXARGDECL CTreeMatcher::match_state *mstate;
 
200
#define CMatchParserANSIARGDECL ,CTreeMatcher::match_state *mstate
 
201
#define YYNSTATE 42
 
202
#define YYNRULE 23
 
203
#define YYERRORSYMBOL 23
 
204
#define YYERRSYMDT yy57
 
205
#define YY_NO_ACTION      (YYNSTATE+YYNRULE+2)
 
206
#define YY_ACCEPT_ACTION  (YYNSTATE+YYNRULE+1)
 
207
#define YY_ERROR_ACTION   (YYNSTATE+YYNRULE)
 
208
/* Next is the action table.  Each entry in this table contains
 
209
**
 
210
**  +  An integer which is the number representing the look-ahead
 
211
**     token
 
212
**
 
213
**  +  An integer indicating what action to take.  Number (N) between
 
214
**     0 and YYNSTATE-1 mean shift the look-ahead and go to state N.
 
215
**     Numbers between YYNSTATE and YYNSTATE+YYNRULE-1 mean reduce by
 
216
**     rule N-YYNSTATE.  Number YYNSTATE+YYNRULE means that a syntax
 
217
**     error has occurred.  Number YYNSTATE+YYNRULE+1 means the parser
 
218
**     accepts its input.
 
219
**
 
220
**  +  A pointer to the next entry with the same hash value.
 
221
**
 
222
** The action table is really a series of hash tables.  Each hash
 
223
** table contains a number of entries which is a power of two.  The
 
224
** "state" table (which follows) contains information about the starting
 
225
** point and size of each hash table.
 
226
*/
 
227
struct yyActionEntry {
 
228
  YYCODETYPE   lookahead;   /* The value of the look-ahead token */
 
229
  YYACTIONTYPE action;      /* Action to take for this look-ahead */
 
230
  struct yyActionEntry *next; /* Next look-ahead with the same hash, or NULL */
 
231
};
 
232
static struct yyActionEntry yyActionTable[] = {
 
233
/* State 0 */
 
234
  {  16,   3, 0                    }, /*           M_OPEN_ROUND shift  3 */
 
235
  {   1,  59, 0                    }, /*              MATCHTREE reduce 17 */
 
236
  {  18,  40, 0                    }, /*                M_PRUNE shift  40 */
 
237
  {   9,  36, 0                    }, /*                M_EXACT shift  36 */
 
238
  {   4,  14, 0                    }, /*              M_COLLECT shift  14 */
 
239
  {   5,  27, 0                    }, /*              M_ELEMENT shift  27 */
 
240
  {  22,   1, 0                    }, /*            conditional shift  1 */
 
241
  {  11,  16, 0                    }, /*                   M_IF shift  16 */
 
242
  {  24,  66, 0                    }, /*        match_condition accept */
 
243
  {  25,  25, &yyActionTable[   3] }, /*             match_mode shift  25 */
 
244
  {  10,  37, 0                    }, /*                M_FIRST shift  37 */
 
245
  {  27,  24, &yyActionTable[   7] }, /*             tree_match shift  24 */
 
246
  {  12,  38, 0                    }, /*                 M_LAST shift  38 */
 
247
  {  13,  39, 0                    }, /*                 M_LEAF shift  39 */
 
248
  {  14,  22, 0                    }, /*             M_NODENAME shift  22 */
 
249
  {  15,  12, 0                    }, /*                  M_NOT shift  12 */
 
250
/* State 1 */
 
251
  {   0,  42, 0                    }, /*                      $ reduce 0 */
 
252
  {  17,   6, 0                    }, /*                   M_OR shift  6 */
 
253
  {   2,  10, 0                    }, /*                  M_AND shift  10 */
 
254
  {  19,   2, 0                    }, /*                  M_SEQ shift  2 */
 
255
  {YYNOCODE,0,0}, /* Unused */
 
256
  {  21,   8, 0                    }, /*                  M_XOR shift  8 */
 
257
  {YYNOCODE,0,0}, /* Unused */
 
258
  {YYNOCODE,0,0}, /* Unused */
 
259
/* State 2 */
 
260
  {  16,   3, 0                    }, /*           M_OPEN_ROUND shift  3 */
 
261
  {   1,  59, 0                    }, /*              MATCHTREE reduce 17 */
 
262
  {  18,  40, 0                    }, /*                M_PRUNE shift  40 */
 
263
  {   9,  36, 0                    }, /*                M_EXACT shift  36 */
 
264
  {   4,  14, 0                    }, /*              M_COLLECT shift  14 */
 
265
  {   5,  27, 0                    }, /*              M_ELEMENT shift  27 */
 
266
  {  22,  41, 0                    }, /*            conditional shift  41 */
 
267
  {  11,  16, 0                    }, /*                   M_IF shift  16 */
 
268
  {YYNOCODE,0,0}, /* Unused */
 
269
  {  25,  25, &yyActionTable[  27] }, /*             match_mode shift  25 */
 
270
  {  10,  37, 0                    }, /*                M_FIRST shift  37 */
 
271
  {  27,  24, &yyActionTable[  31] }, /*             tree_match shift  24 */
 
272
  {  12,  38, 0                    }, /*                 M_LAST shift  38 */
 
273
  {  13,  39, 0                    }, /*                 M_LEAF shift  39 */
 
274
  {  14,  22, 0                    }, /*             M_NODENAME shift  22 */
 
275
  {  15,  12, 0                    }, /*                  M_NOT shift  12 */
 
276
/* State 3 */
 
277
  {  16,   3, 0                    }, /*           M_OPEN_ROUND shift  3 */
 
278
  {   1,  59, 0                    }, /*              MATCHTREE reduce 17 */
 
279
  {  18,  40, 0                    }, /*                M_PRUNE shift  40 */
 
280
  {   9,  36, 0                    }, /*                M_EXACT shift  36 */
 
281
  {   4,  14, 0                    }, /*              M_COLLECT shift  14 */
 
282
  {   5,  27, 0                    }, /*              M_ELEMENT shift  27 */
 
283
  {  22,   4, 0                    }, /*            conditional shift  4 */
 
284
  {  11,  16, 0                    }, /*                   M_IF shift  16 */
 
285
  {YYNOCODE,0,0}, /* Unused */
 
286
  {  25,  25, &yyActionTable[  43] }, /*             match_mode shift  25 */
 
287
  {  10,  37, 0                    }, /*                M_FIRST shift  37 */
 
288
  {  27,  24, &yyActionTable[  47] }, /*             tree_match shift  24 */
 
289
  {  12,  38, 0                    }, /*                 M_LAST shift  38 */
 
290
  {  13,  39, 0                    }, /*                 M_LEAF shift  39 */
 
291
  {  14,  22, 0                    }, /*             M_NODENAME shift  22 */
 
292
  {  15,  12, 0                    }, /*                  M_NOT shift  12 */
 
293
/* State 4 */
 
294
  {   3,   5, 0                    }, /*          M_CLOSE_ROUND shift  5 */
 
295
  {  17,   6, 0                    }, /*                   M_OR shift  6 */
 
296
  {   2,  10, 0                    }, /*                  M_AND shift  10 */
 
297
  {  19,   2, &yyActionTable[  56] }, /*                  M_SEQ shift  2 */
 
298
  {YYNOCODE,0,0}, /* Unused */
 
299
  {  21,   8, 0                    }, /*                  M_XOR shift  8 */
 
300
  {YYNOCODE,0,0}, /* Unused */
 
301
  {YYNOCODE,0,0}, /* Unused */
 
302
/* State 5 */
 
303
  {YYNOCODE,0,0}, /* Unused */
 
304
/* State 6 */
 
305
  {  16,   3, 0                    }, /*           M_OPEN_ROUND shift  3 */
 
306
  {   1,  59, 0                    }, /*              MATCHTREE reduce 17 */
 
307
  {  18,  40, 0                    }, /*                M_PRUNE shift  40 */
 
308
  {   9,  36, 0                    }, /*                M_EXACT shift  36 */
 
309
  {   4,  14, 0                    }, /*              M_COLLECT shift  14 */
 
310
  {   5,  27, 0                    }, /*              M_ELEMENT shift  27 */
 
311
  {  22,   7, 0                    }, /*            conditional shift  7 */
 
312
  {  11,  16, 0                    }, /*                   M_IF shift  16 */
 
313
  {YYNOCODE,0,0}, /* Unused */
 
314
  {  25,  25, &yyActionTable[  68] }, /*             match_mode shift  25 */
 
315
  {  10,  37, 0                    }, /*                M_FIRST shift  37 */
 
316
  {  27,  24, &yyActionTable[  72] }, /*             tree_match shift  24 */
 
317
  {  12,  38, 0                    }, /*                 M_LAST shift  38 */
 
318
  {  13,  39, 0                    }, /*                 M_LEAF shift  39 */
 
319
  {  14,  22, 0                    }, /*             M_NODENAME shift  22 */
 
320
  {  15,  12, 0                    }, /*                  M_NOT shift  12 */
 
321
/* State 7 */
 
322
  {YYNOCODE,0,0}, /* Unused */
 
323
  {  21,   8, 0                    }, /*                  M_XOR shift  8 */
 
324
  {   2,  10, 0                    }, /*                  M_AND shift  10 */
 
325
  {  19,   2, 0                    }, /*                  M_SEQ shift  2 */
 
326
/* State 8 */
 
327
  {  16,   3, 0                    }, /*           M_OPEN_ROUND shift  3 */
 
328
  {   1,  59, 0                    }, /*              MATCHTREE reduce 17 */
 
329
  {  18,  40, 0                    }, /*                M_PRUNE shift  40 */
 
330
  {   9,  36, 0                    }, /*                M_EXACT shift  36 */
 
331
  {   4,  14, 0                    }, /*              M_COLLECT shift  14 */
 
332
  {   5,  27, 0                    }, /*              M_ELEMENT shift  27 */
 
333
  {  22,   9, 0                    }, /*            conditional shift  9 */
 
334
  {  11,  16, 0                    }, /*                   M_IF shift  16 */
 
335
  {YYNOCODE,0,0}, /* Unused */
 
336
  {  25,  25, &yyActionTable[  88] }, /*             match_mode shift  25 */
 
337
  {  10,  37, 0                    }, /*                M_FIRST shift  37 */
 
338
  {  27,  24, &yyActionTable[  92] }, /*             tree_match shift  24 */
 
339
  {  12,  38, 0                    }, /*                 M_LAST shift  38 */
 
340
  {  13,  39, 0                    }, /*                 M_LEAF shift  39 */
 
341
  {  14,  22, 0                    }, /*             M_NODENAME shift  22 */
 
342
  {  15,  12, 0                    }, /*                  M_NOT shift  12 */
 
343
/* State 9 */
 
344
  {  19,   2, 0                    }, /*                  M_SEQ shift  2 */
 
345
/* State 10 */
 
346
  {  16,   3, 0                    }, /*           M_OPEN_ROUND shift  3 */
 
347
  {   1,  59, 0                    }, /*              MATCHTREE reduce 17 */
 
348
  {  18,  40, 0                    }, /*                M_PRUNE shift  40 */
 
349
  {   9,  36, 0                    }, /*                M_EXACT shift  36 */
 
350
  {   4,  14, 0                    }, /*              M_COLLECT shift  14 */
 
351
  {   5,  27, 0                    }, /*              M_ELEMENT shift  27 */
 
352
  {  22,  11, 0                    }, /*            conditional shift  11 */
 
353
  {  11,  16, 0                    }, /*                   M_IF shift  16 */
 
354
  {YYNOCODE,0,0}, /* Unused */
 
355
  {  25,  25, &yyActionTable[ 105] }, /*             match_mode shift  25 */
 
356
  {  10,  37, 0                    }, /*                M_FIRST shift  37 */
 
357
  {  27,  24, &yyActionTable[ 109] }, /*             tree_match shift  24 */
 
358
  {  12,  38, 0                    }, /*                 M_LAST shift  38 */
 
359
  {  13,  39, 0                    }, /*                 M_LEAF shift  39 */
 
360
  {  14,  22, 0                    }, /*             M_NODENAME shift  22 */
 
361
  {  15,  12, 0                    }, /*                  M_NOT shift  12 */
 
362
/* State 11 */
 
363
  {  19,   2, 0                    }, /*                  M_SEQ shift  2 */
 
364
  {  21,   8, &yyActionTable[ 118] }, /*                  M_XOR shift  8 */
 
365
/* State 12 */
 
366
  {  16,   3, 0                    }, /*           M_OPEN_ROUND shift  3 */
 
367
  {   1,  59, 0                    }, /*              MATCHTREE reduce 17 */
 
368
  {  18,  40, 0                    }, /*                M_PRUNE shift  40 */
 
369
  {   9,  36, 0                    }, /*                M_EXACT shift  36 */
 
370
  {   4,  14, 0                    }, /*              M_COLLECT shift  14 */
 
371
  {   5,  27, 0                    }, /*              M_ELEMENT shift  27 */
 
372
  {  22,  13, 0                    }, /*            conditional shift  13 */
 
373
  {  11,  16, 0                    }, /*                   M_IF shift  16 */
 
374
  {YYNOCODE,0,0}, /* Unused */
 
375
  {  25,  25, &yyActionTable[ 123] }, /*             match_mode shift  25 */
 
376
  {  10,  37, 0                    }, /*                M_FIRST shift  37 */
 
377
  {  27,  24, &yyActionTable[ 127] }, /*             tree_match shift  24 */
 
378
  {  12,  38, 0                    }, /*                 M_LAST shift  38 */
 
379
  {  13,  39, 0                    }, /*                 M_LEAF shift  39 */
 
380
  {  14,  22, 0                    }, /*             M_NODENAME shift  22 */
 
381
  {  15,  12, 0                    }, /*                  M_NOT shift  12 */
 
382
/* State 13 */
 
383
  {YYNOCODE,0,0}, /* Unused */
 
384
/* State 14 */
 
385
  {  16,   3, 0                    }, /*           M_OPEN_ROUND shift  3 */
 
386
  {   1,  59, 0                    }, /*              MATCHTREE reduce 17 */
 
387
  {  18,  40, 0                    }, /*                M_PRUNE shift  40 */
 
388
  {   9,  36, 0                    }, /*                M_EXACT shift  36 */
 
389
  {   4,  14, 0                    }, /*              M_COLLECT shift  14 */
 
390
  {   5,  27, 0                    }, /*              M_ELEMENT shift  27 */
 
391
  {  22,  15, 0                    }, /*            conditional shift  15 */
 
392
  {  11,  16, 0                    }, /*                   M_IF shift  16 */
 
393
  {YYNOCODE,0,0}, /* Unused */
 
394
  {  25,  25, &yyActionTable[ 140] }, /*             match_mode shift  25 */
 
395
  {  10,  37, 0                    }, /*                M_FIRST shift  37 */
 
396
  {  27,  24, &yyActionTable[ 144] }, /*             tree_match shift  24 */
 
397
  {  12,  38, 0                    }, /*                 M_LAST shift  38 */
 
398
  {  13,  39, 0                    }, /*                 M_LEAF shift  39 */
 
399
  {  14,  22, 0                    }, /*             M_NODENAME shift  22 */
 
400
  {  15,  12, 0                    }, /*                  M_NOT shift  12 */
 
401
/* State 15 */
 
402
  {YYNOCODE,0,0}, /* Unused */
 
403
/* State 16 */
 
404
  {  16,   3, 0                    }, /*           M_OPEN_ROUND shift  3 */
 
405
  {   1,  59, 0                    }, /*              MATCHTREE reduce 17 */
 
406
  {  18,  40, 0                    }, /*                M_PRUNE shift  40 */
 
407
  {   9,  36, 0                    }, /*                M_EXACT shift  36 */
 
408
  {   4,  14, 0                    }, /*              M_COLLECT shift  14 */
 
409
  {   5,  27, 0                    }, /*              M_ELEMENT shift  27 */
 
410
  {  22,  17, 0                    }, /*            conditional shift  17 */
 
411
  {  10,  37, 0                    }, /*                M_FIRST shift  37 */
 
412
  {  11,  16, 0                    }, /*                   M_IF shift  16 */
 
413
  {  25,  25, &yyActionTable[ 157] }, /*             match_mode shift  25 */
 
414
  {  26,  18, &yyActionTable[ 161] }, /*              selection shift  18 */
 
415
  {  27,  24, &yyActionTable[ 162] }, /*             tree_match shift  24 */
 
416
  {  12,  38, 0                    }, /*                 M_LAST shift  38 */
 
417
  {  13,  39, 0                    }, /*                 M_LEAF shift  39 */
 
418
  {  14,  22, 0                    }, /*             M_NODENAME shift  22 */
 
419
  {  15,  12, 0                    }, /*                  M_NOT shift  12 */
 
420
/* State 17 */
 
421
  {  17,   6, 0                    }, /*                   M_OR shift  6 */
 
422
  {  21,   8, &yyActionTable[ 170] }, /*                  M_XOR shift  8 */
 
423
  {   2,  10, 0                    }, /*                  M_AND shift  10 */
 
424
  {  19,   2, 0                    }, /*                  M_SEQ shift  2 */
 
425
/* State 18 */
 
426
  {   8,  19, 0                    }, /*                M_ENDIF shift  19 */
 
427
  {   7,  20, 0                    }, /*                 M_ELIF shift  20 */
 
428
/* State 19 */
 
429
  {YYNOCODE,0,0}, /* Unused */
 
430
/* State 20 */
 
431
  {  16,   3, 0                    }, /*           M_OPEN_ROUND shift  3 */
 
432
  {   1,  59, 0                    }, /*              MATCHTREE reduce 17 */
 
433
  {  18,  40, 0                    }, /*                M_PRUNE shift  40 */
 
434
  {   9,  36, 0                    }, /*                M_EXACT shift  36 */
 
435
  {   4,  14, 0                    }, /*              M_COLLECT shift  14 */
 
436
  {   5,  27, 0                    }, /*              M_ELEMENT shift  27 */
 
437
  {  22,  21, 0                    }, /*            conditional shift  21 */
 
438
  {  11,  16, 0                    }, /*                   M_IF shift  16 */
 
439
  {YYNOCODE,0,0}, /* Unused */
 
440
  {  25,  25, &yyActionTable[ 180] }, /*             match_mode shift  25 */
 
441
  {  10,  37, 0                    }, /*                M_FIRST shift  37 */
 
442
  {  27,  24, &yyActionTable[ 184] }, /*             tree_match shift  24 */
 
443
  {  12,  38, 0                    }, /*                 M_LAST shift  38 */
 
444
  {  13,  39, 0                    }, /*                 M_LEAF shift  39 */
 
445
  {  14,  22, 0                    }, /*             M_NODENAME shift  22 */
 
446
  {  15,  12, 0                    }, /*                  M_NOT shift  12 */
 
447
/* State 21 */
 
448
  {  17,   6, 0                    }, /*                   M_OR shift  6 */
 
449
  {  21,   8, &yyActionTable[ 193] }, /*                  M_XOR shift  8 */
 
450
  {   2,  10, 0                    }, /*                  M_AND shift  10 */
 
451
  {  19,   2, 0                    }, /*                  M_SEQ shift  2 */
 
452
/* State 22 */
 
453
  {   1,  23, 0                    }, /*              MATCHTREE shift  23 */
 
454
/* State 23 */
 
455
  {YYNOCODE,0,0}, /* Unused */
 
456
/* State 24 */
 
457
  {YYNOCODE,0,0}, /* Unused */
 
458
/* State 25 */
 
459
  {   1,  26, 0                    }, /*              MATCHTREE shift  26 */
 
460
/* State 26 */
 
461
  {YYNOCODE,0,0}, /* Unused */
 
462
/* State 27 */
 
463
  {   9,  36, &yyActionTable[ 205] }, /*                M_EXACT shift  36 */
 
464
  {  25,  28, &yyActionTable[ 202] }, /*             match_mode shift  28 */
 
465
  {  18,  40, &yyActionTable[ 209] }, /*                M_PRUNE shift  40 */
 
466
  {   1,  59, 0                    }, /*              MATCHTREE reduce 17 */
 
467
  {  12,  38, 0                    }, /*                 M_LAST shift  38 */
 
468
  {  13,  39, 0                    }, /*                 M_LEAF shift  39 */
 
469
  {   6,  30, 0                    }, /*           M_ELEMENT_NO shift  30 */
 
470
  {  10,  37, 0                    }, /*                M_FIRST shift  37 */
 
471
/* State 28 */
 
472
  {   1,  29, 0                    }, /*              MATCHTREE shift  29 */
 
473
/* State 29 */
 
474
  {YYNOCODE,0,0}, /* Unused */
 
475
/* State 30 */
 
476
  {   9,  36, &yyActionTable[ 215] }, /*                M_EXACT shift  36 */
 
477
  {  25,  31, &yyActionTable[ 212] }, /*             match_mode shift  31 */
 
478
  {  18,  40, &yyActionTable[ 219] }, /*                M_PRUNE shift  40 */
 
479
  {   1,  59, 0                    }, /*              MATCHTREE reduce 17 */
 
480
  {  12,  38, 0                    }, /*                 M_LAST shift  38 */
 
481
  {  13,  39, 0                    }, /*                 M_LEAF shift  39 */
 
482
  {   6,  33, 0                    }, /*           M_ELEMENT_NO shift  33 */
 
483
  {  10,  37, 0                    }, /*                M_FIRST shift  37 */
 
484
/* State 31 */
 
485
  {   1,  32, 0                    }, /*              MATCHTREE shift  32 */
 
486
/* State 32 */
 
487
  {YYNOCODE,0,0}, /* Unused */
 
488
/* State 33 */
 
489
  {   9,  36, &yyActionTable[ 225] }, /*                M_EXACT shift  36 */
 
490
  {  25,  34, &yyActionTable[ 222] }, /*             match_mode shift  34 */
 
491
  {  18,  40, &yyActionTable[ 228] }, /*                M_PRUNE shift  40 */
 
492
  {   1,  59, 0                    }, /*              MATCHTREE reduce 17 */
 
493
  {  12,  38, 0                    }, /*                 M_LAST shift  38 */
 
494
  {  13,  39, 0                    }, /*                 M_LEAF shift  39 */
 
495
  {  10,  37, 0                    }, /*                M_FIRST shift  37 */
 
496
  {YYNOCODE,0,0}, /* Unused */
 
497
/* State 34 */
 
498
  {   1,  35, 0                    }, /*              MATCHTREE shift  35 */
 
499
/* State 35 */
 
500
  {YYNOCODE,0,0}, /* Unused */
 
501
/* State 36 */
 
502
  {   1,  60, 0                    }, /*              MATCHTREE reduce 18 */
 
503
/* State 37 */
 
504
  {   1,  61, 0                    }, /*              MATCHTREE reduce 19 */
 
505
/* State 38 */
 
506
  {   1,  62, 0                    }, /*              MATCHTREE reduce 20 */
 
507
/* State 39 */
 
508
  {   1,  63, 0                    }, /*              MATCHTREE reduce 21 */
 
509
/* State 40 */
 
510
  {   1,  64, 0                    }, /*              MATCHTREE reduce 22 */
 
511
/* State 41 */
 
512
  {YYNOCODE,0,0}, /* Unused */
 
513
};
 
514
 
 
515
/* The state table contains information needed to look up the correct
 
516
** action in the action table, given the current state of the parser.
 
517
** Information needed includes:
 
518
**
 
519
**  +  A pointer to the start of the action hash table in yyActionTable.
 
520
**
 
521
**  +  A mask used to hash the look-ahead token.  The mask is an integer
 
522
**     which is one less than the size of the hash table.  
 
523
**
 
524
**  +  The default action.  This is the action to take if no entry for
 
525
**     the given look-ahead is found in the action hash table.
 
526
*/
 
527
struct yyStateEntry {
 
528
  struct yyActionEntry *hashtbl; /* Start of the hash table in yyActionTable */
 
529
  int mask;                      /* Mask used for hashing the look-ahead */
 
530
  YYACTIONTYPE actionDefault;    /* Default action if look-ahead not found */
 
531
};
 
532
static struct yyStateEntry yyStateTable[] = {
 
533
  { &yyActionTable[0], 15, 65},
 
534
  { &yyActionTable[16], 7, 65},
 
535
  { &yyActionTable[24], 15, 65},
 
536
  { &yyActionTable[40], 15, 65},
 
537
  { &yyActionTable[56], 7, 65},
 
538
  { &yyActionTable[64], 0, 43},
 
539
  { &yyActionTable[65], 15, 65},
 
540
  { &yyActionTable[81], 3, 45},
 
541
  { &yyActionTable[85], 15, 65},
 
542
  { &yyActionTable[101], 0, 46},
 
543
  { &yyActionTable[102], 15, 65},
 
544
  { &yyActionTable[118], 1, 47},
 
545
  { &yyActionTable[120], 15, 65},
 
546
  { &yyActionTable[136], 0, 48},
 
547
  { &yyActionTable[137], 15, 65},
 
548
  { &yyActionTable[153], 0, 49},
 
549
  { &yyActionTable[154], 15, 65},
 
550
  { &yyActionTable[170], 3, 53},
 
551
  { &yyActionTable[174], 1, 65},
 
552
  { &yyActionTable[176], 0, 50},
 
553
  { &yyActionTable[177], 15, 65},
 
554
  { &yyActionTable[193], 3, 54},
 
555
  { &yyActionTable[197], 0, 65},
 
556
  { &yyActionTable[198], 0, 51},
 
557
  { &yyActionTable[199], 0, 52},
 
558
  { &yyActionTable[200], 0, 65},
 
559
  { &yyActionTable[201], 0, 55},
 
560
  { &yyActionTable[202], 7, 65},
 
561
  { &yyActionTable[210], 0, 65},
 
562
  { &yyActionTable[211], 0, 56},
 
563
  { &yyActionTable[212], 7, 65},
 
564
  { &yyActionTable[220], 0, 65},
 
565
  { &yyActionTable[221], 0, 57},
 
566
  { &yyActionTable[222], 7, 65},
 
567
  { &yyActionTable[230], 0, 65},
 
568
  { &yyActionTable[231], 0, 58},
 
569
  { &yyActionTable[232], 0, 65},
 
570
  { &yyActionTable[233], 0, 65},
 
571
  { &yyActionTable[234], 0, 65},
 
572
  { &yyActionTable[235], 0, 65},
 
573
  { &yyActionTable[236], 0, 65},
 
574
  { &yyActionTable[237], 0, 44},
 
575
};
 
576
 
 
577
/* The following structure represents a single element of the
 
578
** parser's stack.  Information stored includes:
 
579
**
 
580
**   +  The state number for the parser at this level of the stack.
 
581
**
 
582
**   +  The value of the token stored at this level of the stack.
 
583
**      (In other words, the "major" token.)
 
584
**
 
585
**   +  The semantic value stored at this level of the stack.  This is
 
586
**      the information used by the action routines in the grammar.
 
587
**      It is sometimes called the "minor" token.
 
588
*/
 
589
struct yyStackEntry {
 
590
  int stateno;       /* The state-number */
 
591
  int major;         /* The major token value.  This is the code
 
592
                     ** number for the token at this stack level */
 
593
  YYMINORTYPE minor; /* The user-supplied minor token value.  This
 
594
                     ** is the value of the token  */
 
595
};
 
596
 
 
597
/* The state of the parser is completely contained in an instance of
 
598
** the following structure */
 
599
struct yyParser {
 
600
  int idx;                            /* Index of top element in stack */
 
601
  int errcnt;                         /* Shifts left before out of the error */
 
602
  struct yyStackEntry *top;           /* Pointer to the top stack element */
 
603
  struct yyStackEntry stack[YYSTACKDEPTH];  /* The parser's stack */
 
604
};
 
605
typedef struct yyParser yyParser;
 
606
 
 
607
#ifndef NDEBUG
 
608
#include <stdio.h>
 
609
static FILE *yyTraceFILE = 0;
 
610
static char *yyTracePrompt = 0;
 
611
 
 
612
/* 
 
613
** Turn parser tracing on by giving a stream to which to write the trace
 
614
** and a prompt to preface each trace message.  Tracing is turned off
 
615
** by making either argument NULL 
 
616
**
 
617
** Inputs:
 
618
** <ul>
 
619
** <li> A FILE* to which trace output should be written.
 
620
**      If NULL, then tracing is turned off.
 
621
** <li> A prefix string written at the beginning of every
 
622
**      line of trace output.  If NULL, then tracing is
 
623
**      turned off.
 
624
** </ul>
 
625
**
 
626
** Outputs:
 
627
** None.
 
628
*/
 
629
void CMatchParserTrace(FILE *TraceFILE, char *zTracePrompt){
 
630
  yyTraceFILE = TraceFILE;
 
631
  yyTracePrompt = zTracePrompt;
 
632
  if( yyTraceFILE==0 ) yyTracePrompt = 0;
 
633
  else if( yyTracePrompt==0 ) yyTraceFILE = 0;
 
634
}
 
635
 
 
636
/* For tracing shifts, the names of all terminals and nonterminals
 
637
** are required.  The following table supplies these names */
 
638
static char *yyTokenName[] = { 
 
639
  "$",             "MATCHTREE",     "M_AND",         "M_CLOSE_ROUND",
 
640
  "M_COLLECT",     "M_ELEMENT",     "M_ELEMENT_NO",  "M_ELIF",      
 
641
  "M_ENDIF",       "M_EXACT",       "M_FIRST",       "M_IF",        
 
642
  "M_LAST",        "M_LEAF",        "M_NODENAME",    "M_NOT",       
 
643
  "M_OPEN_ROUND",  "M_OR",          "M_PRUNE",       "M_SEQ",       
 
644
  "M_UNARY",       "M_XOR",         "conditional",   "error",       
 
645
  "match_condition",  "match_mode",    "selection",     "tree_match",  
 
646
};
 
647
#define YYTRACE(X) if( yyTraceFILE ) fprintf(yyTraceFILE,"%sReduce [%s].\n",yyTracePrompt,X);
 
648
#else
 
649
#define YYTRACE(X)
 
650
#endif
 
651
 
 
652
/* 
 
653
** This function allocates a new parser.
 
654
** The only argument is a pointer to a function which works like
 
655
** malloc.
 
656
**
 
657
** Inputs:
 
658
** A pointer to the function used to allocate memory.
 
659
**
 
660
** Outputs:
 
661
** A pointer to a parser.  This pointer is used in subsequent calls
 
662
** to CMatchParser and CMatchParserFree.
 
663
*/
 
664
void *CMatchParserAlloc(void *(*mallocProc)(...)){
 
665
  yyParser *pParser;
 
666
  pParser = (yyParser*)(*mallocProc)( sizeof(yyParser), __FILE__, __LINE__ );
 
667
  if( pParser ){
 
668
    pParser->idx = -1;
 
669
  }
 
670
  return pParser;
 
671
}
 
672
 
 
673
/* The following function deletes the value associated with a
 
674
** symbol.  The symbol can be either a terminal or nonterminal.
 
675
** "yymajor" is the symbol code, and "yypminor" is a pointer to
 
676
** the value.
 
677
*/
 
678
static void yy_destructor(YYCODETYPE yymajor, YYMINORTYPE *yypminor){
 
679
  switch( yymajor ){
 
680
    /* Here is inserted the actions which take place when a
 
681
    ** terminal or non-terminal is destroyed.  This can happen
 
682
    ** when the symbol is popped from the stack during a
 
683
    ** reduce or during error processing or when a parser is 
 
684
    ** being destroyed before it is finished parsing.
 
685
    **
 
686
    ** Note: during a reduce, the only symbols destroyed are those
 
687
    ** which appear on the RHS of the rule, but which are not used
 
688
    ** inside the C code.
 
689
    */
 
690
    default:  break;   /* If no destructor action specified: do nothing */
 
691
  }
 
692
}
 
693
 
 
694
/*
 
695
** Pop the parser's stack once.
 
696
**
 
697
** If there is a destructor routine associated with the token which
 
698
** is popped from the stack, then call it.
 
699
**
 
700
** Return the major token number for the symbol popped.
 
701
*/
 
702
static int yy_pop_parser_stack(yyParser *pParser){
 
703
  YYCODETYPE yymajor;
 
704
 
 
705
  if( pParser->idx<0 ) return 0;
 
706
#ifndef NDEBUG
 
707
  if( yyTraceFILE && pParser->idx>=0 ){
 
708
    fprintf(yyTraceFILE,"%sPopping %s\n",
 
709
      yyTracePrompt,
 
710
      yyTokenName[pParser->top->major]);
 
711
  }
 
712
#endif
 
713
  yymajor = pParser->top->major;
 
714
  yy_destructor( yymajor, &pParser->top->minor);
 
715
  pParser->idx--;
 
716
  pParser->top--;
 
717
  return yymajor;
 
718
}
 
719
 
 
720
/* 
 
721
** Deallocate and destroy a parser.  Destructors are all called for
 
722
** all stack elements before shutting the parser down.
 
723
**
 
724
** Inputs:
 
725
** <ul>
 
726
** <li>  A pointer to the parser.  This should be a pointer
 
727
**       obtained from CMatchParserAlloc.
 
728
** <li>  A pointer to a function used to reclaim memory obtained
 
729
**       from malloc.
 
730
** </ul>
 
731
*/
 
732
void CMatchParserFree(
 
733
  void *p,               /* The parser to be deleted */
 
734
  void (*freeProc)(...)     /* Function used to reclaim memory */
 
735
){
 
736
  yyParser *pParser = (yyParser*)p;
 
737
  if( pParser==0 ) return;
 
738
  while( pParser->idx>=0 ) yy_pop_parser_stack(pParser);
 
739
  (*freeProc)(pParser, __FILE__, __LINE__);
 
740
}
 
741
 
 
742
/*
 
743
** Find the appropriate action for a parser given the look-ahead token.
 
744
**
 
745
** If the look-ahead token is YYNOCODE, then check to see if the action is
 
746
** independent of the look-ahead.  If it is, return the action, otherwise
 
747
** return YY_NO_ACTION.
 
748
*/
 
749
static int yy_find_parser_action(
 
750
  yyParser *pParser,        /* The parser */
 
751
  int iLookAhead             /* The look-ahead token */
 
752
){
 
753
  struct yyStateEntry *pState;   /* Appropriate entry in the state table */
 
754
  struct yyActionEntry *pAction; /* Action appropriate for the look-ahead */
 
755
 
 
756
  /* if( pParser->idx<0 ) return YY_NO_ACTION;  */
 
757
  pState = &yyStateTable[pParser->top->stateno];
 
758
  if( iLookAhead!=YYNOCODE ){
 
759
    pAction = &pState->hashtbl[iLookAhead & pState->mask];
 
760
    while( pAction ){
 
761
      if( pAction->lookahead==iLookAhead ) return pAction->action;
 
762
      pAction = pAction->next;
 
763
    }
 
764
  }else if( pState->mask!=0 || pState->hashtbl->lookahead!=YYNOCODE ){
 
765
    return YY_NO_ACTION;
 
766
  }
 
767
  return pState->actionDefault;
 
768
}
 
769
 
 
770
/*
 
771
** Perform a shift action.
 
772
*/
 
773
static void yy_shift(
 
774
  yyParser *yypParser,          /* The parser to be shifted */
 
775
  int yyNewState,               /* The new state to shift in */
 
776
  int yyMajor,                  /* The major token to shift in */
 
777
  YYMINORTYPE *yypMinor         /* Pointer ot the minor token to shift in */
 
778
){
 
779
  yypParser->idx++;
 
780
  yypParser->top++;
 
781
  if( yypParser->idx>=YYSTACKDEPTH ){
 
782
     yypParser->idx--;
 
783
     yypParser->top--;
 
784
#ifndef NDEBUG
 
785
     if( yyTraceFILE ){
 
786
       fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt);
 
787
     }
 
788
#endif
 
789
     while( yypParser->idx>=0 ) yy_pop_parser_stack(yypParser);
 
790
     /* Here code is inserted which will execute if the parser
 
791
     ** stack every overflows */
 
792
     return;
 
793
  }
 
794
  yypParser->top->stateno = yyNewState;
 
795
  yypParser->top->major = yyMajor;
 
796
  yypParser->top->minor = *yypMinor;
 
797
#ifndef NDEBUG
 
798
  if( yyTraceFILE && yypParser->idx>0 ){
 
799
    int i;
 
800
    fprintf(yyTraceFILE,"%sShift %d\n",yyTracePrompt,yyNewState);
 
801
    fprintf(yyTraceFILE,"%sStack:",yyTracePrompt);
 
802
    for(i=1; i<=yypParser->idx; i++)
 
803
      fprintf(yyTraceFILE," %s",yyTokenName[yypParser->stack[i].major]);
 
804
    fprintf(yyTraceFILE,"\n");
 
805
  }
 
806
#endif
 
807
}
 
808
 
 
809
/* The following table contains information about every rule that
 
810
** is used during the reduce.
 
811
*/
 
812
static struct {
 
813
  YYCODETYPE lhs;         /* Symbol on the left-hand side of the rule */
 
814
  unsigned char nrhs;     /* Number of right-hand side symbols in the rule */
 
815
} yyRuleInfo[] = {
 
816
  { 24, 1 },
 
817
  { 22, 3 },
 
818
  { 22, 3 },
 
819
  { 22, 3 },
 
820
  { 22, 3 },
 
821
  { 22, 3 },
 
822
  { 22, 2 },
 
823
  { 22, 2 },
 
824
  { 22, 3 },
 
825
  { 22, 2 },
 
826
  { 22, 1 },
 
827
  { 26, 1 },
 
828
  { 26, 3 },
 
829
  { 27, 2 },
 
830
  { 27, 3 },
 
831
  { 27, 4 },
 
832
  { 27, 5 },
 
833
  { 25, 0 },
 
834
  { 25, 1 },
 
835
  { 25, 1 },
 
836
  { 25, 1 },
 
837
  { 25, 1 },
 
838
  { 25, 1 },
 
839
};
 
840
 
 
841
static void yy_accept(
 
842
  yyParser *yypParser           /* The parser */
 
843
  CMatchParserANSIARGDECL              /* Extra arguments (if any) */
 
844
);  /* Forward declaration */
 
845
 
 
846
/*
 
847
** Perform a reduce action and the shift that must immediately
 
848
** follow the reduce.
 
849
*/
 
850
static void yy_reduce(
 
851
  yyParser *yypParser,         /* The parser */
 
852
  int yyruleno                 /* Number of the rule by which to reduce */
 
853
  CMatchParserANSIARGDECL
 
854
){
 
855
  int yygoto;                     /* The next state */
 
856
  int yyact;                      /* The next action */
 
857
  YYMINORTYPE yygotominor;        /* The LHS of the rule reduced */
 
858
  struct yyStackEntry *yymsp;     /* The top of the parser's stack */
 
859
  int yysize;                     /* Amount to pop the stack */
 
860
  yymsp = yypParser->top;
 
861
  switch( yyruleno ){
 
862
  /* Beginning here are the reduction cases.  A typical example
 
863
  ** follows:
 
864
  **   case 0:
 
865
  **     YYTRACE("<text of the rule>");
 
866
  **  #line <lineno> <grammarfile>
 
867
  **     { ... }           // User supplied code
 
868
  **  #line <lineno> <thisfile>
 
869
  **     break;
 
870
  */
 
871
      case 0:
 
872
        YYTRACE("match_condition ::= conditional")
 
873
#line 165 "manip/CMatchParser.lem"
 
874
 
875
        mstate->value = yymsp[0].minor.yy4; 
 
876
    }
 
877
#line 877 "/home/inf4/spinczyk/ac-woven-1.0pre2/Puma/gen-release/step1/src/CMatchParser.cc"
 
878
        break;
 
879
      case 1:
 
880
        YYTRACE("conditional ::= M_OPEN_ROUND conditional M_CLOSE_ROUND")
 
881
#line 174 "manip/CMatchParser.lem"
 
882
 
883
        yygotominor.yy4 = yymsp[-1].minor.yy4;
 
884
    }
 
885
#line 885 "/home/inf4/spinczyk/ac-woven-1.0pre2/Puma/gen-release/step1/src/CMatchParser.cc"
 
886
        /* No destructor defined for M_OPEN_ROUND */
 
887
        /* No destructor defined for M_CLOSE_ROUND */
 
888
        break;
 
889
      case 2:
 
890
        YYTRACE("conditional ::= conditional M_SEQ conditional")
 
891
#line 178 "manip/CMatchParser.lem"
 
892
{   
 
893
        /* The sequence or implication. */
 
894
        /* A B | seq                    */
 
895
        /* ----+-----                   */
 
896
        /* 1 1 |  1                     */
 
897
        /* 1 0 |  0                     */
 
898
        /* 0 1 |  1                     */
 
899
        /* 0 0 |  0 (!)                 */
 
900
        yygotominor.yy4 = yymsp[0].minor.yy4; 
 
901
    }
 
902
#line 902 "/home/inf4/spinczyk/ac-woven-1.0pre2/Puma/gen-release/step1/src/CMatchParser.cc"
 
903
        /* No destructor defined for conditional */
 
904
        /* No destructor defined for M_SEQ */
 
905
        break;
 
906
      case 3:
 
907
        YYTRACE("conditional ::= conditional M_OR conditional")
 
908
#line 189 "manip/CMatchParser.lem"
 
909
 
910
        /* The alternative. */
 
911
        /* A B |  or        */
 
912
        /* ----+-----       */
 
913
        /* 1 1 |  1         */
 
914
        /* 1 0 |  1         */
 
915
        /* 0 1 |  1         */
 
916
        /* 0 0 |  0         */
 
917
        yygotominor.yy4 = (yymsp[-2].minor.yy4 || yymsp[0].minor.yy4) ? 1 : 0; 
 
918
    }
 
919
#line 919 "/home/inf4/spinczyk/ac-woven-1.0pre2/Puma/gen-release/step1/src/CMatchParser.cc"
 
920
        /* No destructor defined for M_OR */
 
921
        break;
 
922
      case 4:
 
923
        YYTRACE("conditional ::= conditional M_XOR conditional")
 
924
#line 200 "manip/CMatchParser.lem"
 
925
 
926
        /* The exclusive alternative. */
 
927
        /* A B | xor                  */
 
928
        /* ----+-----                 */
 
929
        /* 1 1 |  0                   */
 
930
        /* 1 0 |  1                   */
 
931
        /* 0 1 |  1                   */
 
932
        /* 0 0 |  0                   */
 
933
        yygotominor.yy4 = ((yymsp[-2].minor.yy4 && ! yymsp[0].minor.yy4) || (! yymsp[-2].minor.yy4 && yymsp[0].minor.yy4)) ? 1 : 0; 
 
934
    }
 
935
#line 935 "/home/inf4/spinczyk/ac-woven-1.0pre2/Puma/gen-release/step1/src/CMatchParser.cc"
 
936
        /* No destructor defined for M_XOR */
 
937
        break;
 
938
      case 5:
 
939
        YYTRACE("conditional ::= conditional M_AND conditional")
 
940
#line 211 "manip/CMatchParser.lem"
 
941
 
942
        /* The conjunction. */
 
943
        /* A B | and        */
 
944
        /* ----+-----       */
 
945
        /* 1 1 |  1         */
 
946
        /* 1 0 |  0         */
 
947
        /* 0 1 |  0         */
 
948
        /* 0 0 |  0         */
 
949
        yygotominor.yy4 = (yymsp[-2].minor.yy4 && yymsp[0].minor.yy4) ? 1 : 0; 
 
950
    }
 
951
#line 951 "/home/inf4/spinczyk/ac-woven-1.0pre2/Puma/gen-release/step1/src/CMatchParser.cc"
 
952
        /* No destructor defined for M_AND */
 
953
        break;
 
954
      case 6:
 
955
        YYTRACE("conditional ::= M_NOT conditional")
 
956
#line 222 "manip/CMatchParser.lem"
 
957
{
 
958
        /* The negation. */
 
959
        /* A | not       */
 
960
        /* --+-----      */
 
961
        /* 1 |  0        */
 
962
        /* 0 |  1        */
 
963
        yygotominor.yy4 = ! yymsp[0].minor.yy4; 
 
964
    }
 
965
#line 965 "/home/inf4/spinczyk/ac-woven-1.0pre2/Puma/gen-release/step1/src/CMatchParser.cc"
 
966
        /* No destructor defined for M_NOT */
 
967
        break;
 
968
      case 7:
 
969
        YYTRACE("conditional ::= M_COLLECT conditional")
 
970
#line 231 "manip/CMatchParser.lem"
 
971
{
 
972
        /* The collector. */
 
973
        /* A | collect    */
 
974
        /* --+-----       */
 
975
        /* 1 |  1         */
 
976
        /* 0 |  1         */
 
977
        yygotominor.yy4 = 1; 
 
978
    }
 
979
#line 979 "/home/inf4/spinczyk/ac-woven-1.0pre2/Puma/gen-release/step1/src/CMatchParser.cc"
 
980
        /* No destructor defined for M_COLLECT */
 
981
        /* No destructor defined for conditional */
 
982
        break;
 
983
      case 8:
 
984
        YYTRACE("conditional ::= M_IF selection M_ENDIF")
 
985
#line 240 "manip/CMatchParser.lem"
 
986
{
 
987
        /* The selection.                                 */
 
988
        /* E.g.: if <conditional>                         */
 
989
        /*       elif <conditional>                       */
 
990
        /*       elif <conditional>                       */
 
991
        /*       endif                                    */
 
992
        /* The conditionals are evaluated till the first  */
 
993
        /* true conditional is found. The following elifs */
 
994
        /* are skipped and their conditionals are not     */
 
995
        /* evaluated anymore.                             */
 
996
        yygotominor.yy4 = yymsp[-1].minor.yy4;
 
997
        mstate->depth--;
 
998
    }
 
999
#line 999 "/home/inf4/spinczyk/ac-woven-1.0pre2/Puma/gen-release/step1/src/CMatchParser.cc"
 
1000
        /* No destructor defined for M_IF */
 
1001
        /* No destructor defined for M_ENDIF */
 
1002
        break;
 
1003
      case 9:
 
1004
        YYTRACE("conditional ::= M_NODENAME MATCHTREE")
 
1005
#line 254 "manip/CMatchParser.lem"
 
1006
{
 
1007
        /* It's checked whether the root node of the */
 
1008
        /* current syntax tree has the given name.   */
 
1009
        /* Regular expressions are allowed, too.     */
 
1010
        if (mstate->selected[mstate->depth]) 
 
1011
            yygotominor.yy4 = 0;
 
1012
        else 
 
1013
            yygotominor.yy4 = mstate->matcher->matchNodeName (mstate->tree, yymsp[0].minor.yy0);
 
1014
    }
 
1015
#line 1015 "/home/inf4/spinczyk/ac-woven-1.0pre2/Puma/gen-release/step1/src/CMatchParser.cc"
 
1016
        /* No destructor defined for M_NODENAME */
 
1017
        break;
 
1018
      case 10:
 
1019
        YYTRACE("conditional ::= tree_match")
 
1020
#line 264 "manip/CMatchParser.lem"
 
1021
{
 
1022
        yygotominor.yy4 = yymsp[0].minor.yy4;
 
1023
    }
 
1024
#line 1024 "/home/inf4/spinczyk/ac-woven-1.0pre2/Puma/gen-release/step1/src/CMatchParser.cc"
 
1025
        break;
 
1026
      case 11:
 
1027
        YYTRACE("selection ::= conditional")
 
1028
#line 273 "manip/CMatchParser.lem"
 
1029
{
 
1030
        if (! mstate->selected[mstate->depth])
 
1031
            yygotominor.yy4 = mstate->selected[mstate->depth] = yymsp[0].minor.yy4;
 
1032
        else
 
1033
            yygotominor.yy4 = 1;
 
1034
    }
 
1035
#line 1035 "/home/inf4/spinczyk/ac-woven-1.0pre2/Puma/gen-release/step1/src/CMatchParser.cc"
 
1036
        break;
 
1037
      case 12:
 
1038
        YYTRACE("selection ::= selection M_ELIF conditional")
 
1039
#line 280 "manip/CMatchParser.lem"
 
1040
{
 
1041
        if (! mstate->selected[mstate->depth])
 
1042
            yygotominor.yy4 = mstate->selected[mstate->depth] = yymsp[0].minor.yy4;
 
1043
        else
 
1044
            yygotominor.yy4 = 1;
 
1045
    }
 
1046
#line 1046 "/home/inf4/spinczyk/ac-woven-1.0pre2/Puma/gen-release/step1/src/CMatchParser.cc"
 
1047
        /* No destructor defined for selection */
 
1048
        /* No destructor defined for M_ELIF */
 
1049
        break;
 
1050
      case 13:
 
1051
        YYTRACE("tree_match ::= match_mode MATCHTREE")
 
1052
#line 292 "manip/CMatchParser.lem"
 
1053
 
1054
        if (mstate->selected[mstate->depth]) 
 
1055
            yygotominor.yy4 = 0;
 
1056
        else 
 
1057
            yygotominor.yy4 = mstate->matcher->matchTree (yymsp[-1].minor.yy4, *mstate, mstate->tree, yymsp[0].minor.yy0);
 
1058
    }
 
1059
#line 1059 "/home/inf4/spinczyk/ac-woven-1.0pre2/Puma/gen-release/step1/src/CMatchParser.cc"
 
1060
        break;
 
1061
      case 14:
 
1062
        YYTRACE("tree_match ::= M_ELEMENT match_mode MATCHTREE")
 
1063
#line 299 "manip/CMatchParser.lem"
 
1064
{
 
1065
        if (mstate->selected[mstate->depth]) 
 
1066
            yygotominor.yy4 = 0;
 
1067
        else if (mstate->mode == CTreeMatcher::ANY_LIST)
 
1068
            yygotominor.yy4 = mstate->matcher->matchList (yymsp[-1].minor.yy4, *mstate, yymsp[0].minor.yy0);
 
1069
        else
 
1070
            yygotominor.yy4 = mstate->matcher->matchTree (yymsp[-1].minor.yy4, *mstate, mstate->tree, yymsp[0].minor.yy0);
 
1071
    }
 
1072
#line 1072 "/home/inf4/spinczyk/ac-woven-1.0pre2/Puma/gen-release/step1/src/CMatchParser.cc"
 
1073
        /* No destructor defined for M_ELEMENT */
 
1074
        break;
 
1075
      case 15:
 
1076
        YYTRACE("tree_match ::= M_ELEMENT M_ELEMENT_NO match_mode MATCHTREE")
 
1077
#line 308 "manip/CMatchParser.lem"
 
1078
{
 
1079
        if (mstate->selected[mstate->depth]) 
 
1080
            yygotominor.yy4 = 0;
 
1081
        else if (mstate->mode == CTreeMatcher::ANY_LIST)
 
1082
            yygotominor.yy4 = mstate->matcher->matchList (yymsp[-1].minor.yy4, *mstate, yymsp[0].minor.yy0, yymsp[-2].minor.yy0);
 
1083
        else
 
1084
            yygotominor.yy4 = mstate->matcher->matchTree (yymsp[-1].minor.yy4, *mstate, mstate->tree, yymsp[0].minor.yy0);
 
1085
    }
 
1086
#line 1086 "/home/inf4/spinczyk/ac-woven-1.0pre2/Puma/gen-release/step1/src/CMatchParser.cc"
 
1087
        /* No destructor defined for M_ELEMENT */
 
1088
        break;
 
1089
      case 16:
 
1090
        YYTRACE("tree_match ::= M_ELEMENT M_ELEMENT_NO M_ELEMENT_NO match_mode MATCHTREE")
 
1091
#line 318 "manip/CMatchParser.lem"
 
1092
{
 
1093
        if (mstate->selected[mstate->depth]) 
 
1094
            yygotominor.yy4 = 0;
 
1095
        else if (mstate->mode == CTreeMatcher::ANY_LIST)
 
1096
            yygotominor.yy4 = mstate->matcher->matchList (yymsp[-1].minor.yy4, *mstate, yymsp[0].minor.yy0, yymsp[-3].minor.yy0, yymsp[-2].minor.yy0);
 
1097
        else
 
1098
            yygotominor.yy4 = mstate->matcher->matchTree (yymsp[-1].minor.yy4, *mstate, mstate->tree, yymsp[0].minor.yy0);
 
1099
    }
 
1100
#line 1100 "/home/inf4/spinczyk/ac-woven-1.0pre2/Puma/gen-release/step1/src/CMatchParser.cc"
 
1101
        /* No destructor defined for M_ELEMENT */
 
1102
        break;
 
1103
      case 17:
 
1104
        YYTRACE("match_mode ::=")
 
1105
#line 331 "manip/CMatchParser.lem"
 
1106
{ yygotominor.yy4 = CTreeMatcher::MATCH_ALL; }
 
1107
#line 1107 "/home/inf4/spinczyk/ac-woven-1.0pre2/Puma/gen-release/step1/src/CMatchParser.cc"
 
1108
        break;
 
1109
      case 18:
 
1110
        YYTRACE("match_mode ::= M_EXACT")
 
1111
#line 332 "manip/CMatchParser.lem"
 
1112
{ yygotominor.yy4 = CTreeMatcher::MATCH_EXACT; }
 
1113
#line 1113 "/home/inf4/spinczyk/ac-woven-1.0pre2/Puma/gen-release/step1/src/CMatchParser.cc"
 
1114
        /* No destructor defined for M_EXACT */
 
1115
        break;
 
1116
      case 19:
 
1117
        YYTRACE("match_mode ::= M_FIRST")
 
1118
#line 333 "manip/CMatchParser.lem"
 
1119
{ yygotominor.yy4 = CTreeMatcher::MATCH_FIRST; }
 
1120
#line 1120 "/home/inf4/spinczyk/ac-woven-1.0pre2/Puma/gen-release/step1/src/CMatchParser.cc"
 
1121
        /* No destructor defined for M_FIRST */
 
1122
        break;
 
1123
      case 20:
 
1124
        YYTRACE("match_mode ::= M_LAST")
 
1125
#line 334 "manip/CMatchParser.lem"
 
1126
{ yygotominor.yy4 = CTreeMatcher::MATCH_LAST; }
 
1127
#line 1127 "/home/inf4/spinczyk/ac-woven-1.0pre2/Puma/gen-release/step1/src/CMatchParser.cc"
 
1128
        /* No destructor defined for M_LAST */
 
1129
        break;
 
1130
      case 21:
 
1131
        YYTRACE("match_mode ::= M_LEAF")
 
1132
#line 335 "manip/CMatchParser.lem"
 
1133
{ yygotominor.yy4 = CTreeMatcher::MATCH_LEAF; }
 
1134
#line 1134 "/home/inf4/spinczyk/ac-woven-1.0pre2/Puma/gen-release/step1/src/CMatchParser.cc"
 
1135
        /* No destructor defined for M_LEAF */
 
1136
        break;
 
1137
      case 22:
 
1138
        YYTRACE("match_mode ::= M_PRUNE")
 
1139
#line 336 "manip/CMatchParser.lem"
 
1140
{ yygotominor.yy4 = CTreeMatcher::MATCH_PRUNE; }
 
1141
#line 1141 "/home/inf4/spinczyk/ac-woven-1.0pre2/Puma/gen-release/step1/src/CMatchParser.cc"
 
1142
        /* No destructor defined for M_PRUNE */
 
1143
        break;
 
1144
  };
 
1145
  yygoto = yyRuleInfo[yyruleno].lhs;
 
1146
  yysize = yyRuleInfo[yyruleno].nrhs;
 
1147
  yypParser->idx -= yysize;
 
1148
  yypParser->top -= yysize;
 
1149
  yyact = yy_find_parser_action(yypParser,yygoto);
 
1150
  if( yyact < YYNSTATE ){
 
1151
    yy_shift(yypParser,yyact,yygoto,&yygotominor);
 
1152
  }else if( yyact == YYNSTATE + YYNRULE + 1 ){
 
1153
    yy_accept(yypParser CMatchParserARGDECL);
 
1154
  }
 
1155
}
 
1156
 
 
1157
/*
 
1158
** The following code executes when the parse fails
 
1159
*/
 
1160
static void yy_parse_failed(
 
1161
  yyParser *yypParser           /* The parser */
 
1162
  CMatchParserANSIARGDECL              /* Extra arguments (if any) */
 
1163
){
 
1164
#ifndef NDEBUG
 
1165
  if( yyTraceFILE ){
 
1166
    fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt);
 
1167
  }
 
1168
#endif
 
1169
  while( yypParser->idx>=0 ) yy_pop_parser_stack(yypParser);
 
1170
  /* Here code is inserted which will be executed whenever the
 
1171
  ** parser fails */
 
1172
}
 
1173
 
 
1174
/*
 
1175
** The following code executes when a syntax error first occurs.
 
1176
*/
 
1177
static void yy_syntax_error(
 
1178
  yyParser *yypParser,           /* The parser */
 
1179
  int yymajor,                   /* The major type of the error token */
 
1180
  YYMINORTYPE yyminor            /* The minor type of the error token */
 
1181
  CMatchParserANSIARGDECL               /* Extra arguments (if any) */
 
1182
){
 
1183
#define TOKEN (yyminor.yy0)
 
1184
#line 156 "manip/CMatchParser.lem"
 
1185
 
 
1186
    mstate->value = -1;
 
1187
 
 
1188
#line 1188 "/home/inf4/spinczyk/ac-woven-1.0pre2/Puma/gen-release/step1/src/CMatchParser.cc"
 
1189
}
 
1190
 
 
1191
/*
 
1192
** The following is executed when the parser accepts
 
1193
*/
 
1194
static void yy_accept(
 
1195
  yyParser *yypParser           /* The parser */
 
1196
  CMatchParserANSIARGDECL              /* Extra arguments (if any) */
 
1197
){
 
1198
#ifndef NDEBUG
 
1199
  if( yyTraceFILE ){
 
1200
    fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt);
 
1201
  }
 
1202
#endif
 
1203
  while( yypParser->idx>=0 ) yy_pop_parser_stack(yypParser);
 
1204
  /* Here code is inserted which will be executed whenever the
 
1205
  ** parser accepts */
 
1206
}
 
1207
 
 
1208
/* The main parser program.
 
1209
** The first argument is a pointer to a structure obtained from
 
1210
** "CMatchParserAlloc" which describes the current state of the parser.
 
1211
** The second argument is the major token number.  The third is
 
1212
** the minor token.  The fourth optional argument is whatever the
 
1213
** user wants (and specified in the grammar) and is available for
 
1214
** use by the action routines.
 
1215
**
 
1216
** Inputs:
 
1217
** <ul>
 
1218
** <li> A pointer to the parser (an opaque structure.)
 
1219
** <li> The major token number.
 
1220
** <li> The minor token number.
 
1221
** <li> An option argument of a grammar-specified type.
 
1222
** </ul>
 
1223
**
 
1224
** Outputs:
 
1225
** None.
 
1226
*/
 
1227
void CMatchParser(
 
1228
  void *yyp,                   /* The parser */
 
1229
  int yymajor,                 /* The major token code number */
 
1230
  CMatchParserTOKENTYPE yyminor       /* The value for the token */
 
1231
  CMatchParserANSIARGDECL
 
1232
){
 
1233
  YYMINORTYPE yyminorunion;
 
1234
  int yyact;            /* The parser action. */
 
1235
  int yyendofinput;     /* True if we are at the end of input */
 
1236
  int yyerrorhit = 0;   /* True if yymajor has invoked an error */
 
1237
  yyParser *yypParser;  /* The parser */
 
1238
 
 
1239
  /* (re)initialize the parser, if necessary */
 
1240
  yypParser = (yyParser*)yyp;
 
1241
  if( yypParser->idx<0 ){
 
1242
    /* Olaf: Empty files must be parse too!  if( yymajor==0 ) return; */
 
1243
    yypParser->idx = 0;
 
1244
    yypParser->errcnt = -1;
 
1245
    yypParser->top = &yypParser->stack[0];
 
1246
    yypParser->top->stateno = 0;
 
1247
    yypParser->top->major = 0;
 
1248
  }
 
1249
  yyminorunion.yy0 = yyminor;
 
1250
  yyendofinput = (yymajor==0);
 
1251
 
 
1252
#ifndef NDEBUG
 
1253
  if( yyTraceFILE ){
 
1254
    fprintf(yyTraceFILE,"%sInput %s\n",yyTracePrompt,yyTokenName[yymajor]);
 
1255
  }
 
1256
#endif
 
1257
 
 
1258
  do{
 
1259
    yyact = yy_find_parser_action(yypParser,yymajor);
 
1260
    if( yyact<YYNSTATE ){
 
1261
      yy_shift(yypParser,yyact,yymajor,&yyminorunion);
 
1262
      yypParser->errcnt--;
 
1263
      if( yyendofinput && yypParser->idx>=0 ){
 
1264
        yymajor = 0;
 
1265
      }else{
 
1266
        yymajor = YYNOCODE;
 
1267
      }
 
1268
    }else if( yyact < YYNSTATE + YYNRULE ){
 
1269
      yy_reduce(yypParser,yyact-YYNSTATE CMatchParserARGDECL);
 
1270
    }else if( yyact == YY_ERROR_ACTION ){
 
1271
#ifndef NDEBUG
 
1272
      if( yyTraceFILE ){
 
1273
        fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt);
 
1274
      }
 
1275
#endif
 
1276
#ifdef YYERRORSYMBOL
 
1277
      /* A syntax error has occurred.
 
1278
      ** The response to an error depends upon whether or not the
 
1279
      ** grammar defines an error token "ERROR".  
 
1280
      **
 
1281
      ** This is what we do if the grammar does define ERROR:
 
1282
      **
 
1283
      **  * Call the %syntax_error function.
 
1284
      **
 
1285
      **  * Begin popping the stack until we enter a state where
 
1286
      **    it is legal to shift the error symbol, then shift
 
1287
      **    the error symbol.
 
1288
      **
 
1289
      **  * Set the error count to three.
 
1290
      **
 
1291
      **  * Begin accepting and shifting new tokens.  No new error
 
1292
      **    processing will occur until three tokens have been
 
1293
      **    shifted successfully.
 
1294
      **
 
1295
      */
 
1296
      if( yypParser->errcnt<0 ){
 
1297
        yy_syntax_error(yypParser,yymajor,yyminorunion CMatchParserARGDECL);
 
1298
      }
 
1299
      if( yypParser->top->major==YYERRORSYMBOL || yyerrorhit ){
 
1300
#ifndef NDEBUG
 
1301
        if( yyTraceFILE ){
 
1302
          fprintf(yyTraceFILE,"%sDiscard input token %s\n",
 
1303
             yyTracePrompt,yyTokenName[yymajor]);
 
1304
        }
 
1305
#endif
 
1306
        yy_destructor(yymajor,&yyminorunion);
 
1307
        yymajor = YYNOCODE;
 
1308
      }else{
 
1309
         while(
 
1310
          yypParser->idx >= 0 &&
 
1311
          yypParser->top->major != YYERRORSYMBOL &&
 
1312
          (yyact = yy_find_parser_action(yypParser,YYERRORSYMBOL)) >= YYNSTATE
 
1313
        ){
 
1314
          yy_pop_parser_stack(yypParser);
 
1315
        }
 
1316
        if( yypParser->idx < 0 || yymajor==0 ){
 
1317
          yy_destructor(yymajor,&yyminorunion);
 
1318
          yy_parse_failed(yypParser CMatchParserARGDECL);
 
1319
          yymajor = YYNOCODE;
 
1320
        }else if( yypParser->top->major!=YYERRORSYMBOL ){
 
1321
          YYMINORTYPE u2;
 
1322
          u2.YYERRSYMDT = 0;
 
1323
          yy_shift(yypParser,yyact,YYERRORSYMBOL,&u2);
 
1324
        }
 
1325
      }
 
1326
      yypParser->errcnt = 3;
 
1327
      yyerrorhit = 1;
 
1328
#else  /* YYERRORSYMBOL is not defined */
 
1329
      /* This is what we do if the grammar does not define ERROR:
 
1330
      **
 
1331
      **  * Report an error message, and throw away the input token.
 
1332
      **
 
1333
      **  * If the input token is $, then fail the parse.
 
1334
      **
 
1335
      ** As before, subsequent error messages are suppressed until
 
1336
      ** three input tokens have been successfully shifted.
 
1337
      */
 
1338
      if( yypParser->errcnt<=0 ){
 
1339
        yy_syntax_error(yypParser,yymajor,yyminorunion CMatchParserARGDECL);
 
1340
      }
 
1341
      yypParser->errcnt = 3;
 
1342
      yy_destructor(yymajor,&yyminorunion);
 
1343
      if( yyendofinput ){
 
1344
        yy_parse_failed(yypParser CMatchParserARGDECL);
 
1345
      }
 
1346
      yymajor = YYNOCODE;
 
1347
#endif
 
1348
    }else{
 
1349
      yy_accept(yypParser CMatchParserARGDECL);
 
1350
      yymajor = YYNOCODE;
 
1351
    }
 
1352
  }while( yymajor!=YYNOCODE && yypParser->idx>=0 );
 
1353
  return;
 
1354
}