home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1999 May / pcp151c.iso / misc / src / install / modutils / genksyms / parse.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-07-10  |  44.3 KB  |  1,467 lines

  1.  
  2. /*  A Bison parser, made from parse.y
  3.  by  GNU Bison version 1.25
  4.   */
  5.  
  6. #define YYBISON 1  /* Identify Bison output.  */
  7.  
  8. #define    ASM_KEYW    258
  9. #define    ATTRIBUTE_KEYW    259
  10. #define    AUTO_KEYW    260
  11. #define    CHAR_KEYW    261
  12. #define    CONST_KEYW    262
  13. #define    DOUBLE_KEYW    263
  14. #define    ENUM_KEYW    264
  15. #define    EXTERN_KEYW    265
  16. #define    FLOAT_KEYW    266
  17. #define    INLINE_KEYW    267
  18. #define    INT_KEYW    268
  19. #define    LONG_KEYW    269
  20. #define    REGISTER_KEYW    270
  21. #define    SHORT_KEYW    271
  22. #define    SIGNED_KEYW    272
  23. #define    STATIC_KEYW    273
  24. #define    STRUCT_KEYW    274
  25. #define    TYPEDEF_KEYW    275
  26. #define    UNION_KEYW    276
  27. #define    UNSIGNED_KEYW    277
  28. #define    VOID_KEYW    278
  29. #define    VOLATILE_KEYW    279
  30. #define    EXPORT_SYMBOL_KEYW    280
  31. #define    ASM_PHRASE    281
  32. #define    ATTRIBUTE_PHRASE    282
  33. #define    BRACE_PHRASE    283
  34. #define    BRACKET_PHRASE    284
  35. #define    EXPRESSION_PHRASE    285
  36. #define    CHAR    286
  37. #define    DOTS    287
  38. #define    IDENT    288
  39. #define    INT    289
  40. #define    REAL    290
  41. #define    STRING    291
  42. #define    TYPE    292
  43. #define    OTHER    293
  44. #define    FILENAME    294
  45.  
  46. #line 24 "parse.y"
  47.  
  48. #ident "$Id: parse.c,v 1.2 1998/05/18 15:35:44 ewt Exp $"
  49.  
  50. #include <assert.h>
  51. #include "genksyms.h"
  52.  
  53. static int is_typedef;
  54. static char *current_name;
  55. static struct string_list *decl_spec;
  56.  
  57. static void yyerror(const char *);
  58.  
  59. static inline void
  60. remove_node(struct string_list **p)
  61. {
  62.   struct string_list *node = *p;
  63.   *p = node->next;
  64.   free_node(node);
  65. }
  66.  
  67. static inline void
  68. remove_list(struct string_list **pb, struct string_list **pe)
  69. {
  70.   struct string_list *b = *pb, *e = *pe;
  71.   *pb = e;
  72.   free_list(b, e);
  73. }
  74.  
  75. #ifndef YYSTYPE
  76. #define YYSTYPE int
  77. #endif
  78. #ifndef YYDEBUG
  79. #define YYDEBUG 1
  80. #endif
  81.  
  82. #include <stdio.h>
  83.  
  84. #ifndef __cplusplus
  85. #ifndef __STDC__
  86. #define const
  87. #endif
  88. #endif
  89.  
  90.  
  91.  
  92. #define    YYFINAL        166
  93. #define    YYFLAG        -32768
  94. #define    YYNTBASE    49
  95.  
  96. #define YYTRANSLATE(x) ((unsigned)(x) <= 294 ? yytranslate[x] : 93)
  97.  
  98. static const char yytranslate[] = {     0,
  99.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  100.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  101.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  102.      2,     2,     2,     2,     2,     2,     2,     2,     2,    44,
  103.     45,    43,     2,    42,     2,     2,     2,     2,     2,     2,
  104.      2,     2,     2,     2,     2,     2,     2,    48,    40,     2,
  105.     46,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  106.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  107.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  108.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  109.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  110.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  111.      2,     2,    47,     2,    41,     2,     2,     2,     2,     2,
  112.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  113.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  114.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  115.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  116.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  117.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  118.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  119.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  120.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  121.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  122.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  123.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  124.      2,     2,     2,     2,     2,     1,     2,     3,     4,     5,
  125.      6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
  126.     16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
  127.     26,    27,    28,    29,    30,    31,    32,    33,    34,    35,
  128.     36,    37,    38,    39
  129. };
  130.  
  131. #if YYDEBUG != 0
  132. static const short yyprhs[] = {     0,
  133.      0,     2,     5,     6,     9,    10,    14,    16,    18,    20,
  134.     22,    25,    28,    32,    33,    35,    37,    41,    46,    47,
  135.     49,    51,    54,    56,    58,    60,    62,    64,    66,    68,
  136.     70,    72,    75,    78,    81,    85,    89,    93,    96,    99,
  137.    102,   104,   106,   108,   110,   112,   114,   116,   118,   120,
  138.    122,   125,   126,   128,   130,   133,   135,   137,   139,   142,
  139.    144,   146,   151,   156,   159,   163,   167,   170,   172,   174,
  140.    176,   181,   186,   189,   193,   197,   200,   202,   206,   207,
  141.    209,   211,   215,   218,   221,   223,   224,   226,   228,   233,
  142.    238,   241,   245,   249,   253,   254,   256,   259,   263,   267,
  143.    268,   270,   272,   275,   279,   282,   283,   285,   287,   291,
  144.    294,   297,   299,   302,   303,   305,   308,   309,   311
  145. };
  146.  
  147. static const short yyrhs[] = {    50,
  148.      0,    49,    50,     0,     0,    51,    52,     0,     0,    20,
  149.     53,    54,     0,    54,     0,    78,     0,    90,     0,    92,
  150.      0,     1,    40,     0,     1,    41,     0,    58,    55,    40,
  151.      0,     0,    56,     0,    57,     0,    56,    42,    57,     0,
  152.     68,    91,    89,    79,     0,     0,    59,     0,    60,     0,
  153.     59,    60,     0,    61,     0,    62,     0,     5,     0,    15,
  154.      0,    18,     0,    10,     0,    12,     0,    63,     0,    67,
  155.      0,    19,    33,     0,    21,    33,     0,     9,    33,     0,
  156.     19,    33,    81,     0,    21,    33,    81,     0,     9,    33,
  157.     28,     0,     9,    28,     0,    19,    81,     0,    21,    81,
  158.      0,     6,     0,    16,     0,    13,     0,    14,     0,    17,
  159.      0,    22,     0,    11,     0,     8,     0,    23,     0,    37,
  160.      0,    43,    65,     0,     0,    66,     0,    67,     0,    66,
  161.     67,     0,     7,     0,    24,     0,    27,     0,    64,    68,
  162.      0,    69,     0,    33,     0,    69,    44,    72,    45,     0,
  163.     69,    44,     1,    45,     0,    69,    29,     0,    44,    68,
  164.     45,     0,    44,     1,    45,     0,    64,    70,     0,    71,
  165.      0,    33,     0,    37,     0,    71,    44,    72,    45,     0,
  166.     71,    44,     1,    45,     0,    71,    29,     0,    44,    70,
  167.     45,     0,    44,     1,    45,     0,    73,    32,     0,    73,
  168.      0,    74,    42,    32,     0,     0,    74,     0,    75,     0,
  169.     74,    42,    75,     0,    59,    76,     0,    64,    76,     0,
  170.     77,     0,     0,    33,     0,    37,     0,    77,    44,    72,
  171.     45,     0,    77,    44,     1,    45,     0,    77,    29,     0,
  172.     44,    76,    45,     0,    44,     1,    45,     0,    58,    68,
  173.     28,     0,     0,    80,     0,    46,    30,     0,    47,    82,
  174.     41,     0,    47,     1,    41,     0,     0,    83,     0,    84,
  175.      0,    83,    84,     0,    58,    85,    40,     0,     1,    40,
  176.      0,     0,    86,     0,    87,     0,    86,    42,    87,     0,
  177.     70,    89,     0,    33,    88,     0,    88,     0,    48,    30,
  178.      0,     0,    27,     0,    26,    40,     0,     0,    26,     0,
  179.     25,    44,    33,    45,    40,     0
  180. };
  181.  
  182. #endif
  183.  
  184. #if YYDEBUG != 0
  185. static const short yyrline[] = { 0,
  186.     97,    99,   102,   105,   108,   110,   111,   112,   113,   114,
  187.    115,   116,   119,   133,   135,   138,   147,   159,   165,   167,
  188.    169,   171,   174,   182,   185,   186,   186,   186,   186,   189,
  189.    191,   195,   197,   199,   203,   210,   217,   226,   227,   228,
  190.    231,   233,   234,   235,   236,   237,   238,   239,   240,   241,
  191.    244,   249,   251,   254,   256,   259,   260,   260,   263,   265,
  192.    268,   278,   280,   282,   284,   286,   292,   294,   297,   299,
  193.    300,   302,   304,   306,   308,   312,   314,   315,   318,   320,
  194.    323,   325,   329,   334,   337,   340,   342,   351,   356,   358,
  195.    360,   362,   364,   368,   377,   379,   383,   388,   390,   393,
  196.    395,   398,   400,   403,   406,   410,   412,   415,   417,   420,
  197.    422,   423,   426,   430,   432,   435,   439,   441,   444
  198. };
  199. #endif
  200.  
  201.  
  202. #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
  203.  
  204. static const char * const yytname[] = {   "$","error","$undefined.","ASM_KEYW",
  205. "ATTRIBUTE_KEYW","AUTO_KEYW","CHAR_KEYW","CONST_KEYW","DOUBLE_KEYW","ENUM_KEYW",
  206. "EXTERN_KEYW","FLOAT_KEYW","INLINE_KEYW","INT_KEYW","LONG_KEYW","REGISTER_KEYW",
  207. "SHORT_KEYW","SIGNED_KEYW","STATIC_KEYW","STRUCT_KEYW","TYPEDEF_KEYW","UNION_KEYW",
  208. "UNSIGNED_KEYW","VOID_KEYW","VOLATILE_KEYW","EXPORT_SYMBOL_KEYW","ASM_PHRASE",
  209. "ATTRIBUTE_PHRASE","BRACE_PHRASE","BRACKET_PHRASE","EXPRESSION_PHRASE","CHAR",
  210. "DOTS","IDENT","INT","REAL","STRING","TYPE","OTHER","FILENAME","';'","'}'","','",
  211. "'*'","'('","')'","'='","'{'","':'","declaration_seq","declaration","@1","declaration1",
  212. "@2","simple_declaration","init_declarator_list_opt","init_declarator_list",
  213. "init_declarator","decl_specifier_seq_opt","decl_specifier_seq","decl_specifier",
  214. "storage_class_specifier","type_specifier","simple_type_specifier","ptr_operator",
  215. "cva_qualifier_seq_opt","cva_qualifier_seq","cva_qualifier","declarator","direct_declarator",
  216. "nested_declarator","direct_nested_declarator","parameter_declaration_clause",
  217. "parameter_declaration_list_opt","parameter_declaration_list","parameter_declaration",
  218. "m_abstract_declarator","direct_m_abstract_declarator","function_definition",
  219. "initializer_opt","initializer","class_body","member_specification_opt","member_specification",
  220. "member_declaration","member_declarator_list_opt","member_declarator_list","member_declarator",
  221. "member_bitfield_declarator","attribute_opt","asm_definition","asm_phrase_opt",
  222. "export_definition", NULL
  223. };
  224. #endif
  225.  
  226. static const short yyr1[] = {     0,
  227.     49,    49,    51,    50,    53,    52,    52,    52,    52,    52,
  228.     52,    52,    54,    55,    55,    56,    56,    57,    58,    58,
  229.     59,    59,    60,    60,    61,    61,    61,    61,    61,    62,
  230.     62,    62,    62,    62,    62,    62,    62,    62,    62,    62,
  231.     63,    63,    63,    63,    63,    63,    63,    63,    63,    63,
  232.     64,    65,    65,    66,    66,    67,    67,    67,    68,    68,
  233.     69,    69,    69,    69,    69,    69,    70,    70,    71,    71,
  234.     71,    71,    71,    71,    71,    72,    72,    72,    73,    73,
  235.     74,    74,    75,    76,    76,    77,    77,    77,    77,    77,
  236.     77,    77,    77,    78,    79,    79,    80,    81,    81,    82,
  237.     82,    83,    83,    84,    84,    85,    85,    86,    86,    87,
  238.     87,    87,    88,    89,    89,    90,    91,    91,    92
  239. };
  240.  
  241. static const short yyr2[] = {     0,
  242.      1,     2,     0,     2,     0,     3,     1,     1,     1,     1,
  243.      2,     2,     3,     0,     1,     1,     3,     4,     0,     1,
  244.      1,     2,     1,     1,     1,     1,     1,     1,     1,     1,
  245.      1,     2,     2,     2,     3,     3,     3,     2,     2,     2,
  246.      1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
  247.      2,     0,     1,     1,     2,     1,     1,     1,     2,     1,
  248.      1,     4,     4,     2,     3,     3,     2,     1,     1,     1,
  249.      4,     4,     2,     3,     3,     2,     1,     3,     0,     1,
  250.      1,     3,     2,     2,     1,     0,     1,     1,     4,     4,
  251.      2,     3,     3,     3,     0,     1,     2,     3,     3,     0,
  252.      1,     1,     2,     3,     2,     0,     1,     1,     3,     2,
  253.      2,     1,     2,     0,     1,     2,     0,     1,     5
  254. };
  255.  
  256. static const short yydefact[] = {     3,
  257.      3,     1,     0,     2,     0,    25,    41,    56,    48,     0,
  258.     28,    47,    29,    43,    44,    26,    42,    45,    27,     0,
  259.      5,     0,    46,    49,    57,     0,     0,    58,    50,     4,
  260.      7,    14,    20,    21,    23,    24,    30,    31,     8,     9,
  261.     10,    11,    12,    38,    34,    32,     0,    39,    19,    33,
  262.     40,     0,   116,    61,    52,     0,     0,    15,    16,     0,
  263.    117,    60,    22,    37,    35,     0,   106,     0,     0,   102,
  264.      6,    14,    36,     0,    51,    53,    54,     0,     0,    13,
  265.      0,    59,   118,    94,   114,    64,     0,   105,    99,    69,
  266.     70,     0,     0,     0,   114,    68,     0,   107,   108,   112,
  267.     98,     0,   103,   117,     0,    55,    66,    65,    17,   115,
  268.     95,     0,    86,     0,    77,    80,    81,   111,     0,    69,
  269.      0,   113,    67,   110,    73,     0,   104,     0,   119,     0,
  270.     18,    96,    63,    87,    50,     0,    86,    83,    85,    62,
  271.     76,     0,    75,    74,     0,     0,   109,    97,     0,    88,
  272.      0,    84,    91,     0,    78,    82,    72,    71,    93,    92,
  273.      0,     0,    90,    89,     0,     0
  274. };
  275.  
  276. static const short yydefgoto[] = {     1,
  277.      2,     3,    30,    49,    31,    57,    58,    59,    67,    33,
  278.     34,    35,    36,    37,    60,    75,    76,    38,   104,    62,
  279.     95,    96,   114,   115,   116,   117,   138,   139,    39,   131,
  280.    132,    48,    68,    69,    70,    97,    98,    99,   100,   111,
  281.     40,    85,    41
  282. };
  283.  
  284. static const short yypact[] = {-32768,
  285.     16,-32768,   287,-32768,     2,-32768,-32768,-32768,-32768,   -14,
  286. -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,   -26,
  287. -32768,   -22,-32768,-32768,-32768,   -24,     8,-32768,-32768,-32768,
  288. -32768,    63,   400,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  289. -32768,-32768,-32768,-32768,    -5,     6,    76,-32768,   400,     6,
  290. -32768,    33,-32768,-32768,    11,    12,    28,    37,-32768,    63,
  291.    -11,   -20,-32768,-32768,-32768,    19,    30,    31,   120,-32768,
  292. -32768,    63,-32768,    57,-32768,    11,-32768,    65,    73,-32768,
  293.     63,-32768,-32768,-32768,    95,-32768,   164,-32768,-32768,    75,
  294. -32768,    21,   110,    68,    95,   -17,   105,   104,-32768,-32768,
  295. -32768,   108,-32768,   123,   111,-32768,-32768,-32768,-32768,-32768,
  296.    106,   109,   327,   113,   118,   114,-32768,-32768,   117,-32768,
  297.    121,-32768,-32768,-32768,-32768,   205,-32768,    30,-32768,   125,
  298. -32768,-32768,-32768,-32768,-32768,     7,    71,-32768,    17,-32768,
  299. -32768,   367,-32768,-32768,   122,   139,-32768,-32768,   144,-32768,
  300.    145,-32768,-32768,   246,-32768,-32768,-32768,-32768,-32768,-32768,
  301.    147,   148,-32768,-32768,   159,-32768
  302. };
  303.  
  304. static const short yypgoto[] = {-32768,
  305.    193,-32768,-32768,-32768,   146,-32768,-32768,   116,     0,   -85,
  306.    -33,-32768,-32768,-32768,   -66,-32768,-32768,   -45,   -27,-32768,
  307.    -55,-32768,  -122,-32768,-32768,    56,   -61,-32768,-32768,-32768,
  308. -32768,   -16,-32768,-32768,   130,-32768,-32768,    72,   112,   135,
  309. -32768,-32768,-32768
  310. };
  311.  
  312.  
  313. #define    YYLAST        437
  314.  
  315.  
  316. static const short yytable[] = {    63,
  317.     94,   113,    32,   146,    61,    51,    46,   149,    86,    77,
  318.     50,   125,    78,    44,    83,   165,    84,     8,    45,    52,
  319.     47,   119,    64,    87,    47,    94,   126,    94,    79,    65,
  320.    106,   162,    82,    73,    25,   -86,   121,    28,   123,   134,
  321.    113,    42,    43,   150,    54,   153,   137,    53,    72,    55,
  322.    136,   -86,    47,   120,    55,    56,   113,    91,    88,    89,
  323.    154,    94,    90,    55,    92,    74,    91,    80,   113,   137,
  324.    137,   101,    55,    92,   151,   152,    66,    93,    81,    63,
  325.      6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
  326.     16,    17,    18,    19,    20,    54,    22,    23,    24,    25,
  327.    120,   105,    28,   134,    91,    55,    56,   150,   -19,   107,
  328.     55,    92,    29,    55,   136,   -19,  -100,   108,   -19,   -19,
  329.    102,   110,    93,   -19,     6,     7,     8,     9,    10,    11,
  330.     12,    13,    14,    15,    16,    17,    18,    19,    20,   122,
  331.     22,    23,    24,    25,   127,   128,    28,    88,    83,   141,
  332.    129,   130,   -19,   133,   148,   142,    29,   140,   166,   -19,
  333.   -101,   143,   -19,   -19,   112,   144,   157,   -19,     6,     7,
  334.      8,     9,    10,    11,    12,    13,    14,    15,    16,    17,
  335.     18,    19,    20,   158,    22,    23,    24,    25,   159,   160,
  336.     28,   163,   164,     4,    71,   -79,   109,   156,   103,   147,
  337.     29,   118,     0,     0,     0,   145,     0,     0,   -79,     6,
  338.      7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
  339.     17,    18,    19,    20,     0,    22,    23,    24,    25,   124,
  340.      0,    28,     0,     0,     0,     0,   -79,     0,     0,     0,
  341.      0,    29,     0,     0,     0,     0,   161,     0,     0,   -79,
  342.      6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
  343.     16,    17,    18,    19,    20,     0,    22,    23,    24,    25,
  344.      0,     0,    28,     0,     0,     0,     0,   -79,     0,     0,
  345.      0,     0,    29,     0,     0,     0,     0,     5,     0,     0,
  346.    -79,     6,     7,     8,     9,    10,    11,    12,    13,    14,
  347.     15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
  348.     25,    26,    27,    28,     0,     0,     0,     0,     0,   -19,
  349.      0,     0,     0,    29,     0,     0,   -19,     0,     0,   -19,
  350.    -19,     6,     7,     8,     9,    10,    11,    12,    13,    14,
  351.     15,    16,    17,    18,    19,    20,     0,    22,    23,    24,
  352.     25,     0,     0,    28,     0,     0,     0,     0,     0,   134,
  353.      0,     0,     0,   135,     0,     0,     0,     0,     0,    55,
  354.    136,     6,     7,     8,     9,    10,    11,    12,    13,    14,
  355.     15,    16,    17,    18,    19,    20,     0,    22,    23,    24,
  356.     25,     0,     0,    28,     0,     0,     0,     0,   155,     0,
  357.      0,     0,     0,    29,     6,     7,     8,     9,    10,    11,
  358.     12,    13,    14,    15,    16,    17,    18,    19,    20,     0,
  359.     22,    23,    24,    25,     0,     0,    28,     0,     0,     0,
  360.      0,     0,     0,     0,     0,     0,    29
  361. };
  362.  
  363. static const short yycheck[] = {    33,
  364.     67,    87,     3,   126,    32,    22,    33,     1,    29,    55,
  365.     33,    29,     1,    28,    26,     0,    28,     7,    33,    44,
  366.     47,     1,    28,    44,    47,    92,    44,    94,    56,    46,
  367.     76,   154,    60,    50,    24,    29,    92,    27,    94,    33,
  368.    126,    40,    41,    37,    33,    29,   113,    40,    49,    43,
  369.     44,    45,    47,    33,    43,    44,   142,    37,    40,    41,
  370.     44,   128,    33,    43,    44,    33,    37,    40,   154,   136,
  371.    137,    41,    43,    44,   136,   137,     1,    48,    42,   113,
  372.      5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
  373.     15,    16,    17,    18,    19,    33,    21,    22,    23,    24,
  374.     33,    45,    27,    33,    37,    43,    44,    37,    33,    45,
  375.     43,    44,    37,    43,    44,    40,    41,    45,    43,    44,
  376.      1,    27,    48,    48,     5,     6,     7,     8,     9,    10,
  377.     11,    12,    13,    14,    15,    16,    17,    18,    19,    30,
  378.     21,    22,    23,    24,    40,    42,    27,    40,    26,    32,
  379.     40,    46,    33,    45,    30,    42,    37,    45,     0,    40,
  380.     41,    45,    43,    44,     1,    45,    45,    48,     5,     6,
  381.      7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
  382.     17,    18,    19,    45,    21,    22,    23,    24,    45,    45,
  383.     27,    45,    45,     1,    49,    32,    81,   142,    69,   128,
  384.     37,    90,    -1,    -1,    -1,     1,    -1,    -1,    45,     5,
  385.      6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
  386.     16,    17,    18,    19,    -1,    21,    22,    23,    24,    95,
  387.     -1,    27,    -1,    -1,    -1,    -1,    32,    -1,    -1,    -1,
  388.     -1,    37,    -1,    -1,    -1,    -1,     1,    -1,    -1,    45,
  389.      5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
  390.     15,    16,    17,    18,    19,    -1,    21,    22,    23,    24,
  391.     -1,    -1,    27,    -1,    -1,    -1,    -1,    32,    -1,    -1,
  392.     -1,    -1,    37,    -1,    -1,    -1,    -1,     1,    -1,    -1,
  393.     45,     5,     6,     7,     8,     9,    10,    11,    12,    13,
  394.     14,    15,    16,    17,    18,    19,    20,    21,    22,    23,
  395.     24,    25,    26,    27,    -1,    -1,    -1,    -1,    -1,    33,
  396.     -1,    -1,    -1,    37,    -1,    -1,    40,    -1,    -1,    43,
  397.     44,     5,     6,     7,     8,     9,    10,    11,    12,    13,
  398.     14,    15,    16,    17,    18,    19,    -1,    21,    22,    23,
  399.     24,    -1,    -1,    27,    -1,    -1,    -1,    -1,    -1,    33,
  400.     -1,    -1,    -1,    37,    -1,    -1,    -1,    -1,    -1,    43,
  401.     44,     5,     6,     7,     8,     9,    10,    11,    12,    13,
  402.     14,    15,    16,    17,    18,    19,    -1,    21,    22,    23,
  403.     24,    -1,    -1,    27,    -1,    -1,    -1,    -1,    32,    -1,
  404.     -1,    -1,    -1,    37,     5,     6,     7,     8,     9,    10,
  405.     11,    12,    13,    14,    15,    16,    17,    18,    19,    -1,
  406.     21,    22,    23,    24,    -1,    -1,    27,    -1,    -1,    -1,
  407.     -1,    -1,    -1,    -1,    -1,    -1,    37
  408. };
  409. /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
  410. #line 3 "/usr/lib/bison.simple"
  411.  
  412. /* Skeleton output parser for bison,
  413.    Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
  414.  
  415.    This program is free software; you can redistribute it and/or modify
  416.    it under the terms of the GNU General Public License as published by
  417.    the Free Software Foundation; either version 2, or (at your option)
  418.    any later version.
  419.  
  420.    This program is distributed in the hope that it will be useful,
  421.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  422.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  423.    GNU General Public License for more details.
  424.  
  425.    You should have received a copy of the GNU General Public License
  426.    along with this program; if not, write to the Free Software
  427.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  428.  
  429. /* As a special exception, when this file is copied by Bison into a
  430.    Bison output file, you may use that output file without restriction.
  431.    This special exception was added by the Free Software Foundation
  432.    in version 1.24 of Bison.  */
  433.  
  434. #ifndef alloca
  435. #ifdef __GNUC__
  436. #define alloca __builtin_alloca
  437. #else /* not GNU C.  */
  438. #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
  439. #include <alloca.h>
  440. #else /* not sparc */
  441. #if defined (MSDOS) && !defined (__TURBOC__)
  442. #include <malloc.h>
  443. #else /* not MSDOS, or __TURBOC__ */
  444. #if defined(_AIX)
  445. #include <malloc.h>
  446.  #pragma alloca
  447. #else /* not MSDOS, __TURBOC__, or _AIX */
  448. #ifdef __hpux
  449. #ifdef __cplusplus
  450. extern "C" {
  451. void *alloca (unsigned int);
  452. };
  453. #else /* not __cplusplus */
  454. void *alloca ();
  455. #endif /* not __cplusplus */
  456. #endif /* __hpux */
  457. #endif /* not _AIX */
  458. #endif /* not MSDOS, or __TURBOC__ */
  459. #endif /* not sparc.  */
  460. #endif /* not GNU C.  */
  461. #endif /* alloca not defined.  */
  462.  
  463. /* This is the parser code that is written into each bison parser
  464.   when the %semantic_parser declaration is not specified in the grammar.
  465.   It was written by Richard Stallman by simplifying the hairy parser
  466.   used when %semantic_parser is specified.  */
  467.  
  468. /* Note: there must be only one dollar sign in this file.
  469.    It is replaced by the list of actions, each action
  470.    as one case of the switch.  */
  471.  
  472. #define yyerrok        (yyerrstatus = 0)
  473. #define yyclearin    (yychar = YYEMPTY)
  474. #define YYEMPTY        -2
  475. #define YYEOF        0
  476. #define YYACCEPT    return(0)
  477. #define YYABORT     return(1)
  478. #define YYERROR        goto yyerrlab1
  479. /* Like YYERROR except do call yyerror.
  480.    This remains here temporarily to ease the
  481.    transition to the new meaning of YYERROR, for GCC.
  482.    Once GCC version 2 has supplanted version 1, this can go.  */
  483. #define YYFAIL        goto yyerrlab
  484. #define YYRECOVERING()  (!!yyerrstatus)
  485. #define YYBACKUP(token, value) \
  486. do                                \
  487.   if (yychar == YYEMPTY && yylen == 1)                \
  488.     { yychar = (token), yylval = (value);            \
  489.       yychar1 = YYTRANSLATE (yychar);                \
  490.       YYPOPSTACK;                        \
  491.       goto yybackup;                        \
  492.     }                                \
  493.   else                                \
  494.     { yyerror ("syntax error: cannot back up"); YYERROR; }    \
  495. while (0)
  496.  
  497. #define YYTERROR    1
  498. #define YYERRCODE    256
  499.  
  500. #ifndef YYPURE
  501. #define YYLEX        yylex()
  502. #endif
  503.  
  504. #ifdef YYPURE
  505. #ifdef YYLSP_NEEDED
  506. #ifdef YYLEX_PARAM
  507. #define YYLEX        yylex(&yylval, &yylloc, YYLEX_PARAM)
  508. #else
  509. #define YYLEX        yylex(&yylval, &yylloc)
  510. #endif
  511. #else /* not YYLSP_NEEDED */
  512. #ifdef YYLEX_PARAM
  513. #define YYLEX        yylex(&yylval, YYLEX_PARAM)
  514. #else
  515. #define YYLEX        yylex(&yylval)
  516. #endif
  517. #endif /* not YYLSP_NEEDED */
  518. #endif
  519.  
  520. /* If nonreentrant, generate the variables here */
  521.  
  522. #ifndef YYPURE
  523.  
  524. int    yychar;            /*  the lookahead symbol        */
  525. YYSTYPE    yylval;            /*  the semantic value of the        */
  526.                 /*  lookahead symbol            */
  527.  
  528. #ifdef YYLSP_NEEDED
  529. YYLTYPE yylloc;            /*  location data for the lookahead    */
  530.                 /*  symbol                */
  531. #endif
  532.  
  533. int yynerrs;            /*  number of parse errors so far       */
  534. #endif  /* not YYPURE */
  535.  
  536. #if YYDEBUG != 0
  537. int yydebug;            /*  nonzero means print parse trace    */
  538. /* Since this is uninitialized, it does not stop multiple parsers
  539.    from coexisting.  */
  540. #endif
  541.  
  542. /*  YYINITDEPTH indicates the initial size of the parser's stacks    */
  543.  
  544. #ifndef    YYINITDEPTH
  545. #define YYINITDEPTH 200
  546. #endif
  547.  
  548. /*  YYMAXDEPTH is the maximum size the stacks can grow to
  549.     (effective only if the built-in stack extension method is used).  */
  550.  
  551. #if YYMAXDEPTH == 0
  552. #undef YYMAXDEPTH
  553. #endif
  554.  
  555. #ifndef YYMAXDEPTH
  556. #define YYMAXDEPTH 10000
  557. #endif
  558.  
  559. /* Prevent warning if -Wstrict-prototypes.  */
  560. #ifdef __GNUC__
  561. int yyparse (void);
  562. #endif
  563.  
  564. #if __GNUC__ > 1        /* GNU C and GNU C++ define this.  */
  565. #define __yy_memcpy(TO,FROM,COUNT)    __builtin_memcpy(TO,FROM,COUNT)
  566. #else                /* not GNU C or C++ */
  567. #ifndef __cplusplus
  568.  
  569. /* This is the most reliable way to avoid incompatibilities
  570.    in available built-in functions on various systems.  */
  571. static void
  572. __yy_memcpy (to, from, count)
  573.      char *to;
  574.      char *from;
  575.      int count;
  576. {
  577.   register char *f = from;
  578.   register char *t = to;
  579.   register int i = count;
  580.  
  581.   while (i-- > 0)
  582.     *t++ = *f++;
  583. }
  584.  
  585. #else /* __cplusplus */
  586.  
  587. /* This is the most reliable way to avoid incompatibilities
  588.    in available built-in functions on various systems.  */
  589. static void
  590. __yy_memcpy (char *to, char *from, int count)
  591. {
  592.   register char *f = from;
  593.   register char *t = to;
  594.   register int i = count;
  595.  
  596.   while (i-- > 0)
  597.     *t++ = *f++;
  598. }
  599.  
  600. #endif
  601. #endif
  602.  
  603. #line 196 "/usr/lib/bison.simple"
  604.  
  605. /* The user can define YYPARSE_PARAM as the name of an argument to be passed
  606.    into yyparse.  The argument should have type void *.
  607.    It should actually point to an object.
  608.    Grammar actions can access the variable by casting it
  609.    to the proper pointer type.  */
  610.  
  611. #ifdef YYPARSE_PARAM
  612. #ifdef __cplusplus
  613. #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
  614. #define YYPARSE_PARAM_DECL
  615. #else /* not __cplusplus */
  616. #define YYPARSE_PARAM_ARG YYPARSE_PARAM
  617. #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
  618. #endif /* not __cplusplus */
  619. #else /* not YYPARSE_PARAM */
  620. #define YYPARSE_PARAM_ARG
  621. #define YYPARSE_PARAM_DECL
  622. #endif /* not YYPARSE_PARAM */
  623.  
  624. int
  625. yyparse(YYPARSE_PARAM_ARG)
  626.      YYPARSE_PARAM_DECL
  627. {
  628.   register int yystate;
  629.   register int yyn;
  630.   register short *yyssp;
  631.   register YYSTYPE *yyvsp;
  632.   int yyerrstatus;    /*  number of tokens to shift before error messages enabled */
  633.   int yychar1 = 0;        /*  lookahead token as an internal (translated) token number */
  634.  
  635.   short    yyssa[YYINITDEPTH];    /*  the state stack            */
  636.   YYSTYPE yyvsa[YYINITDEPTH];    /*  the semantic value stack        */
  637.  
  638.   short *yyss = yyssa;        /*  refer to the stacks thru separate pointers */
  639.   YYSTYPE *yyvs = yyvsa;    /*  to allow yyoverflow to reallocate them elsewhere */
  640.  
  641. #ifdef YYLSP_NEEDED
  642.   YYLTYPE yylsa[YYINITDEPTH];    /*  the location stack            */
  643.   YYLTYPE *yyls = yylsa;
  644.   YYLTYPE *yylsp;
  645.  
  646. #define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
  647. #else
  648. #define YYPOPSTACK   (yyvsp--, yyssp--)
  649. #endif
  650.  
  651.   int yystacksize = YYINITDEPTH;
  652.  
  653. #ifdef YYPURE
  654.   int yychar;
  655.   YYSTYPE yylval;
  656.   int yynerrs;
  657. #ifdef YYLSP_NEEDED
  658.   YYLTYPE yylloc;
  659. #endif
  660. #endif
  661.  
  662.   YYSTYPE yyval;        /*  the variable used to return        */
  663.                 /*  semantic values from the action    */
  664.                 /*  routines                */
  665.  
  666.   int yylen;
  667.  
  668. #if YYDEBUG != 0
  669.   if (yydebug)
  670.     fprintf(stderr, "Starting parse\n");
  671. #endif
  672.  
  673.   yystate = 0;
  674.   yyerrstatus = 0;
  675.   yynerrs = 0;
  676.   yychar = YYEMPTY;        /* Cause a token to be read.  */
  677.  
  678.   /* Initialize stack pointers.
  679.      Waste one element of value and location stack
  680.      so that they stay on the same level as the state stack.
  681.      The wasted elements are never initialized.  */
  682.  
  683.   yyssp = yyss - 1;
  684.   yyvsp = yyvs;
  685. #ifdef YYLSP_NEEDED
  686.   yylsp = yyls;
  687. #endif
  688.  
  689. /* Push a new state, which is found in  yystate  .  */
  690. /* In all cases, when you get here, the value and location stacks
  691.    have just been pushed. so pushing a state here evens the stacks.  */
  692. yynewstate:
  693.  
  694.   *++yyssp = yystate;
  695.  
  696.   if (yyssp >= yyss + yystacksize - 1)
  697.     {
  698.       /* Give user a chance to reallocate the stack */
  699.       /* Use copies of these so that the &'s don't force the real ones into memory. */
  700.       YYSTYPE *yyvs1 = yyvs;
  701.       short *yyss1 = yyss;
  702. #ifdef YYLSP_NEEDED
  703.       YYLTYPE *yyls1 = yyls;
  704. #endif
  705.  
  706.       /* Get the current used size of the three stacks, in elements.  */
  707.       int size = yyssp - yyss + 1;
  708.  
  709. #ifdef yyoverflow
  710.       /* Each stack pointer address is followed by the size of
  711.      the data in use in that stack, in bytes.  */
  712. #ifdef YYLSP_NEEDED
  713.       /* This used to be a conditional around just the two extra args,
  714.      but that might be undefined if yyoverflow is a macro.  */
  715.       yyoverflow("parser stack overflow",
  716.          &yyss1, size * sizeof (*yyssp),
  717.          &yyvs1, size * sizeof (*yyvsp),
  718.          &yyls1, size * sizeof (*yylsp),
  719.          &yystacksize);
  720. #else
  721.       yyoverflow("parser stack overflow",
  722.          &yyss1, size * sizeof (*yyssp),
  723.          &yyvs1, size * sizeof (*yyvsp),
  724.          &yystacksize);
  725. #endif
  726.  
  727.       yyss = yyss1; yyvs = yyvs1;
  728. #ifdef YYLSP_NEEDED
  729.       yyls = yyls1;
  730. #endif
  731. #else /* no yyoverflow */
  732.       /* Extend the stack our own way.  */
  733.       if (yystacksize >= YYMAXDEPTH)
  734.     {
  735.       yyerror("parser stack overflow");
  736.       return 2;
  737.     }
  738.       yystacksize *= 2;
  739.       if (yystacksize > YYMAXDEPTH)
  740.     yystacksize = YYMAXDEPTH;
  741.       yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
  742.       __yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp));
  743.       yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
  744.       __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp));
  745. #ifdef YYLSP_NEEDED
  746.       yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
  747.       __yy_memcpy ((char *)yyls, (char *)yyls1, size * sizeof (*yylsp));
  748. #endif
  749. #endif /* no yyoverflow */
  750.  
  751.       yyssp = yyss + size - 1;
  752.       yyvsp = yyvs + size - 1;
  753. #ifdef YYLSP_NEEDED
  754.       yylsp = yyls + size - 1;
  755. #endif
  756.  
  757. #if YYDEBUG != 0
  758.       if (yydebug)
  759.     fprintf(stderr, "Stack size increased to %d\n", yystacksize);
  760. #endif
  761.  
  762.       if (yyssp >= yyss + yystacksize - 1)
  763.     YYABORT;
  764.     }
  765.  
  766. #if YYDEBUG != 0
  767.   if (yydebug)
  768.     fprintf(stderr, "Entering state %d\n", yystate);
  769. #endif
  770.  
  771.   goto yybackup;
  772.  yybackup:
  773.  
  774. /* Do appropriate processing given the current state.  */
  775. /* Read a lookahead token if we need one and don't already have one.  */
  776. /* yyresume: */
  777.  
  778.   /* First try to decide what to do without reference to lookahead token.  */
  779.  
  780.   yyn = yypact[yystate];
  781.   if (yyn == YYFLAG)
  782.     goto yydefault;
  783.  
  784.   /* Not known => get a lookahead token if don't already have one.  */
  785.  
  786.   /* yychar is either YYEMPTY or YYEOF
  787.      or a valid token in external form.  */
  788.  
  789.   if (yychar == YYEMPTY)
  790.     {
  791. #if YYDEBUG != 0
  792.       if (yydebug)
  793.     fprintf(stderr, "Reading a token: ");
  794. #endif
  795.       yychar = YYLEX;
  796.     }
  797.  
  798.   /* Convert token to internal form (in yychar1) for indexing tables with */
  799.  
  800.   if (yychar <= 0)        /* This means end of input. */
  801.     {
  802.       yychar1 = 0;
  803.       yychar = YYEOF;        /* Don't call YYLEX any more */
  804.  
  805. #if YYDEBUG != 0
  806.       if (yydebug)
  807.     fprintf(stderr, "Now at end of input.\n");
  808. #endif
  809.     }
  810.   else
  811.     {
  812.       yychar1 = YYTRANSLATE(yychar);
  813.  
  814. #if YYDEBUG != 0
  815.       if (yydebug)
  816.     {
  817.       fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
  818.       /* Give the individual parser a way to print the precise meaning
  819.          of a token, for further debugging info.  */
  820. #ifdef YYPRINT
  821.       YYPRINT (stderr, yychar, yylval);
  822. #endif
  823.       fprintf (stderr, ")\n");
  824.     }
  825. #endif
  826.     }
  827.  
  828.   yyn += yychar1;
  829.   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
  830.     goto yydefault;
  831.  
  832.   yyn = yytable[yyn];
  833.  
  834.   /* yyn is what to do for this token type in this state.
  835.      Negative => reduce, -yyn is rule number.
  836.      Positive => shift, yyn is new state.
  837.        New state is final state => don't bother to shift,
  838.        just return success.
  839.      0, or most negative number => error.  */
  840.  
  841.   if (yyn < 0)
  842.     {
  843.       if (yyn == YYFLAG)
  844.     goto yyerrlab;
  845.       yyn = -yyn;
  846.       goto yyreduce;
  847.     }
  848.   else if (yyn == 0)
  849.     goto yyerrlab;
  850.  
  851.   if (yyn == YYFINAL)
  852.     YYACCEPT;
  853.  
  854.   /* Shift the lookahead token.  */
  855.  
  856. #if YYDEBUG != 0
  857.   if (yydebug)
  858.     fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
  859. #endif
  860.  
  861.   /* Discard the token being shifted unless it is eof.  */
  862.   if (yychar != YYEOF)
  863.     yychar = YYEMPTY;
  864.  
  865.   *++yyvsp = yylval;
  866. #ifdef YYLSP_NEEDED
  867.   *++yylsp = yylloc;
  868. #endif
  869.  
  870.   /* count tokens shifted since error; after three, turn off error status.  */
  871.   if (yyerrstatus) yyerrstatus--;
  872.  
  873.   yystate = yyn;
  874.   goto yynewstate;
  875.  
  876. /* Do the default action for the current state.  */
  877. yydefault:
  878.  
  879.   yyn = yydefact[yystate];
  880.   if (yyn == 0)
  881.     goto yyerrlab;
  882.  
  883. /* Do a reduction.  yyn is the number of a rule to reduce with.  */
  884. yyreduce:
  885.   yylen = yyr2[yyn];
  886.   if (yylen > 0)
  887.     yyval = yyvsp[1-yylen]; /* implement default value of the action */
  888.  
  889. #if YYDEBUG != 0
  890.   if (yydebug)
  891.     {
  892.       int i;
  893.  
  894.       fprintf (stderr, "Reducing via rule %d (line %d), ",
  895.            yyn, yyrline[yyn]);
  896.  
  897.       /* Print the symbols being reduced, and their result.  */
  898.       for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
  899.     fprintf (stderr, "%s ", yytname[yyrhs[i]]);
  900.       fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
  901.     }
  902. #endif
  903.  
  904.  
  905.   switch (yyn) {
  906.  
  907. case 3:
  908. #line 103 "parse.y"
  909. { is_typedef = 0; current_name = NULL; decl_spec = NULL; ;
  910.     break;}
  911. case 4:
  912. #line 105 "parse.y"
  913. { free_list(*yyvsp[0], NULL); *yyvsp[0] = NULL; ;
  914.     break;}
  915. case 5:
  916. #line 109 "parse.y"
  917. { is_typedef = 1; ;
  918.     break;}
  919. case 6:
  920. #line 110 "parse.y"
  921. { yyval = yyvsp[0]; ;
  922.     break;}
  923. case 11:
  924. #line 115 "parse.y"
  925. { yyval = yyvsp[0]; ;
  926.     break;}
  927. case 12:
  928. #line 116 "parse.y"
  929. { yyval = yyvsp[0]; ;
  930.     break;}
  931. case 13:
  932. #line 121 "parse.y"
  933. { if (current_name) {
  934.             struct string_list *decl = (*yyvsp[0])->next;
  935.             (*yyvsp[0])->next = NULL;
  936.             add_symbol(current_name,
  937.                    is_typedef ? SYM_TYPEDEF : SYM_NORMAL,
  938.                    decl);
  939.             current_name = NULL;
  940.           }
  941.           yyval = yyvsp[0];
  942.         ;
  943.     break;}
  944. case 14:
  945. #line 134 "parse.y"
  946. { yyval = NULL; ;
  947.     break;}
  948. case 16:
  949. #line 140 "parse.y"
  950. { struct string_list *decl = *yyvsp[0];
  951.           *yyvsp[0] = NULL;
  952.           add_symbol(current_name,
  953.                  is_typedef ? SYM_TYPEDEF : SYM_NORMAL, decl);
  954.           current_name = NULL;
  955.           yyval = yyvsp[0];
  956.         ;
  957.     break;}
  958. case 17:
  959. #line 148 "parse.y"
  960. { struct string_list *decl = *yyvsp[0];
  961.           *yyvsp[0] = NULL;
  962.           free_list(*yyvsp[-1], NULL);
  963.           *yyvsp[-1] = decl_spec;
  964.           add_symbol(current_name,
  965.                  is_typedef ? SYM_TYPEDEF : SYM_NORMAL, decl);
  966.           current_name = NULL;
  967.           yyval = yyvsp[0];
  968.         ;
  969.     break;}
  970. case 18:
  971. #line 161 "parse.y"
  972. { yyval = yyvsp[0] ? yyvsp[0] : yyvsp[-1] ? yyvsp[-1] : yyvsp[-2] ? yyvsp[-2] : yyvsp[-3]; ;
  973.     break;}
  974. case 19:
  975. #line 166 "parse.y"
  976. { decl_spec = NULL; ;
  977.     break;}
  978. case 21:
  979. #line 170 "parse.y"
  980. { decl_spec = *yyvsp[0]; ;
  981.     break;}
  982. case 22:
  983. #line 171 "parse.y"
  984. { decl_spec = *yyvsp[0]; ;
  985.     break;}
  986. case 23:
  987. #line 176 "parse.y"
  988. { /* Version 2 checksumming ignores storage class, as that
  989.              is really irrelevant to the linkage.  */
  990.           if (checksum_version > 1)
  991.             remove_node(yyvsp[0]);
  992.           yyval = yyvsp[0];
  993.         ;
  994.     break;}
  995. case 32:
  996. #line 196 "parse.y"
  997. { remove_node(yyvsp[-1]); (*yyvsp[0])->tag = SYM_STRUCT; yyval = yyvsp[0]; ;
  998.     break;}
  999. case 33:
  1000. #line 198 "parse.y"
  1001. { remove_node(yyvsp[-1]); (*yyvsp[0])->tag = SYM_UNION; yyval = yyvsp[0]; ;
  1002.     break;}
  1003. case 34:
  1004. #line 200 "parse.y"
  1005. { remove_node(yyvsp[-1]); (*yyvsp[0])->tag = SYM_ENUM; yyval = yyvsp[0]; ;
  1006.     break;}
  1007. case 35:
  1008. #line 204 "parse.y"
  1009. { struct string_list *s = *yyvsp[0], *i = *yyvsp[-1], *r;
  1010.           r = copy_node(i); r->tag = SYM_STRUCT;
  1011.           r->next = (*yyvsp[-2])->next; *yyvsp[0] = r; (*yyvsp[-2])->next = NULL;
  1012.           add_symbol(i->string, SYM_STRUCT, s);
  1013.           yyval = yyvsp[0];
  1014.         ;
  1015.     break;}
  1016. case 36:
  1017. #line 211 "parse.y"
  1018. { struct string_list *s = *yyvsp[0], *i = *yyvsp[-1], *r;
  1019.           r = copy_node(i); r->tag = SYM_UNION;
  1020.           r->next = (*yyvsp[-2])->next; *yyvsp[0] = r; (*yyvsp[-2])->next = NULL;
  1021.           add_symbol(i->string, SYM_UNION, s);
  1022.           yyval = yyvsp[0];
  1023.         ;
  1024.     break;}
  1025. case 37:
  1026. #line 218 "parse.y"
  1027. { struct string_list *s = *yyvsp[0], *i = *yyvsp[-1], *r;
  1028.           r = copy_node(i); r->tag = SYM_ENUM;
  1029.           r->next = (*yyvsp[-2])->next; *yyvsp[0] = r; (*yyvsp[-2])->next = NULL;
  1030.           add_symbol(i->string, SYM_ENUM, s);
  1031.           yyval = yyvsp[0];
  1032.         ;
  1033.     break;}
  1034. case 38:
  1035. #line 226 "parse.y"
  1036. { yyval = yyvsp[0]; ;
  1037.     break;}
  1038. case 39:
  1039. #line 227 "parse.y"
  1040. { yyval = yyvsp[0]; ;
  1041.     break;}
  1042. case 40:
  1043. #line 228 "parse.y"
  1044. { yyval = yyvsp[0]; ;
  1045.     break;}
  1046. case 50:
  1047. #line 241 "parse.y"
  1048. { (*yyvsp[0])->tag = SYM_TYPEDEF; yyval = yyvsp[0]; ;
  1049.     break;}
  1050. case 51:
  1051. #line 246 "parse.y"
  1052. { yyval = yyvsp[0] ? yyvsp[0] : yyvsp[-1]; ;
  1053.     break;}
  1054. case 52:
  1055. #line 250 "parse.y"
  1056. { yyval = NULL; ;
  1057.     break;}
  1058. case 55:
  1059. #line 256 "parse.y"
  1060. { yyval = yyvsp[0]; ;
  1061.     break;}
  1062. case 59:
  1063. #line 264 "parse.y"
  1064. { yyval = yyvsp[0]; ;
  1065.     break;}
  1066. case 61:
  1067. #line 270 "parse.y"
  1068. { if (current_name != NULL) {
  1069.             error_with_pos("unexpected second declaration name");
  1070.             YYERROR;
  1071.           } else {
  1072.             current_name = (*yyvsp[0])->string;
  1073.             yyval = yyvsp[0];
  1074.           }
  1075.         ;
  1076.     break;}
  1077. case 62:
  1078. #line 279 "parse.y"
  1079. { yyval = yyvsp[0]; ;
  1080.     break;}
  1081. case 63:
  1082. #line 281 "parse.y"
  1083. { yyval = yyvsp[0]; ;
  1084.     break;}
  1085. case 64:
  1086. #line 283 "parse.y"
  1087. { yyval = yyvsp[0]; ;
  1088.     break;}
  1089. case 65:
  1090. #line 285 "parse.y"
  1091. { yyval = yyvsp[0]; ;
  1092.     break;}
  1093. case 66:
  1094. #line 287 "parse.y"
  1095. { yyval = yyvsp[0]; ;
  1096.     break;}
  1097. case 67:
  1098. #line 293 "parse.y"
  1099. { yyval = yyvsp[0]; ;
  1100.     break;}
  1101. case 71:
  1102. #line 301 "parse.y"
  1103. { yyval = yyvsp[0]; ;
  1104.     break;}
  1105. case 72:
  1106. #line 303 "parse.y"
  1107. { yyval = yyvsp[0]; ;
  1108.     break;}
  1109. case 73:
  1110. #line 305 "parse.y"
  1111. { yyval = yyvsp[0]; ;
  1112.     break;}
  1113. case 74:
  1114. #line 307 "parse.y"
  1115. { yyval = yyvsp[0]; ;
  1116.     break;}
  1117. case 75:
  1118. #line 309 "parse.y"
  1119. { yyval = yyvsp[0]; ;
  1120.     break;}
  1121. case 76:
  1122. #line 313 "parse.y"
  1123. { yyval = yyvsp[0]; ;
  1124.     break;}
  1125. case 78:
  1126. #line 315 "parse.y"
  1127. { yyval = yyvsp[0]; ;
  1128.     break;}
  1129. case 79:
  1130. #line 319 "parse.y"
  1131. { yyval = NULL; ;
  1132.     break;}
  1133. case 82:
  1134. #line 326 "parse.y"
  1135. { yyval = yyvsp[0]; ;
  1136.     break;}
  1137. case 83:
  1138. #line 331 "parse.y"
  1139. { yyval = yyvsp[0] ? yyvsp[0] : yyvsp[-1]; ;
  1140.     break;}
  1141. case 84:
  1142. #line 336 "parse.y"
  1143. { yyval = yyvsp[0] ? yyvsp[0] : yyvsp[-1]; ;
  1144.     break;}
  1145. case 86:
  1146. #line 341 "parse.y"
  1147. { yyval = NULL; ;
  1148.     break;}
  1149. case 87:
  1150. #line 343 "parse.y"
  1151. { /* For version 2 checksums, we don't want to remember
  1152.              private parameter names.  */
  1153.           if (checksum_version > 1)
  1154.             remove_node(yyvsp[0]);
  1155.           yyval = yyvsp[0];
  1156.         ;
  1157.     break;}
  1158. case 88:
  1159. #line 352 "parse.y"
  1160. { if (checksum_version > 1)
  1161.             remove_node(yyvsp[0]);
  1162.           yyval = yyvsp[0];
  1163.         ;
  1164.     break;}
  1165. case 89:
  1166. #line 357 "parse.y"
  1167. { yyval = yyvsp[0]; ;
  1168.     break;}
  1169. case 90:
  1170. #line 359 "parse.y"
  1171. { yyval = yyvsp[0]; ;
  1172.     break;}
  1173. case 91:
  1174. #line 361 "parse.y"
  1175. { yyval = yyvsp[0]; ;
  1176.     break;}
  1177. case 92:
  1178. #line 363 "parse.y"
  1179. { yyval = yyvsp[0]; ;
  1180.     break;}
  1181. case 93:
  1182. #line 365 "parse.y"
  1183. { yyval = yyvsp[0]; ;
  1184.     break;}
  1185. case 94:
  1186. #line 370 "parse.y"
  1187. { struct string_list *decl = *yyvsp[-1];
  1188.           *yyvsp[-1] = NULL;
  1189.           add_symbol(current_name, SYM_NORMAL, decl);
  1190.           yyval = yyvsp[0];
  1191.         ;
  1192.     break;}
  1193. case 95:
  1194. #line 378 "parse.y"
  1195. { yyval = NULL; ;
  1196.     break;}
  1197. case 97:
  1198. #line 385 "parse.y"
  1199. { remove_list(yyvsp[0], &(*yyvsp[-1])->next); yyval = yyvsp[0]; ;
  1200.     break;}
  1201. case 98:
  1202. #line 389 "parse.y"
  1203. { yyval = yyvsp[0]; ;
  1204.     break;}
  1205. case 99:
  1206. #line 390 "parse.y"
  1207. { yyval = yyvsp[0]; ;
  1208.     break;}
  1209. case 100:
  1210. #line 394 "parse.y"
  1211. { yyval = NULL; ;
  1212.     break;}
  1213. case 103:
  1214. #line 400 "parse.y"
  1215. { yyval = yyvsp[0]; ;
  1216.     break;}
  1217. case 104:
  1218. #line 405 "parse.y"
  1219. { yyval = yyvsp[0]; ;
  1220.     break;}
  1221. case 105:
  1222. #line 407 "parse.y"
  1223. { yyval = yyvsp[0]; ;
  1224.     break;}
  1225. case 106:
  1226. #line 411 "parse.y"
  1227. { yyval = NULL; ;
  1228.     break;}
  1229. case 109:
  1230. #line 417 "parse.y"
  1231. { yyval = yyvsp[0]; ;
  1232.     break;}
  1233. case 110:
  1234. #line 421 "parse.y"
  1235. { yyval = yyvsp[0] ? yyvsp[0] : yyvsp[-1]; ;
  1236.     break;}
  1237. case 111:
  1238. #line 422 "parse.y"
  1239. { yyval = yyvsp[0]; ;
  1240.     break;}
  1241. case 113:
  1242. #line 427 "parse.y"
  1243. { yyval = yyvsp[0]; ;
  1244.     break;}
  1245. case 114:
  1246. #line 431 "parse.y"
  1247. { yyval = NULL; ;
  1248.     break;}
  1249. case 116:
  1250. #line 436 "parse.y"
  1251. { yyval = yyvsp[0]; ;
  1252.     break;}
  1253. case 117:
  1254. #line 440 "parse.y"
  1255. { yyval = NULL; ;
  1256.     break;}
  1257. case 119:
  1258. #line 446 "parse.y"
  1259. { export_symbol((*yyvsp[-2])->string); yyval = yyvsp[0]; ;
  1260.     break;}
  1261. }
  1262.    /* the action file gets copied in in place of this dollarsign */
  1263. #line 498 "/usr/lib/bison.simple"
  1264.  
  1265.   yyvsp -= yylen;
  1266.   yyssp -= yylen;
  1267. #ifdef YYLSP_NEEDED
  1268.   yylsp -= yylen;
  1269. #endif
  1270.  
  1271. #if YYDEBUG != 0
  1272.   if (yydebug)
  1273.     {
  1274.       short *ssp1 = yyss - 1;
  1275.       fprintf (stderr, "state stack now");
  1276.       while (ssp1 != yyssp)
  1277.     fprintf (stderr, " %d", *++ssp1);
  1278.       fprintf (stderr, "\n");
  1279.     }
  1280. #endif
  1281.  
  1282.   *++yyvsp = yyval;
  1283.  
  1284. #ifdef YYLSP_NEEDED
  1285.   yylsp++;
  1286.   if (yylen == 0)
  1287.     {
  1288.       yylsp->first_line = yylloc.first_line;
  1289.       yylsp->first_column = yylloc.first_column;
  1290.       yylsp->last_line = (yylsp-1)->last_line;
  1291.       yylsp->last_column = (yylsp-1)->last_column;
  1292.       yylsp->text = 0;
  1293.     }
  1294.   else
  1295.     {
  1296.       yylsp->last_line = (yylsp+yylen-1)->last_line;
  1297.       yylsp->last_column = (yylsp+yylen-1)->last_column;
  1298.     }
  1299. #endif
  1300.  
  1301.   /* Now "shift" the result of the reduction.
  1302.      Determine what state that goes to,
  1303.      based on the state we popped back to
  1304.      and the rule number reduced by.  */
  1305.  
  1306.   yyn = yyr1[yyn];
  1307.  
  1308.   yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
  1309.   if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
  1310.     yystate = yytable[yystate];
  1311.   else
  1312.     yystate = yydefgoto[yyn - YYNTBASE];
  1313.  
  1314.   goto yynewstate;
  1315.  
  1316. yyerrlab:   /* here on detecting error */
  1317.  
  1318.   if (! yyerrstatus)
  1319.     /* If not already recovering from an error, report this error.  */
  1320.     {
  1321.       ++yynerrs;
  1322.  
  1323. #ifdef YYERROR_VERBOSE
  1324.       yyn = yypact[yystate];
  1325.  
  1326.       if (yyn > YYFLAG && yyn < YYLAST)
  1327.     {
  1328.       int size = 0;
  1329.       char *msg;
  1330.       int x, count;
  1331.  
  1332.       count = 0;
  1333.       /* Start X at -yyn if nec to avoid negative indexes in yycheck.  */
  1334.       for (x = (yyn < 0 ? -yyn : 0);
  1335.            x < (sizeof(yytname) / sizeof(char *)); x++)
  1336.         if (yycheck[x + yyn] == x)
  1337.           size += strlen(yytname[x]) + 15, count++;
  1338.       msg = (char *) malloc(size + 15);
  1339.       if (msg != 0)
  1340.         {
  1341.           strcpy(msg, "parse error");
  1342.  
  1343.           if (count < 5)
  1344.         {
  1345.           count = 0;
  1346.           for (x = (yyn < 0 ? -yyn : 0);
  1347.                x < (sizeof(yytname) / sizeof(char *)); x++)
  1348.             if (yycheck[x + yyn] == x)
  1349.               {
  1350.             strcat(msg, count == 0 ? ", expecting `" : " or `");
  1351.             strcat(msg, yytname[x]);
  1352.             strcat(msg, "'");
  1353.             count++;
  1354.               }
  1355.         }
  1356.           yyerror(msg);
  1357.           free(msg);
  1358.         }
  1359.       else
  1360.         yyerror ("parse error; also virtual memory exceeded");
  1361.     }
  1362.       else
  1363. #endif /* YYERROR_VERBOSE */
  1364.     yyerror("parse error");
  1365.     }
  1366.  
  1367.   goto yyerrlab1;
  1368. yyerrlab1:   /* here on error raised explicitly by an action */
  1369.  
  1370.   if (yyerrstatus == 3)
  1371.     {
  1372.       /* if just tried and failed to reuse lookahead token after an error, discard it.  */
  1373.  
  1374.       /* return failure if at end of input */
  1375.       if (yychar == YYEOF)
  1376.     YYABORT;
  1377.  
  1378. #if YYDEBUG != 0
  1379.       if (yydebug)
  1380.     fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
  1381. #endif
  1382.  
  1383.       yychar = YYEMPTY;
  1384.     }
  1385.  
  1386.   /* Else will try to reuse lookahead token
  1387.      after shifting the error token.  */
  1388.  
  1389.   yyerrstatus = 3;        /* Each real token shifted decrements this */
  1390.  
  1391.   goto yyerrhandle;
  1392.  
  1393. yyerrdefault:  /* current state does not do anything special for the error token. */
  1394.  
  1395. #if 0
  1396.   /* This is wrong; only states that explicitly want error tokens
  1397.      should shift them.  */
  1398.   yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
  1399.   if (yyn) goto yydefault;
  1400. #endif
  1401.  
  1402. yyerrpop:   /* pop the current state because it cannot handle the error token */
  1403.  
  1404.   if (yyssp == yyss) YYABORT;
  1405.   yyvsp--;
  1406.   yystate = *--yyssp;
  1407. #ifdef YYLSP_NEEDED
  1408.   yylsp--;
  1409. #endif
  1410.  
  1411. #if YYDEBUG != 0
  1412.   if (yydebug)
  1413.     {
  1414.       short *ssp1 = yyss - 1;
  1415.       fprintf (stderr, "Error: state stack now");
  1416.       while (ssp1 != yyssp)
  1417.     fprintf (stderr, " %d", *++ssp1);
  1418.       fprintf (stderr, "\n");
  1419.     }
  1420. #endif
  1421.  
  1422. yyerrhandle:
  1423.  
  1424.   yyn = yypact[yystate];
  1425.   if (yyn == YYFLAG)
  1426.     goto yyerrdefault;
  1427.  
  1428.   yyn += YYTERROR;
  1429.   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
  1430.     goto yyerrdefault;
  1431.  
  1432.   yyn = yytable[yyn];
  1433.   if (yyn < 0)
  1434.     {
  1435.       if (yyn == YYFLAG)
  1436.     goto yyerrpop;
  1437.       yyn = -yyn;
  1438.       goto yyreduce;
  1439.     }
  1440.   else if (yyn == 0)
  1441.     goto yyerrpop;
  1442.  
  1443.   if (yyn == YYFINAL)
  1444.     YYACCEPT;
  1445.  
  1446. #if YYDEBUG != 0
  1447.   if (yydebug)
  1448.     fprintf(stderr, "Shifting error token, ");
  1449. #endif
  1450.  
  1451.   *++yyvsp = yylval;
  1452. #ifdef YYLSP_NEEDED
  1453.   *++yylsp = yylloc;
  1454. #endif
  1455.  
  1456.   yystate = yyn;
  1457.   goto yynewstate;
  1458. }
  1459. #line 450 "parse.y"
  1460.  
  1461.  
  1462. static void
  1463. yyerror(const char *e)
  1464. {
  1465.   error_with_pos("%s", e);
  1466. }
  1467.