lib/bb/fetch/git.py: always use english here
[vuplus_bitbake] / lib / bb / parse / parse_c / bitbakeparser.cc
1 /* Driver template for the LEMON parser generator.
2 ** The author disclaims copyright to this source code.
3 */
4 /* First off, code is include which follows the "include" declaration
5 ** in the input file. */
6 #include <stdio.h>
7 #line 43 "bitbakeparser.y"
8
9 #include "token.h"
10 #include "lexer.h"
11 #include "python_output.h"
12 #line 14 "bitbakeparser.c"
13 /* Next is all token values, in a form suitable for use by makeheaders.
14 ** This section will be null unless lemon is run with the -m switch.
15 */
16 /* 
17 ** These constants (all generated automatically by the parser generator)
18 ** specify the various kinds of tokens (terminals) that the parser
19 ** understands. 
20 **
21 ** Each symbol here is a terminal symbol in the grammar.
22 */
23 /* Make sure the INTERFACE macro is defined.
24 */
25 #ifndef INTERFACE
26 # define INTERFACE 1
27 #endif
28 /* The next thing included is series of defines which control
29 ** various aspects of the generated parser.
30 **    YYCODETYPE         is the data type used for storing terminal
31 **                       and nonterminal numbers.  "unsigned char" is
32 **                       used if there are fewer than 250 terminals
33 **                       and nonterminals.  "int" is used otherwise.
34 **    YYNOCODE           is a number of type YYCODETYPE which corresponds
35 **                       to no legal terminal or nonterminal number.  This
36 **                       number is used to fill in empty slots of the hash 
37 **                       table.
38 **    YYFALLBACK         If defined, this indicates that one or more tokens
39 **                       have fall-back values which should be used if the
40 **                       original value of the token will not parse.
41 **    YYACTIONTYPE       is the data type used for storing terminal
42 **                       and nonterminal numbers.  "unsigned char" is
43 **                       used if there are fewer than 250 rules and
44 **                       states combined.  "int" is used otherwise.
45 **    bbparseTOKENTYPE     is the data type used for minor tokens given 
46 **                       directly to the parser from the tokenizer.
47 **    YYMINORTYPE        is the data type used for all minor tokens.
48 **                       This is typically a union of many types, one of
49 **                       which is bbparseTOKENTYPE.  The entry in the union
50 **                       for base tokens is called "yy0".
51 **    YYSTACKDEPTH       is the maximum depth of the parser's stack.
52 **    bbparseARG_SDECL     A static variable declaration for the %extra_argument
53 **    bbparseARG_PDECL     A parameter declaration for the %extra_argument
54 **    bbparseARG_STORE     Code to store %extra_argument into yypParser
55 **    bbparseARG_FETCH     Code to extract %extra_argument from yypParser
56 **    YYNSTATE           the combined number of states.
57 **    YYNRULE            the number of rules in the grammar
58 **    YYERRORSYMBOL      is the code number of the error symbol.  If not
59 **                       defined, then do no error processing.
60 */
61 #define YYCODETYPE unsigned char
62 #define YYNOCODE 44
63 #define YYACTIONTYPE unsigned char
64 #define bbparseTOKENTYPE token_t
65 typedef union {
66   bbparseTOKENTYPE yy0;
67   int yy87;
68 } YYMINORTYPE;
69 #define YYSTACKDEPTH 100
70 #define bbparseARG_SDECL lex_t* lex;
71 #define bbparseARG_PDECL ,lex_t* lex
72 #define bbparseARG_FETCH lex_t* lex = yypParser->lex
73 #define bbparseARG_STORE yypParser->lex = lex
74 #define YYNSTATE 82
75 #define YYNRULE 45
76 #define YYERRORSYMBOL 30
77 #define YYERRSYMDT yy87
78 #define YY_NO_ACTION      (YYNSTATE+YYNRULE+2)
79 #define YY_ACCEPT_ACTION  (YYNSTATE+YYNRULE+1)
80 #define YY_ERROR_ACTION   (YYNSTATE+YYNRULE)
81
82 /* Next are that tables used to determine what action to take based on the
83 ** current state and lookahead token.  These tables are used to implement
84 ** functions that take a state number and lookahead value and return an
85 ** action integer.  
86 **
87 ** Suppose the action integer is N.  Then the action is determined as
88 ** follows
89 **
90 **   0 <= N < YYNSTATE                  Shift N.  That is, push the lookahead
91 **                                      token onto the stack and goto state N.
92 **
93 **   YYNSTATE <= N < YYNSTATE+YYNRULE   Reduce by rule N-YYNSTATE.
94 **
95 **   N == YYNSTATE+YYNRULE              A syntax error has occurred.
96 **
97 **   N == YYNSTATE+YYNRULE+1            The parser accepts its input.
98 **
99 **   N == YYNSTATE+YYNRULE+2            No such action.  Denotes unused
100 **                                      slots in the yy_action[] table.
101 **
102 ** The action table is constructed as a single large table named yy_action[].
103 ** Given state S and lookahead X, the action is computed as
104 **
105 **      yy_action[ yy_shift_ofst[S] + X ]
106 **
107 ** If the index value yy_shift_ofst[S]+X is out of range or if the value
108 ** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X or if yy_shift_ofst[S]
109 ** is equal to YY_SHIFT_USE_DFLT, it means that the action is not in the table
110 ** and that yy_default[S] should be used instead.  
111 **
112 ** The formula above is for computing the action when the lookahead is
113 ** a terminal symbol.  If the lookahead is a non-terminal (as occurs after
114 ** a reduce action) then the yy_reduce_ofst[] array is used in place of
115 ** the yy_shift_ofst[] array and YY_REDUCE_USE_DFLT is used in place of
116 ** YY_SHIFT_USE_DFLT.
117 **
118 ** The following are the tables generated in this section:
119 **
120 **  yy_action[]        A single table containing all actions.
121 **  yy_lookahead[]     A table containing the lookahead for each entry in
122 **                     yy_action.  Used to detect hash collisions.
123 **  yy_shift_ofst[]    For each state, the offset into yy_action for
124 **                     shifting terminals.
125 **  yy_reduce_ofst[]   For each state, the offset into yy_action for
126 **                     shifting non-terminals after a reduce.
127 **  yy_default[]       Default action for each state.
128 */
129 static const YYACTIONTYPE yy_action[] = {
130  /*     0 */    82,    3,    7,    8,   38,   22,   39,   24,   26,   32,
131  /*    10 */    34,   28,   30,  128,    1,   40,   53,   70,   55,    5,
132  /*    20 */    60,   65,   67,    2,   21,   36,   69,   77,    9,    7,
133  /*    30 */    11,    6,   13,   15,   17,   19,   12,   52,   50,    4,
134  /*    40 */    74,   42,   46,   59,   57,   10,   64,   62,   38,   14,
135  /*    50 */    73,   16,   38,   38,   76,   81,   18,   20,   23,   25,
136  /*    60 */    27,   29,   31,   33,   35,   37,   56,   51,   90,   54,
137  /*    70 */    58,   71,   41,   43,   63,   45,   44,   47,   72,   48,
138  /*    80 */    75,   78,   80,   61,   90,   49,   66,   90,   90,   68,
139  /*    90 */    90,   90,   90,   90,   90,   79,
140 };
141 static const YYCODETYPE yy_lookahead[] = {
142  /*     0 */     0,    1,    2,    3,   23,    4,   25,    6,    7,    8,
143  /*    10 */     9,   10,   11,   31,   32,   15,   16,    1,   18,   42,
144  /*    20 */    20,   21,   22,   33,   34,   24,   26,   27,    1,    2,
145  /*    30 */     4,   28,    6,    7,    8,    9,    5,   35,   36,   29,
146  /*    40 */    24,   13,   14,   37,   38,   34,   39,   40,   23,    5,
147  /*    50 */    25,    5,   23,   23,   25,   25,    5,    5,    5,    5,
148  /*    60 */     5,    5,    5,    5,    5,   41,   17,   35,   43,    1,
149  /*    70 */    37,   24,   12,   12,   39,   12,   14,   12,   41,   13,
150  /*    80 */    41,    1,   41,   19,   43,   12,   19,   43,   43,   19,
151  /*    90 */    43,   43,   43,   43,   43,   24,
152 };
153 #define YY_SHIFT_USE_DFLT (-20)
154 static const signed char yy_shift_ofst[] = {
155  /*     0 */   -20,    0,  -20,   10,  -20,    3,  -20,  -20,   27,  -20,
156  /*    10 */    26,   31,  -20,   44,  -20,   46,  -20,   51,  -20,   52,
157  /*    20 */   -20,    1,   53,  -20,   54,  -20,   55,  -20,   56,  -20,
158  /*    30 */    57,  -20,   58,  -20,   59,  -20,  -20,  -19,  -20,  -20,
159  /*    40 */    60,   28,   61,   62,   63,  -20,   65,   66,   73,  -20,
160  /*    50 */    60,  -20,  -20,   68,  -20,   49,  -20,   49,  -20,  -20,
161  /*    60 */    64,  -20,   64,  -20,  -20,   67,  -20,   70,  -20,   16,
162  /*    70 */    47,  -20,   25,  -20,  -20,   29,  -20,   80,   71,  -20,
163  /*    80 */    30,  -20,
164 };
165 #define YY_REDUCE_USE_DFLT (-24)
166 static const signed char yy_reduce_ofst[] = {
167  /*     0 */   -18,  -10,  -24,  -24,  -23,  -24,  -24,  -24,   11,  -24,
168  /*    10 */   -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,
169  /*    20 */   -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,
170  /*    30 */   -24,  -24,  -24,  -24,  -24,  -24,   24,  -24,  -24,  -24,
171  /*    40 */     2,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,  -24,
172  /*    50 */    32,  -24,  -24,  -24,  -24,    6,  -24,   33,  -24,  -24,
173  /*    60 */     7,  -24,   35,  -24,  -24,  -24,  -24,  -24,  -24,  -24,
174  /*    70 */   -24,   37,  -24,  -24,   39,  -24,  -24,  -24,  -24,   41,
175  /*    80 */   -24,  -24,
176 };
177 static const YYACTIONTYPE yy_default[] = {
178  /*     0 */    84,  127,   83,   85,  125,  126,  124,   86,  127,   85,
179  /*    10 */   127,  127,   87,  127,   88,  127,   89,  127,   90,  127,
180  /*    20 */    91,  127,  127,   92,  127,   93,  127,   94,  127,   95,
181  /*    30 */   127,   96,  127,   97,  127,   98,  119,  127,  118,  120,
182  /*    40 */   127,  101,  127,  102,  127,   99,  127,  103,  127,  100,
183  /*    50 */   106,  104,  105,  127,  107,  127,  108,  111,  109,  110,
184  /*    60 */   127,  112,  115,  113,  114,  127,  116,  127,  117,  127,
185  /*    70 */   127,  119,  127,  121,  119,  127,  122,  127,  127,  119,
186  /*    80 */   127,  123,
187 };
188 #define YY_SZ_ACTTAB (sizeof(yy_action)/sizeof(yy_action[0]))
189
190 /* The next table maps tokens into fallback tokens.  If a construct
191 ** like the following:
192 ** 
193 **      %fallback ID X Y Z.
194 **
195 ** appears in the grammer, then ID becomes a fallback token for X, Y,
196 ** and Z.  Whenever one of the tokens X, Y, or Z is input to the parser
197 ** but it does not parse, the type of the token is changed to ID and
198 ** the parse is retried before an error is thrown.
199 */
200 #ifdef YYFALLBACK
201 static const YYCODETYPE yyFallback[] = {
202 };
203 #endif /* YYFALLBACK */
204
205 /* The following structure represents a single element of the
206 ** parser's stack.  Information stored includes:
207 **
208 **   +  The state number for the parser at this level of the stack.
209 **
210 **   +  The value of the token stored at this level of the stack.
211 **      (In other words, the "major" token.)
212 **
213 **   +  The semantic value stored at this level of the stack.  This is
214 **      the information used by the action routines in the grammar.
215 **      It is sometimes called the "minor" token.
216 */
217 struct yyStackEntry {
218   int stateno;       /* The state-number */
219   int major;         /* The major token value.  This is the code
220                      ** number for the token at this stack level */
221   YYMINORTYPE minor; /* The user-supplied minor token value.  This
222                      ** is the value of the token  */
223 };
224 typedef struct yyStackEntry yyStackEntry;
225
226 /* The state of the parser is completely contained in an instance of
227 ** the following structure */
228 struct yyParser {
229   int yyidx;                    /* Index of top element in stack */
230   int yyerrcnt;                 /* Shifts left before out of the error */
231   bbparseARG_SDECL                /* A place to hold %extra_argument */
232   yyStackEntry yystack[YYSTACKDEPTH];  /* The parser's stack */
233 };
234 typedef struct yyParser yyParser;
235
236 #ifndef NDEBUG
237 #include <stdio.h>
238 static FILE *yyTraceFILE = 0;
239 static char *yyTracePrompt = 0;
240 #endif /* NDEBUG */
241
242 #ifndef NDEBUG
243 /* 
244 ** Turn parser tracing on by giving a stream to which to write the trace
245 ** and a prompt to preface each trace message.  Tracing is turned off
246 ** by making either argument NULL 
247 **
248 ** Inputs:
249 ** <ul>
250 ** <li> A FILE* to which trace output should be written.
251 **      If NULL, then tracing is turned off.
252 ** <li> A prefix string written at the beginning of every
253 **      line of trace output.  If NULL, then tracing is
254 **      turned off.
255 ** </ul>
256 **
257 ** Outputs:
258 ** None.
259 */
260 void bbparseTrace(FILE *TraceFILE, char *zTracePrompt){
261   yyTraceFILE = TraceFILE;
262   yyTracePrompt = zTracePrompt;
263   if( yyTraceFILE==0 ) yyTracePrompt = 0;
264   else if( yyTracePrompt==0 ) yyTraceFILE = 0;
265 }
266 #endif /* NDEBUG */
267
268 #ifndef NDEBUG
269 /* For tracing shifts, the names of all terminals and nonterminals
270 ** are required.  The following table supplies these names */
271 static const char *const yyTokenName[] = { 
272   "$",             "SYMBOL",        "VARIABLE",      "EXPORT",      
273   "OP_ASSIGN",     "STRING",        "OP_PREDOT",     "OP_POSTDOT",  
274   "OP_IMMEDIATE",  "OP_COND",       "OP_PREPEND",    "OP_APPEND",   
275   "TSYMBOL",       "BEFORE",        "AFTER",         "ADDTASK",     
276   "ADDHANDLER",    "FSYMBOL",       "EXPORT_FUNC",   "ISYMBOL",     
277   "INHERIT",       "INCLUDE",       "REQUIRE",       "PROC_BODY",   
278   "PROC_OPEN",     "PROC_CLOSE",    "PYTHON",        "FAKEROOT",    
279   "DEF_BODY",      "DEF_ARGS",      "error",         "program",     
280   "statements",    "statement",     "variable",      "task",        
281   "tasks",         "func",          "funcs",         "inherit",     
282   "inherits",      "proc_body",     "def_body",    
283 };
284 #endif /* NDEBUG */
285
286 #ifndef NDEBUG
287 /* For tracing reduce actions, the names of all rules are required.
288 */
289 static const char *const yyRuleName[] = {
290  /*   0 */ "program ::= statements",
291  /*   1 */ "statements ::= statements statement",
292  /*   2 */ "statements ::=",
293  /*   3 */ "variable ::= SYMBOL",
294  /*   4 */ "variable ::= VARIABLE",
295  /*   5 */ "statement ::= EXPORT variable OP_ASSIGN STRING",
296  /*   6 */ "statement ::= EXPORT variable OP_PREDOT STRING",
297  /*   7 */ "statement ::= EXPORT variable OP_POSTDOT STRING",
298  /*   8 */ "statement ::= EXPORT variable OP_IMMEDIATE STRING",
299  /*   9 */ "statement ::= EXPORT variable OP_COND STRING",
300  /*  10 */ "statement ::= variable OP_ASSIGN STRING",
301  /*  11 */ "statement ::= variable OP_PREDOT STRING",
302  /*  12 */ "statement ::= variable OP_POSTDOT STRING",
303  /*  13 */ "statement ::= variable OP_PREPEND STRING",
304  /*  14 */ "statement ::= variable OP_APPEND STRING",
305  /*  15 */ "statement ::= variable OP_IMMEDIATE STRING",
306  /*  16 */ "statement ::= variable OP_COND STRING",
307  /*  17 */ "task ::= TSYMBOL BEFORE TSYMBOL AFTER TSYMBOL",
308  /*  18 */ "task ::= TSYMBOL AFTER TSYMBOL BEFORE TSYMBOL",
309  /*  19 */ "task ::= TSYMBOL",
310  /*  20 */ "task ::= TSYMBOL BEFORE TSYMBOL",
311  /*  21 */ "task ::= TSYMBOL AFTER TSYMBOL",
312  /*  22 */ "tasks ::= tasks task",
313  /*  23 */ "tasks ::= task",
314  /*  24 */ "statement ::= ADDTASK tasks",
315  /*  25 */ "statement ::= ADDHANDLER SYMBOL",
316  /*  26 */ "func ::= FSYMBOL",
317  /*  27 */ "funcs ::= funcs func",
318  /*  28 */ "funcs ::= func",
319  /*  29 */ "statement ::= EXPORT_FUNC funcs",
320  /*  30 */ "inherit ::= ISYMBOL",
321  /*  31 */ "inherits ::= inherits inherit",
322  /*  32 */ "inherits ::= inherit",
323  /*  33 */ "statement ::= INHERIT inherits",
324  /*  34 */ "statement ::= INCLUDE ISYMBOL",
325  /*  35 */ "statement ::= REQUIRE ISYMBOL",
326  /*  36 */ "proc_body ::= proc_body PROC_BODY",
327  /*  37 */ "proc_body ::=",
328  /*  38 */ "statement ::= variable PROC_OPEN proc_body PROC_CLOSE",
329  /*  39 */ "statement ::= PYTHON SYMBOL PROC_OPEN proc_body PROC_CLOSE",
330  /*  40 */ "statement ::= PYTHON PROC_OPEN proc_body PROC_CLOSE",
331  /*  41 */ "statement ::= FAKEROOT SYMBOL PROC_OPEN proc_body PROC_CLOSE",
332  /*  42 */ "def_body ::= def_body DEF_BODY",
333  /*  43 */ "def_body ::=",
334  /*  44 */ "statement ::= SYMBOL DEF_ARGS def_body",
335 };
336 #endif /* NDEBUG */
337
338 /*
339 ** This function returns the symbolic name associated with a token
340 ** value.
341 */
342 const char *bbparseTokenName(int tokenType){
343 #ifndef NDEBUG
344   if( tokenType>0 && tokenType<(sizeof(yyTokenName)/sizeof(yyTokenName[0])) ){
345     return yyTokenName[tokenType];
346   }else{
347     return "Unknown";
348   }
349 #else
350   return "";
351 #endif
352 }
353
354 /* 
355 ** This function allocates a new parser.
356 ** The only argument is a pointer to a function which works like
357 ** malloc.
358 **
359 ** Inputs:
360 ** A pointer to the function used to allocate memory.
361 **
362 ** Outputs:
363 ** A pointer to a parser.  This pointer is used in subsequent calls
364 ** to bbparse and bbparseFree.
365 */
366 void *bbparseAlloc(void *(*mallocProc)(size_t)){
367   yyParser *pParser;
368   pParser = (yyParser*)(*mallocProc)( (size_t)sizeof(yyParser) );
369   if( pParser ){
370     pParser->yyidx = -1;
371   }
372   return pParser;
373 }
374
375 /* The following function deletes the value associated with a
376 ** symbol.  The symbol can be either a terminal or nonterminal.
377 ** "yymajor" is the symbol code, and "yypminor" is a pointer to
378 ** the value.
379 */
380 static void yy_destructor(YYCODETYPE yymajor, YYMINORTYPE *yypminor){
381   switch( yymajor ){
382     /* Here is inserted the actions which take place when a
383     ** terminal or non-terminal is destroyed.  This can happen
384     ** when the symbol is popped from the stack during a
385     ** reduce or during error processing or when a parser is 
386     ** being destroyed before it is finished parsing.
387     **
388     ** Note: during a reduce, the only symbols destroyed are those
389     ** which appear on the RHS of the rule, but which are not used
390     ** inside the C code.
391     */
392     case 1:
393     case 2:
394     case 3:
395     case 4:
396     case 5:
397     case 6:
398     case 7:
399     case 8:
400     case 9:
401     case 10:
402     case 11:
403     case 12:
404     case 13:
405     case 14:
406     case 15:
407     case 16:
408     case 17:
409     case 18:
410     case 19:
411     case 20:
412     case 21:
413     case 22:
414     case 23:
415     case 24:
416     case 25:
417     case 26:
418     case 27:
419     case 28:
420     case 29:
421 #line 50 "bitbakeparser.y"
422 { (yypminor->yy0).release_this (); }
423 #line 425 "bitbakeparser.c"
424       break;
425     default:  break;   /* If no destructor action specified: do nothing */
426   }
427 }
428
429 /*
430 ** Pop the parser's stack once.
431 **
432 ** If there is a destructor routine associated with the token which
433 ** is popped from the stack, then call it.
434 **
435 ** Return the major token number for the symbol popped.
436 */
437 static int yy_pop_parser_stack(yyParser *pParser){
438   YYCODETYPE yymajor;
439   yyStackEntry *yytos = &pParser->yystack[pParser->yyidx];
440
441   if( pParser->yyidx<0 ) return 0;
442 #ifndef NDEBUG
443   if( yyTraceFILE && pParser->yyidx>=0 ){
444     fprintf(yyTraceFILE,"%sPopping %s\n",
445       yyTracePrompt,
446       yyTokenName[yytos->major]);
447   }
448 #endif
449   yymajor = yytos->major;
450   yy_destructor( yymajor, &yytos->minor);
451   pParser->yyidx--;
452   return yymajor;
453 }
454
455 /* 
456 ** Deallocate and destroy a parser.  Destructors are all called for
457 ** all stack elements before shutting the parser down.
458 **
459 ** Inputs:
460 ** <ul>
461 ** <li>  A pointer to the parser.  This should be a pointer
462 **       obtained from bbparseAlloc.
463 ** <li>  A pointer to a function used to reclaim memory obtained
464 **       from malloc.
465 ** </ul>
466 */
467 void bbparseFree(
468   void *p,                    /* The parser to be deleted */
469   void (*freeProc)(void*)     /* Function used to reclaim memory */
470 ){
471   yyParser *pParser = (yyParser*)p;
472   if( pParser==0 ) return;
473   while( pParser->yyidx>=0 ) yy_pop_parser_stack(pParser);
474   (*freeProc)((void*)pParser);
475 }
476
477 /*
478 ** Find the appropriate action for a parser given the terminal
479 ** look-ahead token iLookAhead.
480 **
481 ** If the look-ahead token is YYNOCODE, then check to see if the action is
482 ** independent of the look-ahead.  If it is, return the action, otherwise
483 ** return YY_NO_ACTION.
484 */
485 static int yy_find_shift_action(
486   yyParser *pParser,        /* The parser */
487   int iLookAhead            /* The look-ahead token */
488 ){
489   int i;
490   int stateno = pParser->yystack[pParser->yyidx].stateno;
491  
492   /* if( pParser->yyidx<0 ) return YY_NO_ACTION;  */
493   i = yy_shift_ofst[stateno];
494   if( i==YY_SHIFT_USE_DFLT ){
495     return yy_default[stateno];
496   }
497   if( iLookAhead==YYNOCODE ){
498     return YY_NO_ACTION;
499   }
500   i += iLookAhead;
501   if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
502 #ifdef YYFALLBACK
503     int iFallback;            /* Fallback token */
504     if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])
505            && (iFallback = yyFallback[iLookAhead])!=0 ){
506 #ifndef NDEBUG
507       if( yyTraceFILE ){
508         fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",
509            yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]);
510       }
511 #endif
512       return yy_find_shift_action(pParser, iFallback);
513     }
514 #endif
515     return yy_default[stateno];
516   }else{
517     return yy_action[i];
518   }
519 }
520
521 /*
522 ** Find the appropriate action for a parser given the non-terminal
523 ** look-ahead token iLookAhead.
524 **
525 ** If the look-ahead token is YYNOCODE, then check to see if the action is
526 ** independent of the look-ahead.  If it is, return the action, otherwise
527 ** return YY_NO_ACTION.
528 */
529 static int yy_find_reduce_action(
530   int stateno,              /* Current state number */
531   int iLookAhead            /* The look-ahead token */
532 ){
533   int i;
534   /* int stateno = pParser->yystack[pParser->yyidx].stateno; */
535  
536   i = yy_reduce_ofst[stateno];
537   if( i==YY_REDUCE_USE_DFLT ){
538     return yy_default[stateno];
539   }
540   if( iLookAhead==YYNOCODE ){
541     return YY_NO_ACTION;
542   }
543   i += iLookAhead;
544   if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){
545     return yy_default[stateno];
546   }else{
547     return yy_action[i];
548   }
549 }
550
551 /*
552 ** Perform a shift action.
553 */
554 static void yy_shift(
555   yyParser *yypParser,          /* The parser to be shifted */
556   int yyNewState,               /* The new state to shift in */
557   int yyMajor,                  /* The major token to shift in */
558   YYMINORTYPE *yypMinor         /* Pointer ot the minor token to shift in */
559 ){
560   yyStackEntry *yytos;
561   yypParser->yyidx++;
562   if( yypParser->yyidx>=YYSTACKDEPTH ){
563      bbparseARG_FETCH;
564      yypParser->yyidx--;
565 #ifndef NDEBUG
566      if( yyTraceFILE ){
567        fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt);
568      }
569 #endif
570      while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
571      /* Here code is inserted which will execute if the parser
572      ** stack every overflows */
573      bbparseARG_STORE; /* Suppress warning about unused %extra_argument var */
574      return;
575   }
576   yytos = &yypParser->yystack[yypParser->yyidx];
577   yytos->stateno = yyNewState;
578   yytos->major = yyMajor;
579   yytos->minor = *yypMinor;
580 #ifndef NDEBUG
581   if( yyTraceFILE && yypParser->yyidx>0 ){
582     int i;
583     fprintf(yyTraceFILE,"%sShift %d\n",yyTracePrompt,yyNewState);
584     fprintf(yyTraceFILE,"%sStack:",yyTracePrompt);
585     for(i=1; i<=yypParser->yyidx; i++)
586       fprintf(yyTraceFILE," %s",yyTokenName[yypParser->yystack[i].major]);
587     fprintf(yyTraceFILE,"\n");
588   }
589 #endif
590 }
591
592 /* The following table contains information about every rule that
593 ** is used during the reduce.
594 */
595 static const struct {
596   YYCODETYPE lhs;         /* Symbol on the left-hand side of the rule */
597   unsigned char nrhs;     /* Number of right-hand side symbols in the rule */
598 } yyRuleInfo[] = {
599   { 31, 1 },
600   { 32, 2 },
601   { 32, 0 },
602   { 34, 1 },
603   { 34, 1 },
604   { 33, 4 },
605   { 33, 4 },
606   { 33, 4 },
607   { 33, 4 },
608   { 33, 4 },
609   { 33, 3 },
610   { 33, 3 },
611   { 33, 3 },
612   { 33, 3 },
613   { 33, 3 },
614   { 33, 3 },
615   { 33, 3 },
616   { 35, 5 },
617   { 35, 5 },
618   { 35, 1 },
619   { 35, 3 },
620   { 35, 3 },
621   { 36, 2 },
622   { 36, 1 },
623   { 33, 2 },
624   { 33, 2 },
625   { 37, 1 },
626   { 38, 2 },
627   { 38, 1 },
628   { 33, 2 },
629   { 39, 1 },
630   { 40, 2 },
631   { 40, 1 },
632   { 33, 2 },
633   { 33, 2 },
634   { 33, 2 },
635   { 41, 2 },
636   { 41, 0 },
637   { 33, 4 },
638   { 33, 5 },
639   { 33, 4 },
640   { 33, 5 },
641   { 42, 2 },
642   { 42, 0 },
643   { 33, 3 },
644 };
645
646 static void yy_accept(yyParser*);  /* Forward Declaration */
647
648 /*
649 ** Perform a reduce action and the shift that must immediately
650 ** follow the reduce.
651 */
652 static void yy_reduce(
653   yyParser *yypParser,         /* The parser */
654   int yyruleno                 /* Number of the rule by which to reduce */
655 ){
656   int yygoto;                     /* The next state */
657   int yyact;                      /* The next action */
658   YYMINORTYPE yygotominor;        /* The LHS of the rule reduced */
659   yyStackEntry *yymsp;            /* The top of the parser's stack */
660   int yysize;                     /* Amount to pop the stack */
661   bbparseARG_FETCH;
662   yymsp = &yypParser->yystack[yypParser->yyidx];
663 #ifndef NDEBUG
664   if( yyTraceFILE && yyruleno>=0 
665         && yyruleno<sizeof(yyRuleName)/sizeof(yyRuleName[0]) ){
666     fprintf(yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt,
667       yyRuleName[yyruleno]);
668   }
669 #endif /* NDEBUG */
670
671 #ifndef NDEBUG
672   /* Silence complaints from purify about yygotominor being uninitialized
673   ** in some cases when it is copied into the stack after the following
674   ** switch.  yygotominor is uninitialized when a rule reduces that does
675   ** not set the value of its left-hand side nonterminal.  Leaving the
676   ** value of the nonterminal uninitialized is utterly harmless as long
677   ** as the value is never used.  So really the only thing this code
678   ** accomplishes is to quieten purify.  
679   */
680   memset(&yygotominor, 0, sizeof(yygotominor));
681 #endif
682
683   switch( yyruleno ){
684   /* Beginning here are the reduction cases.  A typical example
685   ** follows:
686   **   case 0:
687   **  #line <lineno> <grammarfile>
688   **     { ... }           // User supplied code
689   **  #line <lineno> <thisfile>
690   **     break;
691   */
692       case 3:
693 #line 60 "bitbakeparser.y"
694 { yygotominor.yy0.assignString( (char*)yymsp[0].minor.yy0.string() );
695           yymsp[0].minor.yy0.assignString( 0 );
696           yymsp[0].minor.yy0.release_this(); }
697 #line 699 "bitbakeparser.c"
698         break;
699       case 4:
700 #line 64 "bitbakeparser.y"
701 {
702           yygotominor.yy0.assignString( (char*)yymsp[0].minor.yy0.string() );
703           yymsp[0].minor.yy0.assignString( 0 );
704           yymsp[0].minor.yy0.release_this(); }
705 #line 707 "bitbakeparser.c"
706         break;
707       case 5:
708 #line 70 "bitbakeparser.y"
709 { e_assign( lex, yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string() );
710           e_export( lex, yymsp[-2].minor.yy0.string() );
711           yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this();   yy_destructor(3,&yymsp[-3].minor);
712   yy_destructor(4,&yymsp[-1].minor);
713 }
714 #line 716 "bitbakeparser.c"
715         break;
716       case 6:
717 #line 74 "bitbakeparser.y"
718 { e_precat( lex, yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string() );
719           e_export( lex, yymsp[-2].minor.yy0.string() );
720           yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this();   yy_destructor(3,&yymsp[-3].minor);
721   yy_destructor(6,&yymsp[-1].minor);
722 }
723 #line 725 "bitbakeparser.c"
724         break;
725       case 7:
726 #line 78 "bitbakeparser.y"
727 { e_postcat( lex, yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string() );
728           e_export( lex, yymsp[-2].minor.yy0.string() );
729           yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this();   yy_destructor(3,&yymsp[-3].minor);
730   yy_destructor(7,&yymsp[-1].minor);
731 }
732 #line 734 "bitbakeparser.c"
733         break;
734       case 8:
735 #line 82 "bitbakeparser.y"
736 { e_immediate ( lex, yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string() );
737           e_export( lex, yymsp[-2].minor.yy0.string() );
738           yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this();   yy_destructor(3,&yymsp[-3].minor);
739   yy_destructor(8,&yymsp[-1].minor);
740 }
741 #line 743 "bitbakeparser.c"
742         break;
743       case 9:
744 #line 86 "bitbakeparser.y"
745 { e_cond( lex, yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string() );
746           yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this();   yy_destructor(3,&yymsp[-3].minor);
747   yy_destructor(9,&yymsp[-1].minor);
748 }
749 #line 751 "bitbakeparser.c"
750         break;
751       case 10:
752 #line 90 "bitbakeparser.y"
753 { e_assign( lex, yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string() );
754           yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this();   yy_destructor(4,&yymsp[-1].minor);
755 }
756 #line 758 "bitbakeparser.c"
757         break;
758       case 11:
759 #line 93 "bitbakeparser.y"
760 { e_precat( lex, yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string() );
761           yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this();   yy_destructor(6,&yymsp[-1].minor);
762 }
763 #line 765 "bitbakeparser.c"
764         break;
765       case 12:
766 #line 96 "bitbakeparser.y"
767 { e_postcat( lex, yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string() );
768           yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this();   yy_destructor(7,&yymsp[-1].minor);
769 }
770 #line 772 "bitbakeparser.c"
771         break;
772       case 13:
773 #line 99 "bitbakeparser.y"
774 { e_prepend( lex, yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string() );
775           yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this();   yy_destructor(10,&yymsp[-1].minor);
776 }
777 #line 779 "bitbakeparser.c"
778         break;
779       case 14:
780 #line 102 "bitbakeparser.y"
781 { e_append( lex, yymsp[-2].minor.yy0.string() , yymsp[0].minor.yy0.string() );
782           yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this();   yy_destructor(11,&yymsp[-1].minor);
783 }
784 #line 786 "bitbakeparser.c"
785         break;
786       case 15:
787 #line 105 "bitbakeparser.y"
788 { e_immediate( lex, yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string() );
789           yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this();   yy_destructor(8,&yymsp[-1].minor);
790 }
791 #line 793 "bitbakeparser.c"
792         break;
793       case 16:
794 #line 108 "bitbakeparser.y"
795 { e_cond( lex, yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string() );
796           yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this();   yy_destructor(9,&yymsp[-1].minor);
797 }
798 #line 800 "bitbakeparser.c"
799         break;
800       case 17:
801 #line 112 "bitbakeparser.y"
802 { e_addtask( lex, yymsp[-4].minor.yy0.string(), yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string() );
803           yymsp[-4].minor.yy0.release_this(); yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this();   yy_destructor(13,&yymsp[-3].minor);
804   yy_destructor(14,&yymsp[-1].minor);
805 }
806 #line 808 "bitbakeparser.c"
807         break;
808       case 18:
809 #line 115 "bitbakeparser.y"
810 { e_addtask( lex, yymsp[-4].minor.yy0.string(), yymsp[0].minor.yy0.string(), yymsp[-2].minor.yy0.string());
811           yymsp[-4].minor.yy0.release_this(); yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this();   yy_destructor(14,&yymsp[-3].minor);
812   yy_destructor(13,&yymsp[-1].minor);
813 }
814 #line 816 "bitbakeparser.c"
815         break;
816       case 19:
817 #line 118 "bitbakeparser.y"
818 { e_addtask( lex, yymsp[0].minor.yy0.string(), NULL, NULL);
819           yymsp[0].minor.yy0.release_this();}
820 #line 822 "bitbakeparser.c"
821         break;
822       case 20:
823 #line 121 "bitbakeparser.y"
824 { e_addtask( lex, yymsp[-2].minor.yy0.string(), yymsp[0].minor.yy0.string(), NULL);
825           yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this();   yy_destructor(13,&yymsp[-1].minor);
826 }
827 #line 829 "bitbakeparser.c"
828         break;
829       case 21:
830 #line 124 "bitbakeparser.y"
831 { e_addtask( lex, yymsp[-2].minor.yy0.string(), NULL, yymsp[0].minor.yy0.string());
832           yymsp[-2].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this();   yy_destructor(14,&yymsp[-1].minor);
833 }
834 #line 836 "bitbakeparser.c"
835         break;
836       case 25:
837 #line 131 "bitbakeparser.y"
838 { e_addhandler( lex, yymsp[0].minor.yy0.string()); yymsp[0].minor.yy0.release_this ();   yy_destructor(16,&yymsp[-1].minor);
839 }
840 #line 842 "bitbakeparser.c"
841         break;
842       case 26:
843 #line 133 "bitbakeparser.y"
844 { e_export_func( lex, yymsp[0].minor.yy0.string()); yymsp[0].minor.yy0.release_this(); }
845 #line 847 "bitbakeparser.c"
846         break;
847       case 30:
848 #line 138 "bitbakeparser.y"
849 { e_inherit( lex, yymsp[0].minor.yy0.string() ); yymsp[0].minor.yy0.release_this (); }
850 #line 852 "bitbakeparser.c"
851         break;
852       case 34:
853 #line 144 "bitbakeparser.y"
854 { e_include( lex, yymsp[0].minor.yy0.string() ); yymsp[0].minor.yy0.release_this();   yy_destructor(21,&yymsp[-1].minor);
855 }
856 #line 858 "bitbakeparser.c"
857         break;
858       case 35:
859 #line 147 "bitbakeparser.y"
860 { e_require( lex, yymsp[0].minor.yy0.string() ); yymsp[0].minor.yy0.release_this();   yy_destructor(22,&yymsp[-1].minor);
861 }
862 #line 864 "bitbakeparser.c"
863         break;
864       case 36:
865 #line 150 "bitbakeparser.y"
866 { /* concatenate body lines */
867           yygotominor.yy0.assignString( token_t::concatString(yymsp[-1].minor.yy0.string(), yymsp[0].minor.yy0.string()) );
868           yymsp[-1].minor.yy0.release_this ();
869           yymsp[0].minor.yy0.release_this ();
870         }
871 #line 873 "bitbakeparser.c"
872         break;
873       case 37:
874 #line 155 "bitbakeparser.y"
875 { yygotominor.yy0.assignString(0); }
876 #line 878 "bitbakeparser.c"
877         break;
878       case 38:
879 #line 157 "bitbakeparser.y"
880 { e_proc( lex, yymsp[-3].minor.yy0.string(), yymsp[-1].minor.yy0.string() );
881           yymsp[-3].minor.yy0.release_this(); yymsp[-1].minor.yy0.release_this();   yy_destructor(24,&yymsp[-2].minor);
882   yy_destructor(25,&yymsp[0].minor);
883 }
884 #line 886 "bitbakeparser.c"
885         break;
886       case 39:
887 #line 160 "bitbakeparser.y"
888 { e_proc_python ( lex, yymsp[-3].minor.yy0.string(), yymsp[-1].minor.yy0.string() );
889           yymsp[-3].minor.yy0.release_this(); yymsp[-1].minor.yy0.release_this();   yy_destructor(26,&yymsp[-4].minor);
890   yy_destructor(24,&yymsp[-2].minor);
891   yy_destructor(25,&yymsp[0].minor);
892 }
893 #line 895 "bitbakeparser.c"
894         break;
895       case 40:
896 #line 163 "bitbakeparser.y"
897 { e_proc_python( lex, NULL, yymsp[-1].minor.yy0.string());
898           yymsp[-1].minor.yy0.release_this ();   yy_destructor(26,&yymsp[-3].minor);
899   yy_destructor(24,&yymsp[-2].minor);
900   yy_destructor(25,&yymsp[0].minor);
901 }
902 #line 904 "bitbakeparser.c"
903         break;
904       case 41:
905 #line 167 "bitbakeparser.y"
906 { e_proc_fakeroot( lex, yymsp[-3].minor.yy0.string(), yymsp[-1].minor.yy0.string() );
907           yymsp[-3].minor.yy0.release_this (); yymsp[-1].minor.yy0.release_this ();   yy_destructor(27,&yymsp[-4].minor);
908   yy_destructor(24,&yymsp[-2].minor);
909   yy_destructor(25,&yymsp[0].minor);
910 }
911 #line 913 "bitbakeparser.c"
912         break;
913       case 42:
914 #line 171 "bitbakeparser.y"
915 { /* concatenate body lines */
916           yygotominor.yy0.assignString( token_t::concatString(yymsp[-1].minor.yy0.string(), yymsp[0].minor.yy0.string()) );
917           yymsp[-1].minor.yy0.release_this (); yymsp[0].minor.yy0.release_this ();
918         }
919 #line 921 "bitbakeparser.c"
920         break;
921       case 43:
922 #line 175 "bitbakeparser.y"
923 { yygotominor.yy0.assignString( 0 ); }
924 #line 926 "bitbakeparser.c"
925         break;
926       case 44:
927 #line 177 "bitbakeparser.y"
928 { e_def( lex, yymsp[-2].minor.yy0.string(), yymsp[-1].minor.yy0.string(), yymsp[0].minor.yy0.string());
929           yymsp[-2].minor.yy0.release_this(); yymsp[-1].minor.yy0.release_this(); yymsp[0].minor.yy0.release_this(); }
930 #line 932 "bitbakeparser.c"
931         break;
932   };
933   yygoto = yyRuleInfo[yyruleno].lhs;
934   yysize = yyRuleInfo[yyruleno].nrhs;
935   yypParser->yyidx -= yysize;
936   yyact = yy_find_reduce_action(yymsp[-yysize].stateno,yygoto);
937   if( yyact < YYNSTATE ){
938 #ifdef NDEBUG
939     /* If we are not debugging and the reduce action popped at least
940     ** one element off the stack, then we can push the new element back
941     ** onto the stack here, and skip the stack overflow test in yy_shift().
942     ** That gives a significant speed improvement. */
943     if( yysize ){
944       yypParser->yyidx++;
945       yymsp -= yysize-1;
946       yymsp->stateno = yyact;
947       yymsp->major = yygoto;
948       yymsp->minor = yygotominor;
949     }else
950 #endif
951     {
952       yy_shift(yypParser,yyact,yygoto,&yygotominor);
953     }
954   }else if( yyact == YYNSTATE + YYNRULE + 1 ){
955     yy_accept(yypParser);
956   }
957 }
958
959 /*
960 ** The following code executes when the parse fails
961 */
962 static void yy_parse_failed(
963   yyParser *yypParser           /* The parser */
964 ){
965   bbparseARG_FETCH;
966 #ifndef NDEBUG
967   if( yyTraceFILE ){
968     fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt);
969   }
970 #endif
971   while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
972   /* Here code is inserted which will be executed whenever the
973   ** parser fails */
974   bbparseARG_STORE; /* Suppress warning about unused %extra_argument variable */
975 }
976
977 /*
978 ** The following code executes when a syntax error first occurs.
979 */
980 static void yy_syntax_error(
981   yyParser *yypParser,           /* The parser */
982   int yymajor,                   /* The major type of the error token */
983   YYMINORTYPE yyminor            /* The minor type of the error token */
984 ){
985   bbparseARG_FETCH;
986 #define TOKEN (yyminor.yy0)
987 #line 52 "bitbakeparser.y"
988  e_parse_error( lex ); 
989 #line 992 "bitbakeparser.c"
990   bbparseARG_STORE; /* Suppress warning about unused %extra_argument variable */
991 }
992
993 /*
994 ** The following is executed when the parser accepts
995 */
996 static void yy_accept(
997   yyParser *yypParser           /* The parser */
998 ){
999   bbparseARG_FETCH;
1000 #ifndef NDEBUG
1001   if( yyTraceFILE ){
1002     fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt);
1003   }
1004 #endif
1005   while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
1006   /* Here code is inserted which will be executed whenever the
1007   ** parser accepts */
1008   bbparseARG_STORE; /* Suppress warning about unused %extra_argument variable */
1009 }
1010
1011 /* The main parser program.
1012 ** The first argument is a pointer to a structure obtained from
1013 ** "bbparseAlloc" which describes the current state of the parser.
1014 ** The second argument is the major token number.  The third is
1015 ** the minor token.  The fourth optional argument is whatever the
1016 ** user wants (and specified in the grammar) and is available for
1017 ** use by the action routines.
1018 **
1019 ** Inputs:
1020 ** <ul>
1021 ** <li> A pointer to the parser (an opaque structure.)
1022 ** <li> The major token number.
1023 ** <li> The minor token number.
1024 ** <li> An option argument of a grammar-specified type.
1025 ** </ul>
1026 **
1027 ** Outputs:
1028 ** None.
1029 */
1030 void bbparse(
1031   void *yyp,                   /* The parser */
1032   int yymajor,                 /* The major token code number */
1033   bbparseTOKENTYPE yyminor       /* The value for the token */
1034   bbparseARG_PDECL               /* Optional %extra_argument parameter */
1035 ){
1036   YYMINORTYPE yyminorunion;
1037   int yyact;            /* The parser action. */
1038   int yyendofinput;     /* True if we are at the end of input */
1039   int yyerrorhit = 0;   /* True if yymajor has invoked an error */
1040   yyParser *yypParser;  /* The parser */
1041
1042   /* (re)initialize the parser, if necessary */
1043   yypParser = (yyParser*)yyp;
1044   if( yypParser->yyidx<0 ){
1045     /* if( yymajor==0 ) return; // not sure why this was here... */
1046     yypParser->yyidx = 0;
1047     yypParser->yyerrcnt = -1;
1048     yypParser->yystack[0].stateno = 0;
1049     yypParser->yystack[0].major = 0;
1050   }
1051   yyminorunion.yy0 = yyminor;
1052   yyendofinput = (yymajor==0);
1053   bbparseARG_STORE;
1054
1055 #ifndef NDEBUG
1056   if( yyTraceFILE ){
1057     fprintf(yyTraceFILE,"%sInput %s\n",yyTracePrompt,yyTokenName[yymajor]);
1058   }
1059 #endif
1060
1061   do{
1062     yyact = yy_find_shift_action(yypParser,yymajor);
1063     if( yyact<YYNSTATE ){
1064       yy_shift(yypParser,yyact,yymajor,&yyminorunion);
1065       yypParser->yyerrcnt--;
1066       if( yyendofinput && yypParser->yyidx>=0 ){
1067         yymajor = 0;
1068       }else{
1069         yymajor = YYNOCODE;
1070       }
1071     }else if( yyact < YYNSTATE + YYNRULE ){
1072       yy_reduce(yypParser,yyact-YYNSTATE);
1073     }else if( yyact == YY_ERROR_ACTION ){
1074       int yymx;
1075 #ifndef NDEBUG
1076       if( yyTraceFILE ){
1077         fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt);
1078       }
1079 #endif
1080 #ifdef YYERRORSYMBOL
1081       /* A syntax error has occurred.
1082       ** The response to an error depends upon whether or not the
1083       ** grammar defines an error token "ERROR".  
1084       **
1085       ** This is what we do if the grammar does define ERROR:
1086       **
1087       **  * Call the %syntax_error function.
1088       **
1089       **  * Begin popping the stack until we enter a state where
1090       **    it is legal to shift the error symbol, then shift
1091       **    the error symbol.
1092       **
1093       **  * Set the error count to three.
1094       **
1095       **  * Begin accepting and shifting new tokens.  No new error
1096       **    processing will occur until three tokens have been
1097       **    shifted successfully.
1098       **
1099       */
1100       if( yypParser->yyerrcnt<0 ){
1101         yy_syntax_error(yypParser,yymajor,yyminorunion);
1102       }
1103       yymx = yypParser->yystack[yypParser->yyidx].major;
1104       if( yymx==YYERRORSYMBOL || yyerrorhit ){
1105 #ifndef NDEBUG
1106         if( yyTraceFILE ){
1107           fprintf(yyTraceFILE,"%sDiscard input token %s\n",
1108              yyTracePrompt,yyTokenName[yymajor]);
1109         }
1110 #endif
1111         yy_destructor(yymajor,&yyminorunion);
1112         yymajor = YYNOCODE;
1113       }else{
1114          while(
1115           yypParser->yyidx >= 0 &&
1116           yymx != YYERRORSYMBOL &&
1117           (yyact = yy_find_shift_action(yypParser,YYERRORSYMBOL)) >= YYNSTATE
1118         ){
1119           yy_pop_parser_stack(yypParser);
1120         }
1121         if( yypParser->yyidx < 0 || yymajor==0 ){
1122           yy_destructor(yymajor,&yyminorunion);
1123           yy_parse_failed(yypParser);
1124           yymajor = YYNOCODE;
1125         }else if( yymx!=YYERRORSYMBOL ){
1126           YYMINORTYPE u2;
1127           u2.YYERRSYMDT = 0;
1128           yy_shift(yypParser,yyact,YYERRORSYMBOL,&u2);
1129         }
1130       }
1131       yypParser->yyerrcnt = 3;
1132       yyerrorhit = 1;
1133 #else  /* YYERRORSYMBOL is not defined */
1134       /* This is what we do if the grammar does not define ERROR:
1135       **
1136       **  * Report an error message, and throw away the input token.
1137       **
1138       **  * If the input token is $, then fail the parse.
1139       **
1140       ** As before, subsequent error messages are suppressed until
1141       ** three input tokens have been successfully shifted.
1142       */
1143       if( yypParser->yyerrcnt<=0 ){
1144         yy_syntax_error(yypParser,yymajor,yyminorunion);
1145       }
1146       yypParser->yyerrcnt = 3;
1147       yy_destructor(yymajor,&yyminorunion);
1148       if( yyendofinput ){
1149         yy_parse_failed(yypParser);
1150       }
1151       yymajor = YYNOCODE;
1152 #endif
1153     }else{
1154       yy_accept(yypParser);
1155       yymajor = YYNOCODE;
1156     }
1157   }while( yymajor!=YYNOCODE && yypParser->yyidx>=0 );
1158   return;
1159 }