parse.c_shipped 49 KB

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