/[bison]/bison/src/parse-gram.c
ViewVC logotype

Diff of /bison/src/parse-gram.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.37 by eggert, Fri Dec 13 11:39:29 2002 UTC revision 1.38 by eggert, Tue Dec 24 08:23:10 2002 UTC
# Line 1  Line 1 
1  /* A Bison parser, made by GNU Bison 1.75d.  */  /* A Bison parser, made by GNU Bison 1.75e.  */
2    
3  /* Skeleton parser for Yacc-like parsing with Bison,  /* Skeleton parser for Yacc-like parsing with Bison,
4     Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.     Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
# Line 188  static void gram_error (location const * Line 188  static void gram_error (location const *
188          print_token_value (File, Type, &Value)          print_token_value (File, Type, &Value)
189  static void print_token_value (FILE *, int, YYSTYPE const *);  static void print_token_value (FILE *, int, YYSTYPE const *);
190    
191  static void add_param (char const *, char const *, location);  static void add_param (char const *, char *, location);
192    
193  symbol_class current_class = unknown_sym;  symbol_class current_class = unknown_sym;
194  uniqstr current_type = 0;  uniqstr current_type = 0;
# Line 196  symbol *current_lhs; Line 196  symbol *current_lhs;
196  location current_lhs_location;  location current_lhs_location;
197  assoc current_assoc;  assoc current_assoc;
198  int current_prec = 0;  int current_prec = 0;
 braced_code current_braced_code = action_braced_code;  
199    
200    
201  /* Enabling traces.  */  /* Enabling traces.  */
# Line 212  braced_code current_braced_code = action Line 211  braced_code current_braced_code = action
211  # define YYERROR_VERBOSE 0  # define YYERROR_VERBOSE 0
212  #endif  #endif
213    
214  #ifndef YYSTYPE  #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
215  #line 75 "parse-gram.y"  #line 74 "parse-gram.y"
216  typedef union {  typedef union YYSTYPE {
217    symbol *symbol;    symbol *symbol;
218    symbol_list *list;    symbol_list *list;
219    int integer;    int integer;
220    char *chars;    char *chars;
221    assoc assoc;    assoc assoc;
222    uniqstr uniqstr;    uniqstr uniqstr;
223  } yystype;  } YYSTYPE;
224  /* Line 195 of yacc.c.  */  /* Line 192 of yacc.c.  */
225  #line 226 "parse-gram.c"  #line 225 "parse-gram.c"
226  # define YYSTYPE yystype  # define yystype YYSTYPE /* obsolescent; will be withdrawn */
227    # define YYSTYPE_IS_DECLARED 1
228  # define YYSTYPE_IS_TRIVIAL 1  # define YYSTYPE_IS_TRIVIAL 1
229  #endif  #endif
230    
231  #ifndef YYLTYPE  #if ! defined (YYLTYPE) && ! defined (YYLTYPE_IS_DECLARED)
232  typedef struct yyltype  typedef struct YYLTYPE
233  {  {
234    int first_line;    int first_line;
235    int first_column;    int first_column;
236    int last_line;    int last_line;
237    int last_column;    int last_column;
238  } yyltype;  } YYLTYPE;
239  # define YYLTYPE yyltype  # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
240    # define YYLTYPE_IS_DECLARED 1
241  # define YYLTYPE_IS_TRIVIAL 1  # define YYLTYPE_IS_TRIVIAL 1
242  #endif  #endif
243    
244    
245  /* Copy the second part of user declarations.  */  /* Copy the second part of user declarations.  */
246    
247    
248  /* Line 215 of yacc.c.  */  /* Line 215 of yacc.c.  */
249  #line 247 "parse-gram.c"  #line 249 "parse-gram.c"
250    
251  #if ! defined (yyoverflow) || YYERROR_VERBOSE  #if ! defined (yyoverflow) || YYERROR_VERBOSE
252    
# Line 344  union yyalloc Line 346  union yyalloc
346  /* YYFINAL -- State number of the termination state. */  /* YYFINAL -- State number of the termination state. */
347  #define YYFINAL  3  #define YYFINAL  3
348  /* YYLAST -- Last index in YYTABLE.  */  /* YYLAST -- Last index in YYTABLE.  */
349  #define YYLAST   153  #define YYLAST   157
350    
351  /* YYNTOKENS -- Number of terminals. */  /* YYNTOKENS -- Number of terminals. */
352  #define YYNTOKENS  46  #define YYNTOKENS  46
353  /* YYNNTS -- Number of nonterminals. */  /* YYNNTS -- Number of nonterminals. */
354  #define YYNNTS  28  #define YYNNTS  25
355  /* YYNRULES -- Number of rules. */  /* YYNRULES -- Number of rules. */
356  #define YYNRULES  77  #define YYNRULES  74
357  /* YYNRULES -- Number of states. */  /* YYNRULES -- Number of states. */
358  #define YYNSTATES  109  #define YYNSTATES  101
359    
360  /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */  /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
361  #define YYUNDEFTOK  2  #define YYUNDEFTOK  2
362  #define YYMAXUTOK   300  #define YYMAXUTOK   300
363    
364  #define YYTRANSLATE(YYX)                                                \  #define YYTRANSLATE(YYX)                                                \
365    ((YYX <= 0) ? YYEOF :                                                 \    ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
    (unsigned)(YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)  
366    
367  /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */  /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
368  static const unsigned char yytranslate[] =  static const unsigned char yytranslate[] =
# Line 405  static const unsigned char yytranslate[] Line 406  static const unsigned char yytranslate[]
406  static const unsigned char yyprhs[] =  static const unsigned char yyprhs[] =
407  {  {
408         0,     0,     3,     8,     9,    12,    14,    16,    18,    22,         0,     0,     3,     8,     9,    12,    14,    16,    18,    22,
409        24,    26,    29,    33,    35,    38,    40,    44,    46,    50,        24,    26,    29,    33,    35,    37,    39,    43,    45,    49,
410        53,    55,    58,    60,    62,    64,    66,    68,    70,    73,        51,    53,    56,    58,    60,    62,    64,    66,    68,    71,
411        76,    77,    82,    83,    88,    89,    93,    94,    98,   102,        73,    76,    79,    80,    84,    85,    89,    93,    97,    99,
412       106,   108,   110,   112,   113,   115,   117,   120,   122,   124,       101,   103,   104,   106,   108,   111,   113,   115,   118,   121,
413       127,   130,   134,   136,   139,   141,   144,   146,   148,   151,       125,   127,   130,   132,   135,   137,   139,   142,   144,   145,
414       153,   154,   158,   160,   164,   165,   168,   171,   175,   179,       149,   151,   155,   156,   159,   162,   166,   170,   174,   176,
415       183,   185,   187,   189,   191,   193,   195,   196       178,   180,   182,   184,   185
416  };  };
417    
418  /* YYRHS -- A `-1'-separated list of the rules' RHS. */  /* YYRHS -- A `-1'-separated list of the rules' RHS. */
419  static const yysigned_char yyrhs[] =  static const yysigned_char yyrhs[] =
420  {  {
421        47,     0,    -1,    48,    42,    62,    73,    -1,    -1,    48,        47,     0,    -1,    48,    42,    60,    70,    -1,    -1,    48,
422        49,    -1,    50,    -1,    43,    -1,    17,    -1,    18,    71,        49,    -1,    50,    -1,    43,    -1,    17,    -1,    18,    69,
423        71,    -1,    19,    -1,    20,    -1,    21,     4,    -1,    22,        69,    -1,    19,    -1,    20,    -1,    21,     4,    -1,    22,
424        37,    71,    -1,    23,    -1,    24,    72,    -1,    25,    -1,        37,    69,    -1,    23,    -1,    24,    -1,    25,    -1,    26,
425        26,    37,    71,    -1,    27,    -1,    28,    37,    71,    -1,        37,    69,    -1,    27,    -1,    28,    37,    69,    -1,    29,
426        29,    72,    -1,    30,    -1,    31,    71,    -1,    33,    -1,        -1,    30,    -1,    31,    69,    -1,    33,    -1,    34,    -1,
427        34,    -1,    35,    -1,    38,    -1,    56,    -1,    53,    -1,        35,    -1,    38,    -1,    54,    -1,    51,    -1,    32,    66,
428        32,    68,    -1,    10,    45,    -1,    -1,     8,    51,    45,        -1,    10,    -1,     8,    57,    -1,     9,    57,    -1,    -1,
429        59,    -1,    -1,     9,    52,    45,    59,    -1,    -1,     6,         6,    52,    59,    -1,    -1,     5,    53,    59,    -1,     7,
430        54,    61,    -1,    -1,     5,    55,    61,    -1,     7,    36,        36,    57,    -1,    55,    56,    57,    -1,    11,    -1,    12,
431        59,    -1,    57,    58,    59,    -1,    11,    -1,    12,    -1,        -1,    13,    -1,    -1,    36,    -1,    66,    -1,    57,    66,
432        13,    -1,    -1,    36,    -1,    68,    -1,    59,    68,    -1,        -1,    36,    -1,    40,    -1,    40,     4,    -1,    40,    68,
433        36,    -1,    40,    -1,    40,     4,    -1,    40,    70,    -1,        -1,    40,     4,    68,    -1,    58,    -1,    59,    58,    -1,
434        40,     4,    70,    -1,    60,    -1,    61,    60,    -1,    63,        61,    -1,    60,    61,    -1,    62,    -1,    50,    -1,     1,
435        -1,    62,    63,    -1,    64,    -1,    50,    -1,     1,    38,        38,    -1,    38,    -1,    -1,    41,    63,    64,    -1,    65,
436        -1,    38,    -1,    -1,    41,    65,    66,    -1,    67,    -1,        -1,    64,    39,    65,    -1,    -1,    65,    66,    -1,    65,
437        66,    39,    67,    -1,    -1,    67,    68,    -1,    67,    69,        67,    -1,    65,    14,    66,    -1,    65,    15,     4,    -1,
438        -1,    67,    14,    68,    -1,    67,    15,     4,    -1,    67,        65,    16,    36,    -1,    40,    -1,    68,    -1,    45,    -1,
439        16,    36,    -1,    40,    -1,    70,    -1,    45,    -1,     3,         3,    -1,     3,    -1,    -1,    42,    44,    -1
       -1,     3,    -1,    45,    -1,    -1,    42,    44,    -1  
440  };  };
441    
442  /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */  /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
443  static const unsigned short yyrline[] =  static const unsigned short yyrline[] =
444  {  {
445         0,   156,   156,   164,   166,   170,   171,   172,   173,   174,         0,   160,   160,   168,   170,   174,   175,   176,   177,   178,
446       175,   176,   177,   178,   179,   180,   181,   182,   183,   184,       179,   180,   181,   182,   183,   184,   185,   186,   187,   188,
447       185,   186,   187,   188,   189,   190,   194,   195,   196,   200,       189,   190,   191,   192,   193,   194,   198,   199,   200,   204,
448       207,   206,   217,   216,   229,   229,   234,   234,   239,   249,       210,   217,   227,   227,   232,   232,   237,   247,   262,   263,
449       264,   265,   266,   270,   271,   277,   278,   283,   287,   292,       264,   268,   269,   275,   276,   281,   285,   290,   296,   302,
450       298,   304,   315,   316,   325,   326,   332,   333,   338,   342,       313,   314,   323,   324,   330,   331,   336,   340,   344,   344,
451       346,   346,   350,   351,   356,   357,   359,   361,   363,   365,       348,   349,   354,   355,   357,   359,   361,   363,   368,   369,
452       370,   371,   375,   381,   390,   399,   406,   408       373,   379,   388,   395,   397
453  };  };
454  #endif  #endif
455    
# Line 459  static const unsigned short yyrline[] = Line 459  static const unsigned short yyrline[] =
459  static const char *const yytname[] =  static const char *const yytname[] =
460  {  {
461    "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",    "\"end of file\"", "error", "$undefined", "\"string\"", "\"integer\"",
462    "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor\"",    "\"%token\"", "\"%nterm\"", "\"%type\"", "\"%destructor {...}\"",
463    "\"%printer\"", "\"%union\"", "\"%left\"", "\"%right\"",    "\"%printer {...}\"", "\"%union {...}\"", "\"%left\"", "\"%right\"",
464    "\"%nonassoc\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"", "\"%debug\"",    "\"%nonassoc\"", "\"%prec\"", "\"%dprec\"", "\"%merge\"", "\"%debug\"",
465    "\"%define\"", "\"%defines\"", "\"%error-verbose\"", "\"%expect\"",    "\"%define\"", "\"%defines\"", "\"%error-verbose\"", "\"%expect\"",
466    "\"%file-prefix\"", "\"%glr-parser\"", "\"%lex-param\"",    "\"%file-prefix\"", "\"%glr-parser\"", "\"%lex-param {...}\"",
467    "\"%locations\"", "\"%name-prefix\"", "\"%no-lines\"", "\"%output\"",    "\"%locations\"", "\"%name-prefix\"", "\"%no-lines\"", "\"%output\"",
468    "\"%parse-param\"", "\"%pure-parser\"", "\"%skeleton\"", "\"%start\"",    "\"%parse-param {...}\"", "\"%pure-parser\"", "\"%skeleton\"",
469    "\"%token-table\"", "\"%verbose\"", "\"%yacc\"", "\"type\"", "\"=\"",    "\"%start\"", "\"%token-table\"", "\"%verbose\"", "\"%yacc\"",
470    "\";\"", "\"|\"", "\"identifier\"", "\"identifier:\"", "\"%%\"",    "\"type\"", "\"=\"", "\";\"", "\"|\"", "\"identifier\"",
471    "\"%{...%}\"", "\"epilogue\"", "\"{...}\"", "$accept", "input",    "\"identifier:\"", "\"%%\"", "\"%{...%}\"", "\"epilogue\"", "\"{...}\"",
472    "declarations", "declaration", "grammar_declaration", "@1", "@2",    "$accept", "input", "declarations", "declaration",
473    "symbol_declaration", "@3", "@4", "precedence_declaration",    "grammar_declaration", "symbol_declaration", "@1", "@2",
474    "precedence_declarator", "type.opt", "symbols.1", "symbol_def",    "precedence_declaration", "precedence_declarator", "type.opt",
475    "symbol_defs.1", "grammar", "rules_or_grammar_declaration", "rules",    "symbols.1", "symbol_def", "symbol_defs.1", "grammar",
476    "@5", "rhses.1", "rhs", "symbol", "action", "string_as_id",    "rules_or_grammar_declaration", "rules", "@3", "rhses.1", "rhs",
477    "string_content", "code_content", "epilogue.opt", 0    "symbol", "action", "string_as_id", "string_content", "epilogue.opt", 0
478  };  };
479  #endif  #endif
480    
# Line 497  static const unsigned char yyr1[] = Line 497  static const unsigned char yyr1[] =
497         0,    46,    47,    48,    48,    49,    49,    49,    49,    49,         0,    46,    47,    48,    48,    49,    49,    49,    49,    49,
498        49,    49,    49,    49,    49,    49,    49,    49,    49,    49,        49,    49,    49,    49,    49,    49,    49,    49,    49,    49,
499        49,    49,    49,    49,    49,    49,    50,    50,    50,    50,        49,    49,    49,    49,    49,    49,    50,    50,    50,    50,
500        51,    50,    52,    50,    54,    53,    55,    53,    53,    56,        50,    50,    52,    51,    53,    51,    51,    54,    55,    55,
501        57,    57,    57,    58,    58,    59,    59,    60,    60,    60,        55,    56,    56,    57,    57,    58,    58,    58,    58,    58,
502        60,    60,    61,    61,    62,    62,    63,    63,    63,    63,        59,    59,    60,    60,    61,    61,    61,    61,    63,    62,
503        65,    64,    66,    66,    67,    67,    67,    67,    67,    67,        64,    64,    65,    65,    65,    65,    65,    65,    66,    66,
504        68,    68,    69,    70,    71,    72,    73,    73        67,    68,    69,    70,    70
505  };  };
506    
507  /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */  /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
508  static const unsigned char yyr2[] =  static const unsigned char yyr2[] =
509  {  {
510         0,     2,     4,     0,     2,     1,     1,     1,     3,     1,         0,     2,     4,     0,     2,     1,     1,     1,     3,     1,
511         1,     2,     3,     1,     2,     1,     3,     1,     3,     2,         1,     2,     3,     1,     1,     1,     3,     1,     3,     1,
512         1,     2,     1,     1,     1,     1,     1,     1,     2,     2,         1,     2,     1,     1,     1,     1,     1,     1,     2,     1,
513         0,     4,     0,     4,     0,     3,     0,     3,     3,     3,         2,     2,     0,     3,     0,     3,     3,     3,     1,     1,
514         1,     1,     1,     0,     1,     1,     2,     1,     1,     2,         1,     0,     1,     1,     2,     1,     1,     2,     2,     3,
515         2,     3,     1,     2,     1,     2,     1,     1,     2,     1,         1,     2,     1,     2,     1,     1,     2,     1,     0,     3,
516         0,     3,     1,     3,     0,     2,     2,     3,     3,     3,         1,     3,     0,     2,     2,     3,     3,     3,     1,     1,
517         1,     1,     1,     1,     1,     1,     0,     2         1,     1,     1,     0,     2
518  };  };
519    
520  /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state  /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
# Line 522  static const unsigned char yyr2[] = Line 522  static const unsigned char yyr2[] =
522     means the default is an error.  */     means the default is an error.  */
523  static const unsigned char yydefact[] =  static const unsigned char yydefact[] =
524  {  {
525         3,     0,     0,     1,    36,    34,     0,    30,    32,     0,         3,     0,     0,     1,    34,    32,     0,     0,     0,    29,
526        40,    41,    42,     7,     0,     9,    10,     0,     0,    13,        38,    39,    40,     7,     0,     9,    10,     0,     0,    13,
527         0,    15,     0,    17,     0,     0,    20,     0,     0,    22,        14,    15,     0,    17,     0,    19,    20,     0,     0,    22,
528        23,    24,    25,     0,     6,     4,     5,    27,    26,    43,        23,    24,    25,     0,     6,     4,     5,    27,    26,    41,
529         0,     0,     0,     0,     0,    29,    74,     0,    11,     0,         0,     0,     0,    71,    68,    30,    43,    69,    31,    72,
530        75,    14,     0,     0,    19,    21,    73,    70,    28,    71,         0,    11,     0,     0,     0,    21,    28,     0,    57,    58,
531         0,    59,    60,    57,     0,    54,    56,    44,     0,    47,        55,     0,    52,    54,    42,     0,    45,    46,    50,    35,
532        48,    52,    37,    35,    38,    45,     0,     0,     8,    12,        33,    36,    44,     8,    12,    16,    18,    56,    62,     0,
533        16,    18,    58,    64,     0,    55,     2,    39,    49,    50,        53,     2,    37,    47,    48,    51,    59,    60,    74,    49,
534        53,    46,    31,    33,    61,    62,    77,    51,    64,     0,        62,     0,     0,     0,    70,    63,    64,    61,    65,    66,
535         0,     0,    72,    65,    66,    63,    67,    68,    69        67
536  };  };
537    
538  /* YYDEFGOTO[NTERM-NUM]. */  /* YYDEFGOTO[NTERM-NUM]. */
539  static const yysigned_char yydefgoto[] =  static const yysigned_char yydefgoto[] =
540  {  {
541        -1,     1,     2,    35,    63,    43,    44,    37,    41,    40,        -1,     1,     2,    35,    60,    37,    41,    40,    38,    39,
542        38,    39,    68,    74,    71,    72,    64,    65,    66,    83,        65,    45,    68,    69,    61,    62,    63,    78,    86,    87,
543        94,    95,    75,   104,    59,    47,    51,    86        46,    96,    47,    50,    81
544  };  };
545    
546  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
547     STATE-NUM.  */     STATE-NUM.  */
548  #define YYPACT_NINF -67  #define YYPACT_NINF -65
549  static const yysigned_char yypact[] =  static const yysigned_char yypact[] =
550  {  {
551       -67,     5,   110,   -67,   -67,   -67,   -17,   -67,   -67,   -14,       -65,     5,   114,   -65,   -65,   -65,   -24,     1,     1,   -65,
552       -67,   -67,   -67,   -67,    29,   -67,   -67,    30,    -1,   -67,       -65,   -65,   -65,   -65,    10,   -65,   -65,    11,   -23,   -65,
553       -10,   -67,     4,   -67,     7,   -10,   -67,    29,     0,   -67,       -65,   -65,   -21,   -65,   -15,   -65,   -65,    10,     1,   -65,
554       -67,   -67,   -67,    73,   -67,   -67,   -67,   -67,   -67,     2,       -65,   -65,   -65,    77,   -65,   -65,   -65,   -65,   -65,   -13,
555       -20,   -20,     0,    -8,     3,   -67,   -67,    29,   -67,    29,       -34,   -34,     1,   -65,   -65,     1,   -65,   -65,     1,   -65,
556       -67,   -67,    29,    29,   -67,   -67,   -67,   -67,   -67,   -67,        10,   -65,    10,    10,    10,   -65,   -65,   -17,   -65,   -65,
557        11,   -67,   -67,   -67,     1,   -67,   -67,   -67,     0,   -67,       -65,    39,   -65,   -65,   -65,     1,   -65,     4,   -65,   -34,
558        14,   -67,   -20,   -20,     0,   -67,     0,     0,   -67,   -67,       -34,     1,   -65,   -65,   -65,   -65,   -65,   -65,   -65,   -20,
559       -67,   -67,   -67,   -67,     9,   -67,   -67,     0,    51,   -67,       -65,   -65,     1,    22,   -65,   -65,   -12,    15,   -65,   -65,
560       -67,   -67,     0,     0,    16,    12,   -67,   -67,   -67,     0,       -65,     1,    24,   -10,   -65,   -65,   -65,    15,   -65,   -65,
561        52,    22,   -67,   -67,   -67,    12,   -67,   -67,   -67       -65
562  };  };
563    
564  /* YYPGOTO[NTERM-NUM].  */  /* YYPGOTO[NTERM-NUM].  */
565  static const yysigned_char yypgoto[] =  static const yysigned_char yypgoto[] =
566  {  {
567       -67,   -67,   -67,   -67,    58,   -67,   -67,   -67,   -67,   -67,       -65,   -65,   -65,   -65,    30,   -65,   -65,   -65,   -65,   -65,
568       -67,   -67,   -67,   -47,   -49,    20,   -67,     6,   -67,   -67,       -65,    -7,   -60,    -8,   -65,   -19,   -65,   -65,   -65,   -37,
569       -67,   -36,   -28,   -67,   -66,    -2,    38,   -67       -28,   -65,   -64,   -16,   -65
570  };  };
571    
572  /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If  /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
573     positive, shift that token.  If negative, reduce the rule which     positive, shift that token.  If negative, reduce the rule which
574     number is the opposite.  If zero, do what YYDEFACT says.     number is the opposite.  If zero, do what YYDEFACT says.
575     If YYTABLE_NINF, syntax error.  */     If YYTABLE_NINF, syntax error.  */
576  #define YYTABLE_NINF -77  #define YYTABLE_NINF -74
577  static const yysigned_char yytable[] =  static const yysigned_char yytable[] =
578  {  {
579        58,   -76,    60,    56,    89,     3,     4,     5,     6,     7,        56,    48,    66,    84,    43,     3,    67,    43,    83,    85,
580         8,     9,    10,    11,    12,    56,    69,    56,    88,    42,        85,    55,    42,    49,    52,    51,    53,    72,    43,    89,
581        70,    87,    97,    90,    90,    55,    99,   100,   101,    92,        72,    77,    54,    64,    88,    43,   100,    90,    99,    91,
582        93,    45,    46,    28,    48,    50,    49,    76,    67,    61,        92,    93,    36,    70,    73,    71,    74,    75,    76,   -73,
583        57,    52,    62,    84,    53,    78,    91,    79,    77,    82,        57,    44,    80,    72,     4,     5,     6,     7,     8,     9,
584        80,    81,    57,    96,    56,    98,   107,   102,   108,    91,        10,    11,    12,    97,    72,    44,     0,     0,    82,    95,
585        36,    73,   105,    54,    91,    91,     0,   103,     0,     0,        94,     0,     0,    98,     0,     0,     0,     0,     0,    95,
586        85,   106,     0,     0,    60,     0,     0,   103,     4,     5,         0,    28,     0,     0,     0,     0,     0,    58,    57,     0,
587         6,     7,     8,     9,    10,    11,    12,     0,     0,     0,        59,    79,     4,     5,     6,     7,     8,     9,    10,    11,
588         0,     0,     0,     0,     0,     0,     0,     0,     0,     0,        12,     0,     0,     0,     0,     0,     0,     0,     0,     0,
589         0,     0,     0,     0,     0,    28,     0,     0,     0,     0,         0,     0,     0,     0,     0,     0,     0,     0,     0,    28,
590         0,    61,     0,     0,    62,     4,     5,     6,     7,     8,         0,     0,     0,     0,     0,    58,     0,     0,    59,     4,
591         9,    10,    11,    12,     0,     0,     0,    13,    14,    15,         5,     6,     7,     8,     9,    10,    11,    12,     0,     0,
592        16,    17,    18,    19,    20,    21,    22,    23,    24,    25,         0,    13,    14,    15,    16,    17,    18,    19,    20,    21,
593        26,    27,    28,    29,    30,    31,     0,     0,    32,     0,        22,    23,    24,    25,    26,    27,    28,    29,    30,    31,
594         0,     0,    33,    34         0,     0,    32,     0,     0,     0,    33,    34
595  };  };
596    
597  static const yysigned_char yycheck[] =  static const yysigned_char yycheck[] =
598  {  {
599        28,     0,     1,     3,    70,     0,     5,     6,     7,     8,        28,     8,    36,    67,     3,     0,    40,     3,     4,    69,
600         9,    10,    11,    12,    13,     3,    36,     3,     4,    36,        70,    27,    36,     3,    37,     4,    37,    45,     3,    83,
601        40,    68,    88,    72,    73,    27,    14,    15,    16,    76,        48,    38,    37,    36,    44,     3,    36,    39,     4,    14,
602        77,    45,     3,    32,     4,    45,    37,    45,    36,    38,        15,    16,     2,    41,    50,    42,    52,    53,    54,     0,
603        40,    37,    41,    42,    37,    47,    74,    49,    45,    38,         1,    40,    61,    71,     5,     6,     7,     8,     9,    10,
604        52,    53,    40,    44,     3,    39,     4,    45,    36,    87,        11,    12,    13,    90,    82,    40,    -1,    -1,    65,    87,
605         2,    41,    98,    25,    92,    93,    -1,    95,    -1,    -1,        45,    -1,    -1,    91,    -1,    -1,    -1,    -1,    -1,    97,
606        64,    99,    -1,    -1,     1,    -1,    -1,   105,     5,     6,        -1,    32,    -1,    -1,    -1,    -1,    -1,    38,     1,    -1,
607         7,     8,     9,    10,    11,    12,    13,    -1,    -1,    -1,        41,    42,     5,     6,     7,     8,     9,    10,    11,    12,
608        -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,        13,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
609        -1,    -1,    -1,    -1,    -1,    32,    -1,    -1,    -1,    -1,        -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    32,
610        -1,    38,    -1,    -1,    41,     5,     6,     7,     8,     9,        -1,    -1,    -1,    -1,    -1,    38,    -1,    -1,    41,     5,
611        10,    11,    12,    13,    -1,    -1,    -1,    17,    18,    19,         6,     7,     8,     9,    10,    11,    12,    13,    -1,    -1,
612        20,    21,    22,    23,    24,    25,    26,    27,    28,    29,        -1,    17,    18,    19,    20,    21,    22,    23,    24,    25,
613        30,    31,    32,    33,    34,    35,    -1,    -1,    38,    -1,        26,    27,    28,    29,    30,    31,    32,    33,    34,    35,
614        -1,    -1,    42,    43        -1,    -1,    38,    -1,    -1,    -1,    42,    43
615  };  };
616    
617  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
# Line 621  static const unsigned char yystos[] = Line 621  static const unsigned char yystos[] =
621         0,    47,    48,     0,     5,     6,     7,     8,     9,    10,         0,    47,    48,     0,     5,     6,     7,     8,     9,    10,
622        11,    12,    13,    17,    18,    19,    20,    21,    22,    23,        11,    12,    13,    17,    18,    19,    20,    21,    22,    23,
623        24,    25,    26,    27,    28,    29,    30,    31,    32,    33,        24,    25,    26,    27,    28,    29,    30,    31,    32,    33,
624        34,    35,    38,    42,    43,    49,    50,    53,    56,    57,        34,    35,    38,    42,    43,    49,    50,    51,    54,    55,
625        55,    54,    36,    51,    52,    45,     3,    71,     4,    37,        53,    52,    36,     3,    40,    57,    66,    68,    57,     3,
626        45,    72,    37,    37,    72,    71,     3,    40,    68,    70,        69,     4,    37,    37,    37,    69,    66,     1,    38,    41,
627         1,    38,    41,    50,    62,    63,    64,    36,    58,    36,        50,    60,    61,    62,    36,    56,    36,    40,    58,    59,
628        40,    60,    61,    61,    59,    68,    45,    45,    71,    71,        59,    57,    66,    69,    69,    69,    69,    38,    63,    42,
629        71,    71,    38,    65,    42,    63,    73,    59,     4,    70,        61,    70,    57,     4,    68,    58,    64,    65,    44,    68,
630        60,    68,    59,    59,    66,    67,    44,    70,    39,    14,        39,    14,    15,    16,    45,    66,    67,    65,    66,     4,
631        15,    16,    45,    68,    69,    67,    68,     4,    36        36
632  };  };
633    
634  #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)  #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
# Line 648  static const unsigned char yystos[] = Line 648  static const unsigned char yystos[] =
648  #endif  #endif
649    
650  #define yyerrok         (yyerrstatus = 0)  #define yyerrok         (yyerrstatus = 0)
651  #define yyclearin       (yytoken = YYEMPTY)  #define yyclearin       (yychar = YYEMPTY)
652  #define YYEMPTY         -2  #define YYEMPTY         (-2)
653  #define YYEOF           0  #define YYEOF           0
654    
655  #define YYACCEPT        goto yyacceptlab  #define YYACCEPT        goto yyacceptlab
# Line 666  static const unsigned char yystos[] = Line 666  static const unsigned char yystos[] =
666    
667  #define YYBACKUP(Token, Value)                                  \  #define YYBACKUP(Token, Value)                                  \
668  do                                                              \  do                                                              \
669    if (yytoken == YYEMPTY && yylen == 1)                         \    if (yychar == YYEMPTY && yylen == 1)                          \
670      {                                                           \      {                                                           \
671        yychar = (Token);                                         \        yychar = (Token);                                         \
672        yylval = (Value);                                         \        yylval = (Value);                                         \
# Line 1051  YYLTYPE yylloc; Line 1051  YYLTYPE yylloc;
1051    yystate = 0;    yystate = 0;
1052    yyerrstatus = 0;    yyerrstatus = 0;
1053    yynerrs = 0;    yynerrs = 0;
1054    yychar = yytoken = YYEMPTY;           /* Cause a token to be read.  */    yychar = YYEMPTY;             /* Cause a token to be read.  */
1055    
1056    /* Initialize stack pointers.    /* Initialize stack pointers.
1057       Waste one element of value and location stack       Waste one element of value and location stack
# Line 1161  yybackup: Line 1161  yybackup:
1161    
1162    /* Not known => get a lookahead token if don't already have one.  */    /* Not known => get a lookahead token if don't already have one.  */
1163    
1164    /* YYTOKEN is either YYEMPTY or YYEOF or a valid token.  */    /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1165    if (yytoken == YYEMPTY)    if (yychar == YYEMPTY)
1166      {      {
1167        YYDPRINTF ((stderr, "Reading a token: "));        YYDPRINTF ((stderr, "Reading a token: "));
1168        yychar = YYLEX;        yychar = YYLEX;
       yytoken = YYTRANSLATE (yychar);  
1169      }      }
1170    
1171    if (yytoken == YYEOF)    if (yychar <= YYEOF)
1172      {      {
1173          yychar = yytoken = YYEOF;
1174        YYDPRINTF ((stderr, "Now at end of input.\n"));        YYDPRINTF ((stderr, "Now at end of input.\n"));
1175      }      }
1176    else    else
1177      {      {
1178          yytoken = YYTRANSLATE (yychar);
1179        YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);        YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
1180      }      }
1181    
# Line 1199  yybackup: Line 1200  yybackup:
1200    YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));    YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
1201    
1202    /* Discard the token being shifted unless it is eof.  */    /* Discard the token being shifted unless it is eof.  */
1203    if (yytoken != YYEOF)    if (yychar != YYEOF)
1204      yytoken = YYEMPTY;      yychar = YYEMPTY;
1205    
1206    *++yyvsp = yylval;    *++yyvsp = yylval;
1207    *++yylsp = yylloc;    *++yylsp = yylloc;
# Line 1247  yyreduce: Line 1248  yyreduce:
1248    switch (yyn)    switch (yyn)
1249      {      {
1250          case 6:          case 6:
1251  #line 171 "parse-gram.y"  #line 175 "parse-gram.y"
1252      { prologue_augment (yyvsp[0].chars, yylsp[0]); }      { prologue_augment (yyvsp[0].chars, yylsp[0]); }
1253      break;      break;
1254    
1255    case 7:    case 7:
1256  #line 172 "parse-gram.y"  #line 176 "parse-gram.y"
1257      { debug_flag = 1; }      { debug_flag = 1; }
1258      break;      break;
1259    
1260    case 8:    case 8:
1261  #line 173 "parse-gram.y"  #line 177 "parse-gram.y"
1262      { muscle_insert (yyvsp[-1].chars, yyvsp[0].chars); }      { muscle_insert (yyvsp[-1].chars, yyvsp[0].chars); }
1263      break;      break;
1264    
1265    case 9:    case 9:
1266  #line 174 "parse-gram.y"  #line 178 "parse-gram.y"
1267      { defines_flag = 1; }      { defines_flag = 1; }
1268      break;      break;
1269    
1270    case 10:    case 10:
1271  #line 175 "parse-gram.y"  #line 179 "parse-gram.y"
1272      { error_verbose = 1; }      { error_verbose = 1; }
1273      break;      break;
1274    
1275    case 11:    case 11:
1276  #line 176 "parse-gram.y"  #line 180 "parse-gram.y"
1277      { expected_conflicts = yyvsp[0].integer; }      { expected_conflicts = yyvsp[0].integer; }
1278      break;      break;
1279    
1280    case 12:    case 12:
1281  #line 177 "parse-gram.y"  #line 181 "parse-gram.y"
1282      { spec_file_prefix = yyvsp[0].chars; }      { spec_file_prefix = yyvsp[0].chars; }
1283      break;      break;
1284    
1285    case 13:    case 13:
1286  #line 178 "parse-gram.y"  #line 182 "parse-gram.y"
1287      { glr_parser = 1; }      { glr_parser = 1; }
1288      break;      break;
1289    
1290    case 14:    case 14:
1291  #line 179 "parse-gram.y"  #line 183 "parse-gram.y"
1292      { add_param ("lex_param", yyvsp[0].chars, yylsp[0]); }      { add_param ("lex_param", yyvsp[0].chars, yylsp[0]); }
1293      break;      break;
1294    
1295    case 15:    case 15:
1296  #line 180 "parse-gram.y"  #line 184 "parse-gram.y"
1297      { locations_flag = 1; }      { locations_flag = 1; }
1298      break;      break;
1299    
1300    case 16:    case 16:
1301  #line 181 "parse-gram.y"  #line 185 "parse-gram.y"
1302      { spec_name_prefix = yyvsp[0].chars; }      { spec_name_prefix = yyvsp[0].chars; }
1303      break;      break;
1304    
1305    case 17:    case 17:
1306  #line 182 "parse-gram.y"  #line 186 "parse-gram.y"
1307      { no_lines_flag = 1; }      { no_lines_flag = 1; }
1308      break;      break;
1309    
1310    case 18:    case 18:
1311  #line 183 "parse-gram.y"  #line 187 "parse-gram.y"
1312      { spec_outfile = yyvsp[0].chars; }      { spec_outfile = yyvsp[0].chars; }
1313      break;      break;
1314    
1315    case 19:    case 19:
1316  #line 184 "parse-gram.y"  #line 188 "parse-gram.y"
1317      { add_param ("parse_param", yyvsp[0].chars, yylsp[0]); }      { add_param ("parse_param", yyvsp[0].chars, yylsp[0]); }
1318      break;      break;
1319    
1320    case 20:    case 20:
1321  #line 185 "parse-gram.y"  #line 189 "parse-gram.y"
1322      { pure_parser = 1; }      { pure_parser = 1; }
1323      break;      break;
1324    
1325    case 21:    case 21:
1326  #line 186 "parse-gram.y"  #line 190 "parse-gram.y"
1327      { skeleton = yyvsp[0].chars; }      { skeleton = yyvsp[0].chars; }
1328      break;      break;
1329    
1330    case 22:    case 22:
1331  #line 187 "parse-gram.y"  #line 191 "parse-gram.y"
1332      { token_table_flag = 1; }      { token_table_flag = 1; }
1333      break;      break;
1334    
1335    case 23:    case 23:
1336  #line 188 "parse-gram.y"  #line 192 "parse-gram.y"
1337      { report_flag = 1; }      { report_flag = 1; }
1338      break;      break;
1339    
1340    case 24:    case 24:
1341  #line 189 "parse-gram.y"  #line 193 "parse-gram.y"
1342      { yacc_flag = 1; }      { yacc_flag = 1; }
1343      break;      break;
1344    
1345    case 28:    case 28:
1346  #line 197 "parse-gram.y"  #line 201 "parse-gram.y"
1347      {      {
1348        grammar_start_symbol_set (yyvsp[0].symbol, yylsp[0]);        grammar_start_symbol_set (yyvsp[0].symbol, yylsp[0]);
1349      }      }
1350      break;      break;
1351    
1352    case 29:    case 29:
1353  #line 201 "parse-gram.y"  #line 205 "parse-gram.y"
1354      {      {
1355        typed = 1;        typed = 1;
1356        MUSCLE_INSERT_INT ("stype_line", yylsp[0].start.line);        MUSCLE_INSERT_INT ("stype_line", yylsp[0].start.line);
# Line 1358  yyreduce: Line 1359  yyreduce:
1359      break;      break;
1360    
1361    case 30:    case 30:
1362  #line 207 "parse-gram.y"  #line 211 "parse-gram.y"
     { current_braced_code = destructor_braced_code; }  
     break;  
   
   case 31:  
 #line 209 "parse-gram.y"  
1363      {      {
1364        symbol_list *list;        symbol_list *list;
1365        for (list = yyvsp[0].list; list; list = list->next)        for (list = yyvsp[0].list; list; list = list->next)
1366          symbol_destructor_set (list->sym, yyvsp[-1].chars, yylsp[-1]);          symbol_destructor_set (list->sym, yyvsp[-1].chars, yylsp[-1]);
1367        symbol_list_free (yyvsp[0].list);        symbol_list_free (yyvsp[0].list);
       current_braced_code = action_braced_code;  
1368      }      }
1369      break;      break;
1370    
1371    case 32:    case 31:
1372  #line 217 "parse-gram.y"  #line 218 "parse-gram.y"
     { current_braced_code = printer_braced_code; }  
     break;  
   
   case 33:  
 #line 219 "parse-gram.y"  
1373      {      {
1374        symbol_list *list;        symbol_list *list;
1375        for (list = yyvsp[0].list; list; list = list->next)        for (list = yyvsp[0].list; list; list = list->next)
1376          symbol_printer_set (list->sym, yyvsp[-1].chars, list->location);          symbol_printer_set (list->sym, yyvsp[-1].chars, list->location);
1377        symbol_list_free (yyvsp[0].list);        symbol_list_free (yyvsp[0].list);
       current_braced_code = action_braced_code;  
1378      }      }
1379      break;      break;
1380    
1381    case 34:    case 32:
1382  #line 229 "parse-gram.y"  #line 227 "parse-gram.y"
1383      { current_class = nterm_sym; }      { current_class = nterm_sym; }
1384      break;      break;
1385    
1386    case 35:    case 33:
1387  #line 230 "parse-gram.y"  #line 228 "parse-gram.y"
1388      {      {
1389        current_class = unknown_sym;        current_class = unknown_sym;
1390        current_type = NULL;        current_type = NULL;
1391      }      }
1392      break;      break;
1393    
1394    case 36:    case 34:
1395  #line 234 "parse-gram.y"  #line 232 "parse-gram.y"
1396      { current_class = token_sym; }      { current_class = token_sym; }
1397      break;      break;
1398    
1399    case 37:    case 35:
1400  #line 235 "parse-gram.y"  #line 233 "parse-gram.y"
1401      {      {
1402        current_class = unknown_sym;        current_class = unknown_sym;
1403        current_type = NULL;        current_type = NULL;
1404      }      }
1405      break;      break;
1406    
1407    case 38:    case 36:
1408  #line 240 "parse-gram.y"  #line 238 "parse-gram.y"
1409      {      {
1410        symbol_list *list;        symbol_list *list;
1411        for (list = yyvsp[0].list; list; list = list->next)        for (list = yyvsp[0].list; list; list = list->next)
# Line 1425  yyreduce: Line 1414  yyreduce:
1414      }      }
1415      break;      break;
1416    
1417    case 39:    case 37:
1418  #line 250 "parse-gram.y"  #line 248 "parse-gram.y"
1419      {      {
1420        symbol_list *list;        symbol_list *list;
1421        ++current_prec;        ++current_prec;
# Line 1440  yyreduce: Line 1429  yyreduce:
1429      }      }
1430      break;      break;
1431    
1432    case 40:    case 38:
1433  #line 264 "parse-gram.y"  #line 262 "parse-gram.y"
1434      { yyval.assoc = left_assoc; }      { yyval.assoc = left_assoc; }
1435      break;      break;
1436    
1437    case 41:    case 39:
1438  #line 265 "parse-gram.y"  #line 263 "parse-gram.y"
1439      { yyval.assoc = right_assoc; }      { yyval.assoc = right_assoc; }
1440      break;      break;
1441    
1442    case 42:    case 40:
1443  #line 266 "parse-gram.y"  #line 264 "parse-gram.y"
1444      { yyval.assoc = non_assoc; }      { yyval.assoc = non_assoc; }
1445      break;      break;
1446    
1447    case 43:    case 41:
1448  #line 270 "parse-gram.y"  #line 268 "parse-gram.y"
1449      { current_type = NULL; }      { current_type = NULL; }
1450      break;      break;
1451    
1452    case 44:    case 42:
1453  #line 271 "parse-gram.y"  #line 269 "parse-gram.y"
1454      { current_type = yyvsp[0].uniqstr; }      { current_type = yyvsp[0].uniqstr; }
1455      break;      break;
1456    
1457    case 45:    case 43:
1458  #line 277 "parse-gram.y"  #line 275 "parse-gram.y"
1459      { yyval.list = symbol_list_new (yyvsp[0].symbol, yylsp[0]); }      { yyval.list = symbol_list_new (yyvsp[0].symbol, yylsp[0]); }
1460      break;      break;
1461    
1462    case 46:    case 44:
1463  #line 278 "parse-gram.y"  #line 276 "parse-gram.y"
1464      { yyval.list = symbol_list_prepend (yyvsp[-1].list, yyvsp[0].symbol, yylsp[0]); }      { yyval.list = symbol_list_prepend (yyvsp[-1].list, yyvsp[0].symbol, yylsp[0]); }
1465      break;      break;
1466    
1467    case 47:    case 45:
1468  #line 284 "parse-gram.y"  #line 282 "parse-gram.y"
1469      {      {
1470         current_type = yyvsp[0].uniqstr;         current_type = yyvsp[0].uniqstr;
1471       }       }
1472      break;      break;
1473    
1474    case 48:    case 46:
1475  #line 288 "parse-gram.y"  #line 286 "parse-gram.y"
1476      {      {
1477         symbol_class_set (yyvsp[0].symbol, current_class, yylsp[0]);         symbol_class_set (yyvsp[0].symbol, current_class, yylsp[0]);
1478         symbol_type_set (yyvsp[0].symbol, current_type, yylsp[0]);         symbol_type_set (yyvsp[0].symbol, current_type, yylsp[0]);
1479       }       }
1480      break;      break;
1481    
1482    case 49:    case 47:
1483  #line 293 "parse-gram.y"  #line 291 "parse-gram.y"
1484      {      {
1485        symbol_class_set (yyvsp[-1].symbol, current_class, yylsp[-1]);        symbol_class_set (yyvsp[-1].symbol, current_class, yylsp[-1]);
1486        symbol_type_set (yyvsp[-1].symbol, current_type, yylsp[-1]);        symbol_type_set (yyvsp[-1].symbol, current_type, yylsp[-1]);
# Line 1499  yyreduce: Line 1488  yyreduce:
1488      }      }
1489      break;      break;
1490    
1491    case 50:    case 48:
1492  #line 299 "parse-gram.y"  #line 297 "parse-gram.y"
1493      {      {
1494        symbol_class_set (yyvsp[-1].symbol, current_class, yylsp[-1]);        symbol_class_set (yyvsp[-1].symbol, current_class, yylsp[-1]);
1495        symbol_type_set (yyvsp[-1].symbol, current_type, yylsp[-1]);        symbol_type_set (yyvsp[-1].symbol, current_type, yylsp[-1]);
# Line 1508  yyreduce: Line 1497  yyreduce:
1497      }      }
1498      break;      break;
1499    
1500    case 51:    case 49:
1501  #line 305 "parse-gram.y"  #line 303 "parse-gram.y"
1502      {      {
1503        symbol_class_set (yyvsp[-2].symbol, current_class, yylsp[-2]);        symbol_class_set (yyvsp[-2].symbol, current_class, yylsp[-2]);
1504        symbol_type_set (yyvsp[-2].symbol, current_type, yylsp[-2]);        symbol_type_set (yyvsp[-2].symbol, current_type, yylsp[-2]);
# Line 1518  yyreduce: Line 1507  yyreduce:
1507      }      }
1508      break;      break;
1509    
1510    case 57:    case 55:
1511  #line 334 "parse-gram.y"  #line 332 "parse-gram.y"
1512      {      {
1513        if (yacc_flag)        if (yacc_flag)
1514          complain_at (yyloc, _("POSIX forbids declarations in the grammar"));          complain_at (yyloc, _("POSIX forbids declarations in the grammar"));
1515      }      }
1516      break;      break;
1517    
1518    case 58:    case 56:
1519  #line 339 "parse-gram.y"  #line 337 "parse-gram.y"
1520      {      {
1521        yyerrok;        yyerrok;
1522      }      }
1523      break;      break;
1524    
1525    case 60:    case 58:
1526  #line 346 "parse-gram.y"  #line 344 "parse-gram.y"
1527      { current_lhs = yyvsp[0].symbol; current_lhs_location = yylsp[0]; }      { current_lhs = yyvsp[0].symbol; current_lhs_location = yylsp[0]; }
1528      break;      break;
1529    
1530    case 62:    case 60:
1531  #line 350 "parse-gram.y"  #line 348 "parse-gram.y"
1532      { grammar_rule_end (yylsp[0]); }      { grammar_rule_end (yylsp[0]); }
1533      break;      break;
1534    
1535    case 63:    case 61:
1536  #line 351 "parse-gram.y"  #line 349 "parse-gram.y"
1537      { grammar_rule_end (yylsp[0]); }      { grammar_rule_end (yylsp[0]); }
1538      break;      break;
1539    
1540    case 64:    case 62:
1541  #line 356 "parse-gram.y"  #line 354 "parse-gram.y"
1542      { grammar_rule_begin (current_lhs, current_lhs_location); }      { grammar_rule_begin (current_lhs, current_lhs_location); }
1543      break;      break;
1544    
1545    case 65:    case 63:
1546  #line 358 "parse-gram.y"  #line 356 "parse-gram.y"
1547      { grammar_current_rule_symbol_append (yyvsp[0].symbol, yylsp[0]); }      { grammar_current_rule_symbol_append (yyvsp[0].symbol, yylsp[0]); }
1548      break;      break;
1549    
1550    case 66:    case 64:
1551  #line 360 "parse-gram.y"  #line 358 "parse-gram.y"
1552      { grammar_current_rule_action_append (yyvsp[0].chars, yylsp[0]); }      { grammar_current_rule_action_append (yyvsp[0].chars, yylsp[0]); }
1553      break;      break;
1554    
1555    case 67:    case 65:
1556  #line 362 "parse-gram.y"  #line 360 "parse-gram.y"
1557      { grammar_current_rule_prec_set (yyvsp[0].symbol, yylsp[0]); }      { grammar_current_rule_prec_set (yyvsp[0].symbol, yylsp[0]); }
1558      break;      break;
1559    
1560    case 68:    case 66:
1561  #line 364 "parse-gram.y"  #line 362 "parse-gram.y"
1562      { grammar_current_rule_dprec_set (yyvsp[0].integer, yylsp[0]); }      { grammar_current_rule_dprec_set (yyvsp[0].integer, yylsp[0]); }
1563      break;      break;
1564    
1565    case 69:    case 67:
1566  #line 366 "parse-gram.y"  #line 364 "parse-gram.y"
1567      { grammar_current_rule_merge_set (yyvsp[0].uniqstr, yylsp[0]); }      { grammar_current_rule_merge_set (yyvsp[0].uniqstr, yylsp[0]); }
1568      break;      break;
1569    
1570    case 70:    case 68:
1571  #line 370 "parse-gram.y"  #line 368 "parse-gram.y"
1572      { yyval.symbol = yyvsp[0].symbol; }      { yyval.symbol = yyvsp[0].symbol; }
1573      break;      break;
1574    
1575    case 71:    case 69:
1576  #line 371 "parse-gram.y"  #line 369 "parse-gram.y"
1577      { yyval.symbol = yyvsp[0].symbol; }      { yyval.symbol = yyvsp[0].symbol; }
1578      break;      break;
1579    
1580    case 72:    case 70:
1581  #line 376 "parse-gram.y"  #line 374 "parse-gram.y"
1582      { yyval.chars = yyvsp[0].chars; }      { yyval.chars = yyvsp[0].chars; }
1583      break;      break;
1584    
1585    case 73:    case 71:
1586  #line 382 "parse-gram.y"  #line 380 "parse-gram.y"
1587      {      {
1588        yyval.symbol = symbol_get (yyvsp[0].chars, yylsp[0]);        yyval.symbol = symbol_get (yyvsp[0].chars, yylsp[0]);
1589        symbol_class_set (yyval.symbol, token_sym, yylsp[0]);        symbol_class_set (yyval.symbol, token_sym, yylsp[0]);
1590      }      }
1591      break;      break;
1592    
1593    case 74:    case 72:
1594  #line 391 "parse-gram.y"  #line 389 "parse-gram.y"
     {  
       yyval.chars = yyvsp[0].chars + 1;  
       yyval.chars[strlen (yyval.chars) - 1] = '\0';  
     }  
     break;  
   
   case 75:  
 #line 400 "parse-gram.y"  
1595      {      {
1596        yyval.chars = yyvsp[0].chars + 1;        yyval.chars = yyvsp[0].chars + 1;
1597        yyval.chars[strlen (yyval.chars) - 1] = '\0';        yyval.chars[strlen (yyval.chars) - 1] = '\0';
1598      }      }
1599      break;      break;
1600    
1601    case 77:    case 74:
1602  #line 409 "parse-gram.y"  #line 398 "parse-gram.y"
1603      {      {
1604        epilogue_augment (yyvsp[0].chars, yylsp[0]);        epilogue_augment (yyvsp[0].chars, yylsp[0]);
1605        scanner_last_string_free ();        scanner_last_string_free ();
# Line 1629  yyreduce: Line 1610  yyreduce:
1610      }      }
1611    
1612  /* Line 991 of yacc.c.  */  /* Line 991 of yacc.c.  */
1613  #line 1632 "parse-gram.c"  #line 1613 "parse-gram.c"
1614    
1615    yyvsp -= yylen;    yyvsp -= yylen;
1616    yyssp -= yylen;    yyssp -= yylen;
# Line 1719  yyerrlab: Line 1700  yyerrlab:
1700           error, discard it.  */           error, discard it.  */
1701    
1702        /* Return failure if at end of input.  */        /* Return failure if at end of input.  */
1703        if (yytoken == YYEOF)        if (yychar == YYEOF)
1704          {          {
1705            /* Pop the error token.  */            /* Pop the error token.  */
1706            YYPOPSTACK;            YYPOPSTACK;
# Line 1735  yyerrlab: Line 1716  yyerrlab:
1716    
1717        YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);        YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
1718        yydestruct (yytoken, &yylval, &yylloc);        yydestruct (yytoken, &yylval, &yylloc);
1719        yytoken = YYEMPTY;        yychar = YYEMPTY;
1720      }      }
1721    
1722    /* Else will try to reuse lookahead token after shifting the error    /* Else will try to reuse lookahead token after shifting the error
# Line 1820  yyreturn: Line 1801  yyreturn:
1801  }  }
1802    
1803    
1804  #line 415 "parse-gram.y"  #line 404 "parse-gram.y"
1805    
1806    
1807    
# Line 1833  static YYLTYPE Line 1814  static YYLTYPE
1814  lloc_default (YYLTYPE const *rhs, int n)  lloc_default (YYLTYPE const *rhs, int n)
1815  {  {
1816    int i;    int i;
   int j;  
1817    YYLTYPE r;    YYLTYPE r;
1818    r.start = r.end = rhs[n].end;    r.start = r.end = rhs[n].end;
1819    
1820      /* Ignore empty nonterminals the start of the the right-hand side.
1821         Do not bother to ignore them at the end of the right-hand side,
1822         since empty nonterminals have the same end as their predecessors.  */
1823    for (i = 1; i <= n; i++)    for (i = 1; i <= n; i++)
1824      if (! equal_boundaries (rhs[i].start, rhs[i].end))      if (! equal_boundaries (rhs[i].start, rhs[i].end))
1825        {        {
1826          r.start = rhs[i].start;          r.start = rhs[i].start;
   
         for (j = n; i < j; j--)  
           if (! equal_boundaries (rhs[j].start, rhs[j].end))  
             break;  
         r.end = rhs[j].end;  
   
1827          break;          break;
1828        }        }
1829    
# Line 1858  lloc_default (YYLTYPE const *rhs, int n) Line 1835  lloc_default (YYLTYPE const *rhs, int n)
1835     declaration DECL and location LOC.  */     declaration DECL and location LOC.  */
1836    
1837  static void  static void
1838  add_param (char const *type, char const *decl, location loc)  add_param (char const *type, char *decl, location loc)
1839  {  {
1840    static char const alphanum[] =    static char const alphanum[] =
1841      "0123456789"      "0123456789"
# Line 1867  add_param (char const *type, char const Line 1844  add_param (char const *type, char const
1844      "_";      "_";
1845    char const *alpha = alphanum + 10;    char const *alpha = alphanum + 10;
1846    char const *name_start = NULL;    char const *name_start = NULL;
1847    char const *p;    char *p;
1848    
1849    for (p = decl; *p; p++)    for (p = decl; *p; p++)
1850      if ((p == decl || ! strchr (alphanum, p[-1])) && strchr (alpha, p[0]))      if ((p == decl || ! strchr (alphanum, p[-1])) && strchr (alpha, p[0]))
1851        name_start = p;        name_start = p;
1852    
1853      /* Strip the surrounding '{' and '}'.  */
1854      decl++;
1855      p[-1] = '\0';
1856    
1857    if (! name_start)    if (! name_start)
1858      complain_at (loc, _("missing identifier in parameter declaration"));      complain_at (loc, _("missing identifier in parameter declaration"));
1859    else    else
# Line 1895  add_param (char const *type, char const Line 1876  add_param (char const *type, char const
1876    scanner_last_string_free ();    scanner_last_string_free ();
1877  }  }
1878    
1879  /*------------------------------------------------------------------.  /*----------------------------------------------------.
1880  | When debugging the parser, display tokens' locations and values.  |  | When debugging the parser, display tokens' values.  |
1881  `------------------------------------------------------------------*/  `----------------------------------------------------*/
1882    
1883  static void  static void
1884  print_token_value (FILE *file, int type, YYSTYPE const *value)  print_token_value (FILE *file, int type, YYSTYPE const *value)
# Line 1922  print_token_value (FILE *file, int type, Line 1903  print_token_value (FILE *file, int type,
1903        break;        break;
1904    
1905      case BRACED_CODE:      case BRACED_CODE:
1906        case PERCENT_DESTRUCTOR:
1907        case PERCENT_LEX_PARAM:
1908        case PERCENT_PARSE_PARAM:
1909        case PERCENT_PRINTER:
1910        case PERCENT_UNION:
1911      case PROLOGUE:      case PROLOGUE:
1912      case EPILOGUE:      case EPILOGUE:
1913        fprintf (file, " = {{ %s }}", value->chars);        fprintf (file, " = {{ %s }}", value->chars);
# Line 1939  gram_error (location const *loc, char co Line 1925  gram_error (location const *loc, char co
1925    complain_at (*loc, "%s", msg);    complain_at (*loc, "%s", msg);
1926  }  }
1927    
1928    char const *
1929    token_name (int type)
1930    {
1931      return yytname[type];
1932    }
1933    

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.38

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26