/ Check-in [ffc387a4]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Change the way that lemon handles %extra_argument. (CVS 427)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:ffc387a48a9864b7f323314fbf8295b5bb2a3bd1
User & Date: drh 2002-03-11 13:55:50
Context
2002-03-12
23:10
Fix the return type of the xStep function in the FuncDef structure definition. (CVS 428) check-in: 753adb78 user: drh tags: trunk
2002-03-11
13:55
Change the way that lemon handles %extra_argument. (CVS 427) check-in: ffc387a4 user: drh tags: trunk
02:15
Version 2.4.0 (CVS 443) check-in: d3f66b44 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to tool/lemon.c.

  3014   3014     }
  3015   3015     name = lemp->name ? lemp->name : "Parse";
  3016   3016     if( lemp->arg && lemp->arg[0] ){
  3017   3017       int i;
  3018   3018       i = strlen(lemp->arg);
  3019   3019       while( i>=1 && isspace(lemp->arg[i-1]) ) i--;
  3020   3020       while( i>=1 && (isalnum(lemp->arg[i-1]) || lemp->arg[i-1]=='_') ) i--;
  3021         -    fprintf(out,"#define %sARGDECL ,%s\n",name,&lemp->arg[i]);  lineno++;
  3022         -    fprintf(out,"#define %sXARGDECL %s;\n",name,lemp->arg);  lineno++;
  3023         -    fprintf(out,"#define %sANSIARGDECL ,%s\n",name,lemp->arg);  lineno++;
         3021  +    fprintf(out,"#define %sARG_SDECL %s;\n",name,lemp->arg);  lineno++;
         3022  +    fprintf(out,"#define %sARG_PDECL ,%s\n",name,lemp->arg);  lineno++;
         3023  +    fprintf(out,"#define %sARG_FETCH %s = yypParser->%s\n",
         3024  +                 name,lemp->arg,&lemp->arg[i]);  lineno++;
         3025  +    fprintf(out,"#define %sARG_STORE yypParser->%s = %s\n",
         3026  +                 name,&lemp->arg[i],&lemp->arg[i]);  lineno++;
  3024   3027     }else{
  3025         -    fprintf(out,"#define %sARGDECL\n",name);  lineno++;
  3026         -    fprintf(out,"#define %sXARGDECL\n",name);  lineno++;
  3027         -    fprintf(out,"#define %sANSIARGDECL\n",name);  lineno++;
         3028  +    fprintf(out,"#define %sARG_SDECL\n",name);  lineno++;
         3029  +    fprintf(out,"#define %sARG_PDECL\n",name);  lineno++;
         3030  +    fprintf(out,"#define %sARG_FETCH\n",name); lineno++;
         3031  +    fprintf(out,"#define %sARG_STORE\n",name); lineno++;
  3028   3032     }
  3029   3033     if( mhflag ){
  3030   3034       fprintf(out,"#endif\n"); lineno++;
  3031   3035     }
  3032   3036     fprintf(out,"#define YYNSTATE %d\n",lemp->nstate);  lineno++;
  3033   3037     fprintf(out,"#define YYNRULE %d\n",lemp->nrule);  lineno++;
  3034   3038     fprintf(out,"#define YYERRORSYMBOL %d\n",lemp->errsym->index);  lineno++;

Changes to tool/lempar.c.

    38     38   **    ParseTOKENTYPE     is the data type used for minor tokens given 
    39     39   **                       directly to the parser from the tokenizer.
    40     40   **    YYMINORTYPE        is the data type used for all minor tokens.
    41     41   **                       This is typically a union of many types, one of
    42     42   **                       which is ParseTOKENTYPE.  The entry in the union
    43     43   **                       for base tokens is called "yy0".
    44     44   **    YYSTACKDEPTH       is the maximum depth of the parser's stack.
    45         -**    ParseARGDECL       is a declaration of a 3rd argument to the
    46         -**                       parser, or null if there is no extra argument.
    47         -**    ParseKRARGDECL     A version of ParseARGDECL for K&R C.
    48         -**    ParseANSIARGDECL   A version of ParseARGDECL for ANSI C.
           45  +**    ParseARG_SDECL     A static variable declaration for the %extra_argument
           46  +**    ParseARG_PDECL     A parameter declaration for the %extra_argument
           47  +**    ParseARG_STORE     Code to store %extra_argument into yypParser
           48  +**    ParseARG_FETCH     Code to extract %extra_argument from yypParser
    49     49   **    YYNSTATE           the combined number of states.
    50     50   **    YYNRULE            the number of rules in the grammar
    51     51   **    YYERRORSYMBOL      is the code number of the error symbol.  If not
    52     52   **                       defined, then do no error processing.
    53     53   */
    54     54   %%
    55     55   #define YY_NO_ACTION      (YYNSTATE+YYNRULE+2)
................................................................................
    75     75   ** point and size of each hash table.
    76     76   */
    77     77   struct yyActionEntry {
    78     78     YYCODETYPE   lookahead;   /* The value of the look-ahead token */
    79     79     YYCODETYPE   next;        /* Next entry + 1. Zero at end of collision chain */
    80     80     YYACTIONTYPE action;      /* Action to take for this look-ahead */
    81     81   };
    82         -static struct yyActionEntry yyActionTable[] = {
           82  +typedef struct yyActionEntry yyActionEntry;
           83  +static const yyActionEntry yyActionTable[] = {
    83     84   %%
    84     85   };
    85     86   
    86     87   /* The state table contains information needed to look up the correct
    87     88   ** action in the action table, given the current state of the parser.
    88     89   ** Information needed includes:
    89     90   **
................................................................................
    91     92   **
    92     93   **  +  The number of entries in the action hash table.
    93     94   **
    94     95   **  +  The default action.  This is the action to take if no entry for
    95     96   **     the given look-ahead is found in the action hash table.
    96     97   */
    97     98   struct yyStateEntry {
    98         -  struct yyActionEntry *hashtbl; /* Start of the hash table in yyActionTable */
           99  +  const yyActionEntry *hashtbl;  /* Start of the hash table in yyActionTable */
    99    100     YYCODETYPE nEntry;             /* Number of entries in action hash table */
   100    101     YYACTIONTYPE actionDefault;    /* Default action if look-ahead not found */
   101    102   };
   102         -static struct yyStateEntry yyStateTable[] = {
          103  +typedef struct yyStateEntry yyStateEntry;
          104  +static const yyStateEntry yyStateTable[] = {
   103    105   %%
   104    106   };
   105    107   
   106    108   /* The following structure represents a single element of the
   107    109   ** parser's stack.  Information stored includes:
   108    110   **
   109    111   **   +  The state number for the parser at this level of the stack.
................................................................................
   118    120   struct yyStackEntry {
   119    121     int stateno;       /* The state-number */
   120    122     int major;         /* The major token value.  This is the code
   121    123                        ** number for the token at this stack level */
   122    124     YYMINORTYPE minor; /* The user-supplied minor token value.  This
   123    125                        ** is the value of the token  */
   124    126   };
          127  +typedef struct yyStackEntry yyStackEntry;
   125    128   
   126    129   /* The state of the parser is completely contained in an instance of
   127    130   ** the following structure */
   128    131   struct yyParser {
   129         -  int idx;                            /* Index of top element in stack */
   130         -  int errcnt;                         /* Shifts left before out of the error */
   131         -  struct yyStackEntry *top;           /* Pointer to the top stack element */
   132         -  struct yyStackEntry stack[YYSTACKDEPTH];  /* The parser's stack */
          132  +  int yyidx;                    /* Index of top element in stack */
          133  +  int yyerrcnt;                 /* Shifts left before out of the error */
          134  +  yyStackEntry *yytop;          /* Pointer to the top stack element */
          135  +  ParseARG_SDECL                /* A place to hold %extra_argument */
          136  +  yyStackEntry yystack[YYSTACKDEPTH];  /* The parser's stack */
   133    137   };
   134    138   typedef struct yyParser yyParser;
   135    139   
   136    140   #ifndef NDEBUG
   137    141   #include <stdio.h>
   138    142   static FILE *yyTraceFILE = 0;
   139    143   static char *yyTracePrompt = 0;
................................................................................
   160    164     yyTracePrompt = zTracePrompt;
   161    165     if( yyTraceFILE==0 ) yyTracePrompt = 0;
   162    166     else if( yyTracePrompt==0 ) yyTraceFILE = 0;
   163    167   }
   164    168   
   165    169   /* For tracing shifts, the names of all terminals and nonterminals
   166    170   ** are required.  The following table supplies these names */
   167         -static char *yyTokenName[] = { 
          171  +static const char *yyTokenName[] = { 
   168    172   %%
   169    173   };
   170    174   #define YYTRACE(X) if( yyTraceFILE ) fprintf(yyTraceFILE,"%sReduce [%s].\n",yyTracePrompt,X);
   171    175   #else
   172    176   #define YYTRACE(X)
   173    177   #endif
   174    178   
................................................................................
   201    205   ** A pointer to a parser.  This pointer is used in subsequent calls
   202    206   ** to Parse and ParseFree.
   203    207   */
   204    208   void *ParseAlloc(void *(*mallocProc)(size_t)){
   205    209     yyParser *pParser;
   206    210     pParser = (yyParser*)(*mallocProc)( (size_t)sizeof(yyParser) );
   207    211     if( pParser ){
   208         -    pParser->idx = -1;
          212  +    pParser->yyidx = -1;
   209    213     }
   210    214     return pParser;
   211    215   }
   212    216   
   213    217   /* The following function deletes the value associated with a
   214    218   ** symbol.  The symbol can be either a terminal or nonterminal.
   215    219   ** "yymajor" is the symbol code, and "yypminor" is a pointer to
................................................................................
   239    243   ** is popped from the stack, then call it.
   240    244   **
   241    245   ** Return the major token number for the symbol popped.
   242    246   */
   243    247   static int yy_pop_parser_stack(yyParser *pParser){
   244    248     YYCODETYPE yymajor;
   245    249   
   246         -  if( pParser->idx<0 ) return 0;
          250  +  if( pParser->yyidx<0 ) return 0;
   247    251   #ifndef NDEBUG
   248         -  if( yyTraceFILE && pParser->idx>=0 ){
          252  +  if( yyTraceFILE && pParser->yyidx>=0 ){
   249    253       fprintf(yyTraceFILE,"%sPopping %s\n",
   250    254         yyTracePrompt,
   251         -      yyTokenName[pParser->top->major]);
          255  +      yyTokenName[pParser->yytop->major]);
   252    256     }
   253    257   #endif
   254         -  yymajor = pParser->top->major;
   255         -  yy_destructor( yymajor, &pParser->top->minor);
   256         -  pParser->idx--;
   257         -  pParser->top--;
          258  +  yymajor = pParser->yytop->major;
          259  +  yy_destructor( yymajor, &pParser->yytop->minor);
          260  +  pParser->yyidx--;
          261  +  pParser->yytop--;
   258    262     return yymajor;
   259    263   }
   260    264   
   261    265   /* 
   262    266   ** Deallocate and destroy a parser.  Destructors are all called for
   263    267   ** all stack elements before shutting the parser down.
   264    268   **
................................................................................
   272    276   */
   273    277   void ParseFree(
   274    278     void *p,                    /* The parser to be deleted */
   275    279     void (*freeProc)(void*)     /* Function used to reclaim memory */
   276    280   ){
   277    281     yyParser *pParser = (yyParser*)p;
   278    282     if( pParser==0 ) return;
   279         -  while( pParser->idx>=0 ) yy_pop_parser_stack(pParser);
          283  +  while( pParser->yyidx>=0 ) yy_pop_parser_stack(pParser);
   280    284     (*freeProc)((void*)pParser);
   281    285   }
   282    286   
   283    287   /*
   284    288   ** Find the appropriate action for a parser given the look-ahead token.
   285    289   **
   286    290   ** If the look-ahead token is YYNOCODE, then check to see if the action is
................................................................................
   287    291   ** independent of the look-ahead.  If it is, return the action, otherwise
   288    292   ** return YY_NO_ACTION.
   289    293   */
   290    294   static int yy_find_parser_action(
   291    295     yyParser *pParser,        /* The parser */
   292    296     int iLookAhead             /* The look-ahead token */
   293    297   ){
   294         -  struct yyStateEntry *pState;   /* Appropriate entry in the state table */
   295         -  struct yyActionEntry *pAction; /* Action appropriate for the look-ahead */
          298  +  const yyStateEntry *pState;   /* Appropriate entry in the state table */
          299  +  const yyActionEntry *pAction; /* Action appropriate for the look-ahead */
   296    300    
   297         -  /* if( pParser->idx<0 ) return YY_NO_ACTION;  */
   298         -  pState = &yyStateTable[pParser->top->stateno];
          301  +  /* if( pParser->yyidx<0 ) return YY_NO_ACTION;  */
          302  +  pState = &yyStateTable[pParser->yytop->stateno];
   299    303     if( pState->nEntry==0 ){
   300    304       return pState->actionDefault;
   301    305     }else if( iLookAhead!=YYNOCODE ){
   302    306       pAction = &pState->hashtbl[iLookAhead % pState->nEntry];
   303    307       while( 1 ){
   304    308         if( pAction->lookahead==iLookAhead ) return pAction->action;
   305    309         if( pAction->next==0 ) return pState->actionDefault;
................................................................................
   316    320   */
   317    321   static void yy_shift(
   318    322     yyParser *yypParser,          /* The parser to be shifted */
   319    323     int yyNewState,               /* The new state to shift in */
   320    324     int yyMajor,                  /* The major token to shift in */
   321    325     YYMINORTYPE *yypMinor         /* Pointer ot the minor token to shift in */
   322    326   ){
   323         -  yypParser->idx++;
   324         -  yypParser->top++;
   325         -  if( yypParser->idx>=YYSTACKDEPTH ){
   326         -     yypParser->idx--;
   327         -     yypParser->top--;
          327  +  yypParser->yyidx++;
          328  +  yypParser->yytop++;
          329  +  if( yypParser->yyidx>=YYSTACKDEPTH ){
          330  +     ParseARG_FETCH;
          331  +     yypParser->yyidx--;
          332  +     yypParser->yytop--;
   328    333   #ifndef NDEBUG
   329    334        if( yyTraceFILE ){
   330    335          fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt);
   331    336        }
   332    337   #endif
   333         -     while( yypParser->idx>=0 ) yy_pop_parser_stack(yypParser);
          338  +     while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
   334    339        /* Here code is inserted which will execute if the parser
   335    340        ** stack every overflows */
   336    341   %%
          342  +     ParseARG_STORE; /* Suppress warning about unused %extra_argument var */
   337    343        return;
   338    344     }
   339         -  yypParser->top->stateno = yyNewState;
   340         -  yypParser->top->major = yyMajor;
   341         -  yypParser->top->minor = *yypMinor;
          345  +  yypParser->yytop->stateno = yyNewState;
          346  +  yypParser->yytop->major = yyMajor;
          347  +  yypParser->yytop->minor = *yypMinor;
   342    348   #ifndef NDEBUG
   343         -  if( yyTraceFILE && yypParser->idx>0 ){
          349  +  if( yyTraceFILE && yypParser->yyidx>0 ){
   344    350       int i;
   345    351       fprintf(yyTraceFILE,"%sShift %d\n",yyTracePrompt,yyNewState);
   346    352       fprintf(yyTraceFILE,"%sStack:",yyTracePrompt);
   347         -    for(i=1; i<=yypParser->idx; i++)
   348         -      fprintf(yyTraceFILE," %s",yyTokenName[yypParser->stack[i].major]);
          353  +    for(i=1; i<=yypParser->yyidx; i++)
          354  +      fprintf(yyTraceFILE," %s",yyTokenName[yypParser->yystack[i].major]);
   349    355       fprintf(yyTraceFILE,"\n");
   350    356     }
   351    357   #endif
   352    358   }
   353    359   
   354    360   /* The following table contains information about every rule that
   355    361   ** is used during the reduce.
................................................................................
   357    363   static struct {
   358    364     YYCODETYPE lhs;         /* Symbol on the left-hand side of the rule */
   359    365     unsigned char nrhs;     /* Number of right-hand side symbols in the rule */
   360    366   } yyRuleInfo[] = {
   361    367   %%
   362    368   };
   363    369   
   364         -static void yy_accept(yyParser *  ParseANSIARGDECL);  /* Forward Declaration */
          370  +static void yy_accept(yyParser*);  /* Forward Declaration */
   365    371   
   366    372   /*
   367    373   ** Perform a reduce action and the shift that must immediately
   368    374   ** follow the reduce.
   369    375   */
   370    376   static void yy_reduce(
   371    377     yyParser *yypParser,         /* The parser */
   372    378     int yyruleno                 /* Number of the rule by which to reduce */
   373         -  ParseANSIARGDECL
   374    379   ){
   375    380     int yygoto;                     /* The next state */
   376    381     int yyact;                      /* The next action */
   377    382     YYMINORTYPE yygotominor;        /* The LHS of the rule reduced */
   378         -  struct yyStackEntry *yymsp;     /* The top of the parser's stack */
          383  +  yyStackEntry *yymsp;            /* The top of the parser's stack */
   379    384     int yysize;                     /* Amount to pop the stack */
   380         -  yymsp = yypParser->top;
          385  +  ParseARG_FETCH;
          386  +  yymsp = yypParser->yytop;
   381    387     switch( yyruleno ){
   382    388     /* Beginning here are the reduction cases.  A typical example
   383    389     ** follows:
   384    390     **   case 0:
   385    391     **     YYTRACE("<text of the rule>");
   386    392     **  #line <lineno> <grammarfile>
   387    393     **     { ... }           // User supplied code
................................................................................
   388    394     **  #line <lineno> <thisfile>
   389    395     **     break;
   390    396     */
   391    397   %%
   392    398     };
   393    399     yygoto = yyRuleInfo[yyruleno].lhs;
   394    400     yysize = yyRuleInfo[yyruleno].nrhs;
   395         -  yypParser->idx -= yysize;
   396         -  yypParser->top -= yysize;
          401  +  yypParser->yyidx -= yysize;
          402  +  yypParser->yytop -= yysize;
   397    403     yyact = yy_find_parser_action(yypParser,yygoto);
   398    404     if( yyact < YYNSTATE ){
   399    405       yy_shift(yypParser,yyact,yygoto,&yygotominor);
   400    406     }else if( yyact == YYNSTATE + YYNRULE + 1 ){
   401         -    yy_accept(yypParser ParseARGDECL);
          407  +    yy_accept(yypParser);
   402    408     }
   403    409   }
   404    410   
   405    411   /*
   406    412   ** The following code executes when the parse fails
   407    413   */
   408    414   static void yy_parse_failed(
   409    415     yyParser *yypParser           /* The parser */
   410         -  ParseANSIARGDECL              /* Extra arguments (if any) */
   411    416   ){
          417  +  ParseARG_FETCH;
   412    418   #ifndef NDEBUG
   413    419     if( yyTraceFILE ){
   414    420       fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt);
   415    421     }
   416    422   #endif
   417         -  while( yypParser->idx>=0 ) yy_pop_parser_stack(yypParser);
          423  +  while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
   418    424     /* Here code is inserted which will be executed whenever the
   419    425     ** parser fails */
   420    426   %%
          427  +  ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */
   421    428   }
   422    429   
   423    430   /*
   424    431   ** The following code executes when a syntax error first occurs.
   425    432   */
   426    433   static void yy_syntax_error(
   427    434     yyParser *yypParser,           /* The parser */
   428    435     int yymajor,                   /* The major type of the error token */
   429    436     YYMINORTYPE yyminor            /* The minor type of the error token */
   430         -  ParseANSIARGDECL               /* Extra arguments (if any) */
   431    437   ){
          438  +  ParseARG_FETCH;
   432    439   #define TOKEN (yyminor.yy0)
   433    440   %%
          441  +  ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */
   434    442   }
   435    443   
   436    444   /*
   437    445   ** The following is executed when the parser accepts
   438    446   */
   439    447   static void yy_accept(
   440    448     yyParser *yypParser           /* The parser */
   441         -  ParseANSIARGDECL              /* Extra arguments (if any) */
   442    449   ){
          450  +  ParseARG_FETCH;
   443    451   #ifndef NDEBUG
   444    452     if( yyTraceFILE ){
   445    453       fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt);
   446    454     }
   447    455   #endif
   448         -  while( yypParser->idx>=0 ) yy_pop_parser_stack(yypParser);
          456  +  while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
   449    457     /* Here code is inserted which will be executed whenever the
   450    458     ** parser accepts */
   451    459   %%
          460  +  ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */
   452    461   }
   453    462   
   454    463   /* The main parser program.
   455    464   ** The first argument is a pointer to a structure obtained from
   456    465   ** "ParseAlloc" which describes the current state of the parser.
   457    466   ** The second argument is the major token number.  The third is
   458    467   ** the minor token.  The fourth optional argument is whatever the
................................................................................
   470    479   ** Outputs:
   471    480   ** None.
   472    481   */
   473    482   void Parse(
   474    483     void *yyp,                   /* The parser */
   475    484     int yymajor,                 /* The major token code number */
   476    485     ParseTOKENTYPE yyminor       /* The value for the token */
   477         -  ParseANSIARGDECL
          486  +  ParseARG_PDECL               /* Optional %extra_argument parameter */
   478    487   ){
   479    488     YYMINORTYPE yyminorunion;
   480    489     int yyact;            /* The parser action. */
   481    490     int yyendofinput;     /* True if we are at the end of input */
   482    491     int yyerrorhit = 0;   /* True if yymajor has invoked an error */
   483    492     yyParser *yypParser;  /* The parser */
   484    493   
   485    494     /* (re)initialize the parser, if necessary */
   486    495     yypParser = (yyParser*)yyp;
   487         -  if( yypParser->idx<0 ){
          496  +  if( yypParser->yyidx<0 ){
   488    497       if( yymajor==0 ) return;
   489         -    yypParser->idx = 0;
   490         -    yypParser->errcnt = -1;
   491         -    yypParser->top = &yypParser->stack[0];
   492         -    yypParser->top->stateno = 0;
   493         -    yypParser->top->major = 0;
          498  +    yypParser->yyidx = 0;
          499  +    yypParser->yyerrcnt = -1;
          500  +    yypParser->yytop = &yypParser->yystack[0];
          501  +    yypParser->yytop->stateno = 0;
          502  +    yypParser->yytop->major = 0;
   494    503     }
   495    504     yyminorunion.yy0 = yyminor;
   496    505     yyendofinput = (yymajor==0);
          506  +  ParseARG_STORE;
   497    507   
   498    508   #ifndef NDEBUG
   499    509     if( yyTraceFILE ){
   500    510       fprintf(yyTraceFILE,"%sInput %s\n",yyTracePrompt,yyTokenName[yymajor]);
   501    511     }
   502    512   #endif
   503    513   
   504    514     do{
   505    515       yyact = yy_find_parser_action(yypParser,yymajor);
   506    516       if( yyact<YYNSTATE ){
   507    517         yy_shift(yypParser,yyact,yymajor,&yyminorunion);
   508         -      yypParser->errcnt--;
   509         -      if( yyendofinput && yypParser->idx>=0 ){
          518  +      yypParser->yyerrcnt--;
          519  +      if( yyendofinput && yypParser->yyidx>=0 ){
   510    520           yymajor = 0;
   511    521         }else{
   512    522           yymajor = YYNOCODE;
   513    523         }
   514    524       }else if( yyact < YYNSTATE + YYNRULE ){
   515         -      yy_reduce(yypParser,yyact-YYNSTATE ParseARGDECL);
          525  +      yy_reduce(yypParser,yyact-YYNSTATE);
   516    526       }else if( yyact == YY_ERROR_ACTION ){
   517    527   #ifndef NDEBUG
   518    528         if( yyTraceFILE ){
   519    529           fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt);
   520    530         }
   521    531   #endif
   522    532   #ifdef YYERRORSYMBOL
................................................................................
   535    545         **  * Set the error count to three.
   536    546         **
   537    547         **  * Begin accepting and shifting new tokens.  No new error
   538    548         **    processing will occur until three tokens have been
   539    549         **    shifted successfully.
   540    550         **
   541    551         */
   542         -      if( yypParser->errcnt<0 ){
   543         -        yy_syntax_error(yypParser,yymajor,yyminorunion ParseARGDECL);
          552  +      if( yypParser->yyerrcnt<0 ){
          553  +        yy_syntax_error(yypParser,yymajor,yyminorunion);
   544    554         }
   545         -      if( yypParser->top->major==YYERRORSYMBOL || yyerrorhit ){
          555  +      if( yypParser->yytop->major==YYERRORSYMBOL || yyerrorhit ){
   546    556   #ifndef NDEBUG
   547    557           if( yyTraceFILE ){
   548    558             fprintf(yyTraceFILE,"%sDiscard input token %s\n",
   549    559                yyTracePrompt,yyTokenName[yymajor]);
   550    560           }
   551    561   #endif
   552    562           yy_destructor(yymajor,&yyminorunion);
   553    563           yymajor = YYNOCODE;
   554    564         }else{
   555    565            while(
   556         -          yypParser->idx >= 0 &&
   557         -          yypParser->top->major != YYERRORSYMBOL &&
          566  +          yypParser->yyidx >= 0 &&
          567  +          yypParser->yytop->major != YYERRORSYMBOL &&
   558    568             (yyact = yy_find_parser_action(yypParser,YYERRORSYMBOL)) >= YYNSTATE
   559    569           ){
   560    570             yy_pop_parser_stack(yypParser);
   561    571           }
   562         -        if( yypParser->idx < 0 || yymajor==0 ){
          572  +        if( yypParser->yyidx < 0 || yymajor==0 ){
   563    573             yy_destructor(yymajor,&yyminorunion);
   564         -          yy_parse_failed(yypParser ParseARGDECL);
          574  +          yy_parse_failed(yypParser);
   565    575             yymajor = YYNOCODE;
   566         -        }else if( yypParser->top->major!=YYERRORSYMBOL ){
          576  +        }else if( yypParser->yytop->major!=YYERRORSYMBOL ){
   567    577             YYMINORTYPE u2;
   568    578             u2.YYERRSYMDT = 0;
   569    579             yy_shift(yypParser,yyact,YYERRORSYMBOL,&u2);
   570    580           }
   571    581         }
   572         -      yypParser->errcnt = 3;
          582  +      yypParser->yyerrcnt = 3;
   573    583         yyerrorhit = 1;
   574    584   #else  /* YYERRORSYMBOL is not defined */
   575    585         /* This is what we do if the grammar does not define ERROR:
   576    586         **
   577    587         **  * Report an error message, and throw away the input token.
   578    588         **
   579    589         **  * If the input token is $, then fail the parse.
   580    590         **
   581    591         ** As before, subsequent error messages are suppressed until
   582    592         ** three input tokens have been successfully shifted.
   583    593         */
   584         -      if( yypParser->errcnt<=0 ){
   585         -        yy_syntax_error(yypParser,yymajor,yyminorunion ParseARGDECL);
          594  +      if( yypParser->yyerrcnt<=0 ){
          595  +        yy_syntax_error(yypParser,yymajor,yyminorunion);
   586    596         }
   587         -      yypParser->errcnt = 3;
          597  +      yypParser->yyerrcnt = 3;
   588    598         yy_destructor(yymajor,&yyminorunion);
   589    599         if( yyendofinput ){
   590         -        yy_parse_failed(yypParser ParseARGDECL);
          600  +        yy_parse_failed(yypParser);
   591    601         }
   592    602         yymajor = YYNOCODE;
   593    603   #endif
   594    604       }else{
   595         -      yy_accept(yypParser ParseARGDECL);
          605  +      yy_accept(yypParser);
   596    606         yymajor = YYNOCODE;
   597    607       }
   598         -  }while( yymajor!=YYNOCODE && yypParser->idx>=0 );
          608  +  }while( yymajor!=YYNOCODE && yypParser->yyidx>=0 );
   599    609     return;
   600    610   }