No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

as.tab.c 50KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621
  1. /* A Bison parser, made by GNU Bison 3.0.4. */
  2. /* Bison implementation for Yacc-like parsers in C
  3. Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  14. /* As a special exception, you may create a larger work that contains
  15. part or all of the Bison parser skeleton and distribute that work
  16. under terms of your choice, so long as that work isn't itself a
  17. parser generator using the skeleton or a modified version thereof
  18. as a parser skeleton. Alternatively, if you modify or redistribute
  19. the parser skeleton itself, you may (at your option) remove this
  20. special exception, which will cause the skeleton and the resulting
  21. Bison output files to be licensed under the GNU General Public
  22. License without this special exception.
  23. This special exception was added by the Free Software Foundation in
  24. version 2.2 of Bison. */
  25. /* C LALR(1) parser skeleton written by Richard Stallman, by
  26. simplifying the original so-called "semantic" parser. */
  27. /* All symbols defined below should begin with yy or YY, to avoid
  28. infringing on user name space. This should be done even for local
  29. variables, as they might otherwise be expanded by user macros.
  30. There are some unavoidable exceptions within include files to
  31. define necessary library symbols; they are noted "INFRINGES ON
  32. USER NAME SPACE" below. */
  33. /* Identify Bison output. */
  34. #define YYBISON 1
  35. /* Bison version. */
  36. #define YYBISON_VERSION "3.0.4"
  37. /* Skeleton name. */
  38. #define YYSKELETON_NAME "yacc.c"
  39. /* Pure parsers. */
  40. #define YYPURE 0
  41. /* Push parsers. */
  42. #define YYPUSH 0
  43. /* Pull parsers. */
  44. #define YYPULL 1
  45. /* Copy the first part of user declarations. */
  46. #line 67 "as.tab.c" /* yacc.c:339 */
  47. # ifndef YY_NULLPTR
  48. # if defined __cplusplus && 201103L <= __cplusplus
  49. # define YY_NULLPTR nullptr
  50. # else
  51. # define YY_NULLPTR 0
  52. # endif
  53. # endif
  54. /* Enabling verbose error messages. */
  55. #ifdef YYERROR_VERBOSE
  56. # undef YYERROR_VERBOSE
  57. # define YYERROR_VERBOSE 1
  58. #else
  59. # define YYERROR_VERBOSE 0
  60. #endif
  61. /* In a future release of Bison, this section will be replaced
  62. by #include "as.tab.h". */
  63. #ifndef YY_YY_AS_TAB_H_INCLUDED
  64. # define YY_YY_AS_TAB_H_INCLUDED
  65. /* Debug traces. */
  66. #ifndef YYDEBUG
  67. # define YYDEBUG 0
  68. #endif
  69. #if YYDEBUG
  70. extern int yydebug;
  71. #endif
  72. /* Token type. */
  73. #ifndef YYTOKENTYPE
  74. # define YYTOKENTYPE
  75. enum yytokentype
  76. {
  77. tMAIN = 258,
  78. tOBRACKET = 259,
  79. tCBRACKET = 260,
  80. tOBRACE = 261,
  81. tCBRACE = 262,
  82. tINT = 263,
  83. tCONST = 264,
  84. tPV = 265,
  85. tCOMA = 266,
  86. tMUL = 267,
  87. tDIV = 268,
  88. tADD = 269,
  89. tSUB = 270,
  90. tEQ = 271,
  91. tNB = 272,
  92. tNBEXP = 273,
  93. tID = 274,
  94. tPRINTF = 275,
  95. tERROR = 276,
  96. tIF = 277,
  97. tWHILE = 278,
  98. tELSE = 279,
  99. tLT = 280,
  100. tGT = 281,
  101. tEQCOND = 282,
  102. tAND = 283,
  103. tOR = 284
  104. };
  105. #endif
  106. /* Value type. */
  107. #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
  108. union YYSTYPE
  109. {
  110. #line 1 "as.y" /* yacc.c:355 */
  111. int nombre;
  112. char id[30];
  113. #line 142 "as.tab.c" /* yacc.c:355 */
  114. };
  115. typedef union YYSTYPE YYSTYPE;
  116. # define YYSTYPE_IS_TRIVIAL 1
  117. # define YYSTYPE_IS_DECLARED 1
  118. #endif
  119. extern YYSTYPE yylval;
  120. int yyparse (void);
  121. #endif /* !YY_YY_AS_TAB_H_INCLUDED */
  122. /* Copy the second part of user declarations. */
  123. #line 5 "as.y" /* yacc.c:358 */
  124. #include <stdio.h>
  125. #line 162 "as.tab.c" /* yacc.c:358 */
  126. #ifdef short
  127. # undef short
  128. #endif
  129. #ifdef YYTYPE_UINT8
  130. typedef YYTYPE_UINT8 yytype_uint8;
  131. #else
  132. typedef unsigned char yytype_uint8;
  133. #endif
  134. #ifdef YYTYPE_INT8
  135. typedef YYTYPE_INT8 yytype_int8;
  136. #else
  137. typedef signed char yytype_int8;
  138. #endif
  139. #ifdef YYTYPE_UINT16
  140. typedef YYTYPE_UINT16 yytype_uint16;
  141. #else
  142. typedef unsigned short int yytype_uint16;
  143. #endif
  144. #ifdef YYTYPE_INT16
  145. typedef YYTYPE_INT16 yytype_int16;
  146. #else
  147. typedef short int yytype_int16;
  148. #endif
  149. #ifndef YYSIZE_T
  150. # ifdef __SIZE_TYPE__
  151. # define YYSIZE_T __SIZE_TYPE__
  152. # elif defined size_t
  153. # define YYSIZE_T size_t
  154. # elif ! defined YYSIZE_T
  155. # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
  156. # define YYSIZE_T size_t
  157. # else
  158. # define YYSIZE_T unsigned int
  159. # endif
  160. #endif
  161. #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
  162. #ifndef YY_
  163. # if defined YYENABLE_NLS && YYENABLE_NLS
  164. # if ENABLE_NLS
  165. # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
  166. # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
  167. # endif
  168. # endif
  169. # ifndef YY_
  170. # define YY_(Msgid) Msgid
  171. # endif
  172. #endif
  173. #ifndef YY_ATTRIBUTE
  174. # if (defined __GNUC__ \
  175. && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
  176. || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
  177. # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
  178. # else
  179. # define YY_ATTRIBUTE(Spec) /* empty */
  180. # endif
  181. #endif
  182. #ifndef YY_ATTRIBUTE_PURE
  183. # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
  184. #endif
  185. #ifndef YY_ATTRIBUTE_UNUSED
  186. # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
  187. #endif
  188. #if !defined _Noreturn \
  189. && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
  190. # if defined _MSC_VER && 1200 <= _MSC_VER
  191. # define _Noreturn __declspec (noreturn)
  192. # else
  193. # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
  194. # endif
  195. #endif
  196. /* Suppress unused-variable warnings by "using" E. */
  197. #if ! defined lint || defined __GNUC__
  198. # define YYUSE(E) ((void) (E))
  199. #else
  200. # define YYUSE(E) /* empty */
  201. #endif
  202. #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
  203. /* Suppress an incorrect diagnostic about yylval being uninitialized. */
  204. # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
  205. _Pragma ("GCC diagnostic push") \
  206. _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
  207. _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
  208. # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
  209. _Pragma ("GCC diagnostic pop")
  210. #else
  211. # define YY_INITIAL_VALUE(Value) Value
  212. #endif
  213. #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  214. # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  215. # define YY_IGNORE_MAYBE_UNINITIALIZED_END
  216. #endif
  217. #ifndef YY_INITIAL_VALUE
  218. # define YY_INITIAL_VALUE(Value) /* Nothing. */
  219. #endif
  220. #if ! defined yyoverflow || YYERROR_VERBOSE
  221. /* The parser invokes alloca or malloc; define the necessary symbols. */
  222. # ifdef YYSTACK_USE_ALLOCA
  223. # if YYSTACK_USE_ALLOCA
  224. # ifdef __GNUC__
  225. # define YYSTACK_ALLOC __builtin_alloca
  226. # elif defined __BUILTIN_VA_ARG_INCR
  227. # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
  228. # elif defined _AIX
  229. # define YYSTACK_ALLOC __alloca
  230. # elif defined _MSC_VER
  231. # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
  232. # define alloca _alloca
  233. # else
  234. # define YYSTACK_ALLOC alloca
  235. # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
  236. # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
  237. /* Use EXIT_SUCCESS as a witness for stdlib.h. */
  238. # ifndef EXIT_SUCCESS
  239. # define EXIT_SUCCESS 0
  240. # endif
  241. # endif
  242. # endif
  243. # endif
  244. # endif
  245. # ifdef YYSTACK_ALLOC
  246. /* Pacify GCC's 'empty if-body' warning. */
  247. # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
  248. # ifndef YYSTACK_ALLOC_MAXIMUM
  249. /* The OS might guarantee only one guard page at the bottom of the stack,
  250. and a page size can be as small as 4096 bytes. So we cannot safely
  251. invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
  252. to allow for a few compiler-allocated temporary stack slots. */
  253. # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
  254. # endif
  255. # else
  256. # define YYSTACK_ALLOC YYMALLOC
  257. # define YYSTACK_FREE YYFREE
  258. # ifndef YYSTACK_ALLOC_MAXIMUM
  259. # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
  260. # endif
  261. # if (defined __cplusplus && ! defined EXIT_SUCCESS \
  262. && ! ((defined YYMALLOC || defined malloc) \
  263. && (defined YYFREE || defined free)))
  264. # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
  265. # ifndef EXIT_SUCCESS
  266. # define EXIT_SUCCESS 0
  267. # endif
  268. # endif
  269. # ifndef YYMALLOC
  270. # define YYMALLOC malloc
  271. # if ! defined malloc && ! defined EXIT_SUCCESS
  272. void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
  273. # endif
  274. # endif
  275. # ifndef YYFREE
  276. # define YYFREE free
  277. # if ! defined free && ! defined EXIT_SUCCESS
  278. void free (void *); /* INFRINGES ON USER NAME SPACE */
  279. # endif
  280. # endif
  281. # endif
  282. #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
  283. #if (! defined yyoverflow \
  284. && (! defined __cplusplus \
  285. || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
  286. /* A type that is properly aligned for any stack member. */
  287. union yyalloc
  288. {
  289. yytype_int16 yyss_alloc;
  290. YYSTYPE yyvs_alloc;
  291. };
  292. /* The size of the maximum gap between one aligned stack and the next. */
  293. # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
  294. /* The size of an array large to enough to hold all stacks, each with
  295. N elements. */
  296. # define YYSTACK_BYTES(N) \
  297. ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
  298. + YYSTACK_GAP_MAXIMUM)
  299. # define YYCOPY_NEEDED 1
  300. /* Relocate STACK from its old location to the new one. The
  301. local variables YYSIZE and YYSTACKSIZE give the old and new number of
  302. elements in the stack, and YYPTR gives the new location of the
  303. stack. Advance YYPTR to a properly aligned location for the next
  304. stack. */
  305. # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
  306. do \
  307. { \
  308. YYSIZE_T yynewbytes; \
  309. YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
  310. Stack = &yyptr->Stack_alloc; \
  311. yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
  312. yyptr += yynewbytes / sizeof (*yyptr); \
  313. } \
  314. while (0)
  315. #endif
  316. #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
  317. /* Copy COUNT objects from SRC to DST. The source and destination do
  318. not overlap. */
  319. # ifndef YYCOPY
  320. # if defined __GNUC__ && 1 < __GNUC__
  321. # define YYCOPY(Dst, Src, Count) \
  322. __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
  323. # else
  324. # define YYCOPY(Dst, Src, Count) \
  325. do \
  326. { \
  327. YYSIZE_T yyi; \
  328. for (yyi = 0; yyi < (Count); yyi++) \
  329. (Dst)[yyi] = (Src)[yyi]; \
  330. } \
  331. while (0)
  332. # endif
  333. # endif
  334. #endif /* !YYCOPY_NEEDED */
  335. /* YYFINAL -- State number of the termination state. */
  336. #define YYFINAL 4
  337. /* YYLAST -- Last index in YYTABLE. */
  338. #define YYLAST 117
  339. /* YYNTOKENS -- Number of terminals. */
  340. #define YYNTOKENS 30
  341. /* YYNNTS -- Number of nonterminals. */
  342. #define YYNNTS 19
  343. /* YYNRULES -- Number of rules. */
  344. #define YYNRULES 45
  345. /* YYNSTATES -- Number of states. */
  346. #define YYNSTATES 98
  347. /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
  348. by yylex, with out-of-bounds checking. */
  349. #define YYUNDEFTOK 2
  350. #define YYMAXUTOK 284
  351. #define YYTRANSLATE(YYX) \
  352. ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
  353. /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
  354. as returned by yylex, without out-of-bounds checking. */
  355. static const yytype_uint8 yytranslate[] =
  356. {
  357. 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  358. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  359. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  360. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  361. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  362. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  363. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  364. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  365. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  366. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  367. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  368. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  369. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  370. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  371. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  372. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  373. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  374. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  375. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  376. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  377. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  378. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  379. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  380. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  381. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  382. 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
  383. 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
  384. 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
  385. 25, 26, 27, 28, 29
  386. };
  387. #if YYDEBUG
  388. /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
  389. static const yytype_uint8 yyrline[] =
  390. {
  391. 0, 28, 28, 30, 31, 32, 33, 34, 36, 39,
  392. 40, 41, 42, 43, 44, 45, 48, 49, 50, 51,
  393. 52, 54, 55, 56, 57, 60, 62, 63, 64, 65,
  394. 66, 67, 68, 69, 70, 71, 72, 73, 74, 77,
  395. 78, 79, 80, 81, 82, 84
  396. };
  397. #endif
  398. #if YYDEBUG || YYERROR_VERBOSE || 0
  399. /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
  400. First, the terminals, then, starting at YYNTOKENS, nonterminals. */
  401. static const char *const yytname[] =
  402. {
  403. "$end", "error", "$undefined", "tMAIN", "tOBRACKET", "tCBRACKET",
  404. "tOBRACE", "tCBRACE", "tINT", "tCONST", "tPV", "tCOMA", "tMUL", "tDIV",
  405. "tADD", "tSUB", "tEQ", "tNB", "tNBEXP", "tID", "tPRINTF", "tERROR",
  406. "tIF", "tWHILE", "tELSE", "tLT", "tGT", "tEQCOND", "tAND", "tOR",
  407. "$accept", "Main", "Params", "Param", "SuiteParams", "Body",
  408. "Instructions", "Instruction", "If", "Else", "While", "Cond",
  409. "SuiteCond", "Aff", "E", "Decl", "SuiteDecl", "FinDeclaration",
  410. "Invocation", YY_NULLPTR
  411. };
  412. #endif
  413. # ifdef YYPRINT
  414. /* YYTOKNUM[NUM] -- (External) token number corresponding to the
  415. (internal) symbol number NUM (which must be that of a token). */
  416. static const yytype_uint16 yytoknum[] =
  417. {
  418. 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
  419. 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
  420. 275, 276, 277, 278, 279, 280, 281, 282, 283, 284
  421. };
  422. # endif
  423. #define YYPACT_NINF -68
  424. #define yypact_value_is_default(Yystate) \
  425. (!!((Yystate) == (-68)))
  426. #define YYTABLE_NINF -1
  427. #define yytable_value_is_error(Yytable_value) \
  428. 0
  429. /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
  430. STATE-NUM. */
  431. static const yytype_int8 yypact[] =
  432. {
  433. 9, 2, 22, 30, -68, 20, 18, 39, 40, -68,
  434. 48, 20, -68, 73, -68, 40, 45, 50, 43, 64,
  435. 69, 70, 72, 73, -68, -68, -68, -68, 81, -68,
  436. 86, 79, 88, 80, 88, 88, -68, -68, -68, 85,
  437. -7, 86, 88, 88, -68, -68, -68, 35, -68, 76,
  438. 102, 28, 103, 86, -68, 88, -68, 95, 0, 75,
  439. -68, 88, 88, 88, 88, 88, 88, 88, -68, 48,
  440. 88, 88, -68, 48, -68, 53, 88, -68, 75, 75,
  441. 75, 75, 75, 75, 75, 89, 28, 28, -68, -68,
  442. 59, -3, -68, -68, -68, -68, -68, -68
  443. };
  444. /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
  445. Performed when YYTABLE does not specify something else to do. Zero
  446. means the default is an error. */
  447. static const yytype_uint8 yydefact[] =
  448. {
  449. 0, 0, 0, 0, 1, 3, 0, 0, 7, 5,
  450. 0, 0, 4, 10, 2, 7, 0, 0, 0, 0,
  451. 0, 0, 0, 10, 14, 15, 11, 12, 0, 6,
  452. 42, 0, 0, 0, 0, 0, 8, 9, 13, 0,
  453. 0, 42, 0, 0, 26, 27, 28, 0, 33, 0,
  454. 0, 22, 0, 42, 44, 0, 39, 0, 0, 35,
  455. 25, 0, 0, 0, 0, 0, 0, 0, 45, 0,
  456. 0, 0, 21, 0, 41, 0, 0, 34, 30, 32,
  457. 29, 31, 38, 37, 36, 19, 22, 22, 20, 43,
  458. 0, 0, 16, 23, 24, 40, 18, 17
  459. };
  460. /* YYPGOTO[NTERM-NUM]. */
  461. static const yytype_int8 yypgoto[] =
  462. {
  463. -68, -68, -68, 101, 99, -67, 92, -68, 25, -68,
  464. -68, 82, -66, -68, -32, -68, -37, -68, -5
  465. };
  466. /* YYDEFGOTO[NTERM-NUM]. */
  467. static const yytype_int8 yydefgoto[] =
  468. {
  469. -1, 2, 7, 8, 12, 14, 22, 23, 24, 92,
  470. 25, 50, 72, 26, 51, 27, 40, 56, 48
  471. };
  472. /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
  473. positive, shift that token. If negative, reduce the rule whose
  474. number is the opposite. If YYTABLE_NINF, syntax error. */
  475. static const yytype_uint8 yytable[] =
  476. {
  477. 47, 13, 85, 54, 57, 3, 88, 77, 28, 55,
  478. 58, 59, 61, 62, 63, 64, 74, 1, 28, 20,
  479. 93, 94, 4, 75, 96, 65, 66, 67, 6, 78,
  480. 79, 80, 81, 82, 83, 84, 5, 9, 86, 87,
  481. 61, 62, 63, 64, 90, 60, 10, 61, 62, 63,
  482. 64, 11, 13, 65, 66, 67, 70, 71, 31, 32,
  483. 65, 66, 67, 89, 30, 61, 62, 63, 64, 95,
  484. 33, 61, 62, 63, 64, 34, 35, 36, 65, 66,
  485. 67, 16, 17, 68, 65, 66, 67, 61, 62, 63,
  486. 64, 38, 18, 19, 42, 20, 21, 39, 41, 49,
  487. 65, 66, 67, 43, 53, 44, 45, 46, 19, 69,
  488. 73, 76, 15, 91, 29, 37, 97, 52
  489. };
  490. static const yytype_uint8 yycheck[] =
  491. {
  492. 32, 4, 69, 10, 41, 3, 73, 7, 13, 16,
  493. 42, 43, 12, 13, 14, 15, 53, 8, 23, 22,
  494. 86, 87, 0, 55, 91, 25, 26, 27, 8, 61,
  495. 62, 63, 64, 65, 66, 67, 6, 19, 70, 71,
  496. 12, 13, 14, 15, 76, 10, 7, 12, 13, 14,
  497. 15, 11, 4, 25, 26, 27, 28, 29, 8, 16,
  498. 25, 26, 27, 10, 19, 12, 13, 14, 15, 10,
  499. 6, 12, 13, 14, 15, 6, 6, 5, 25, 26,
  500. 27, 8, 9, 7, 25, 26, 27, 12, 13, 14,
  501. 15, 10, 19, 20, 6, 22, 23, 11, 19, 19,
  502. 25, 26, 27, 15, 19, 17, 18, 19, 20, 7,
  503. 7, 16, 11, 24, 15, 23, 91, 35
  504. };
  505. /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
  506. symbol of state STATE-NUM. */
  507. static const yytype_uint8 yystos[] =
  508. {
  509. 0, 8, 31, 3, 0, 6, 8, 32, 33, 19,
  510. 7, 11, 34, 4, 35, 33, 8, 9, 19, 20,
  511. 22, 23, 36, 37, 38, 40, 43, 45, 48, 34,
  512. 19, 8, 16, 6, 6, 6, 5, 36, 10, 11,
  513. 46, 19, 6, 15, 17, 18, 19, 44, 48, 19,
  514. 41, 44, 41, 19, 10, 16, 47, 46, 44, 44,
  515. 10, 12, 13, 14, 15, 25, 26, 27, 7, 7,
  516. 28, 29, 42, 7, 46, 44, 16, 7, 44, 44,
  517. 44, 44, 44, 44, 44, 35, 44, 44, 35, 10,
  518. 44, 24, 39, 42, 42, 10, 35, 38
  519. };
  520. /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
  521. static const yytype_uint8 yyr1[] =
  522. {
  523. 0, 30, 31, 32, 32, 33, 34, 34, 35, 36,
  524. 36, 37, 37, 37, 37, 37, 38, 39, 39, 39,
  525. 40, 41, 42, 42, 42, 43, 44, 44, 44, 44,
  526. 44, 44, 44, 44, 44, 44, 44, 44, 44, 45,
  527. 45, 46, 46, 47, 47, 48
  528. };
  529. /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
  530. static const yytype_uint8 yyr2[] =
  531. {
  532. 0, 2, 6, 0, 2, 2, 3, 0, 3, 2,
  533. 0, 1, 1, 2, 1, 1, 6, 2, 2, 0,
  534. 5, 2, 0, 3, 3, 4, 1, 1, 1, 3,
  535. 3, 3, 3, 1, 3, 2, 3, 3, 3, 4,
  536. 7, 3, 0, 3, 1, 4
  537. };
  538. #define yyerrok (yyerrstatus = 0)
  539. #define yyclearin (yychar = YYEMPTY)
  540. #define YYEMPTY (-2)
  541. #define YYEOF 0
  542. #define YYACCEPT goto yyacceptlab
  543. #define YYABORT goto yyabortlab
  544. #define YYERROR goto yyerrorlab
  545. #define YYRECOVERING() (!!yyerrstatus)
  546. #define YYBACKUP(Token, Value) \
  547. do \
  548. if (yychar == YYEMPTY) \
  549. { \
  550. yychar = (Token); \
  551. yylval = (Value); \
  552. YYPOPSTACK (yylen); \
  553. yystate = *yyssp; \
  554. goto yybackup; \
  555. } \
  556. else \
  557. { \
  558. yyerror (YY_("syntax error: cannot back up")); \
  559. YYERROR; \
  560. } \
  561. while (0)
  562. /* Error token number */
  563. #define YYTERROR 1
  564. #define YYERRCODE 256
  565. /* Enable debugging if requested. */
  566. #if YYDEBUG
  567. # ifndef YYFPRINTF
  568. # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
  569. # define YYFPRINTF fprintf
  570. # endif
  571. # define YYDPRINTF(Args) \
  572. do { \
  573. if (yydebug) \
  574. YYFPRINTF Args; \
  575. } while (0)
  576. /* This macro is provided for backward compatibility. */
  577. #ifndef YY_LOCATION_PRINT
  578. # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
  579. #endif
  580. # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
  581. do { \
  582. if (yydebug) \
  583. { \
  584. YYFPRINTF (stderr, "%s ", Title); \
  585. yy_symbol_print (stderr, \
  586. Type, Value); \
  587. YYFPRINTF (stderr, "\n"); \
  588. } \
  589. } while (0)
  590. /*----------------------------------------.
  591. | Print this symbol's value on YYOUTPUT. |
  592. `----------------------------------------*/
  593. static void
  594. yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
  595. {
  596. FILE *yyo = yyoutput;
  597. YYUSE (yyo);
  598. if (!yyvaluep)
  599. return;
  600. # ifdef YYPRINT
  601. if (yytype < YYNTOKENS)
  602. YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
  603. # endif
  604. YYUSE (yytype);
  605. }
  606. /*--------------------------------.
  607. | Print this symbol on YYOUTPUT. |
  608. `--------------------------------*/
  609. static void
  610. yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
  611. {
  612. YYFPRINTF (yyoutput, "%s %s (",
  613. yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
  614. yy_symbol_value_print (yyoutput, yytype, yyvaluep);
  615. YYFPRINTF (yyoutput, ")");
  616. }
  617. /*------------------------------------------------------------------.
  618. | yy_stack_print -- Print the state stack from its BOTTOM up to its |
  619. | TOP (included). |
  620. `------------------------------------------------------------------*/
  621. static void
  622. yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
  623. {
  624. YYFPRINTF (stderr, "Stack now");
  625. for (; yybottom <= yytop; yybottom++)
  626. {
  627. int yybot = *yybottom;
  628. YYFPRINTF (stderr, " %d", yybot);
  629. }
  630. YYFPRINTF (stderr, "\n");
  631. }
  632. # define YY_STACK_PRINT(Bottom, Top) \
  633. do { \
  634. if (yydebug) \
  635. yy_stack_print ((Bottom), (Top)); \
  636. } while (0)
  637. /*------------------------------------------------.
  638. | Report that the YYRULE is going to be reduced. |
  639. `------------------------------------------------*/
  640. static void
  641. yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
  642. {
  643. unsigned long int yylno = yyrline[yyrule];
  644. int yynrhs = yyr2[yyrule];
  645. int yyi;
  646. YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
  647. yyrule - 1, yylno);
  648. /* The symbols being reduced. */
  649. for (yyi = 0; yyi < yynrhs; yyi++)
  650. {
  651. YYFPRINTF (stderr, " $%d = ", yyi + 1);
  652. yy_symbol_print (stderr,
  653. yystos[yyssp[yyi + 1 - yynrhs]],
  654. &(yyvsp[(yyi + 1) - (yynrhs)])
  655. );
  656. YYFPRINTF (stderr, "\n");
  657. }
  658. }
  659. # define YY_REDUCE_PRINT(Rule) \
  660. do { \
  661. if (yydebug) \
  662. yy_reduce_print (yyssp, yyvsp, Rule); \
  663. } while (0)
  664. /* Nonzero means print parse trace. It is left uninitialized so that
  665. multiple parsers can coexist. */
  666. int yydebug;
  667. #else /* !YYDEBUG */
  668. # define YYDPRINTF(Args)
  669. # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
  670. # define YY_STACK_PRINT(Bottom, Top)
  671. # define YY_REDUCE_PRINT(Rule)
  672. #endif /* !YYDEBUG */
  673. /* YYINITDEPTH -- initial size of the parser's stacks. */
  674. #ifndef YYINITDEPTH
  675. # define YYINITDEPTH 200
  676. #endif
  677. /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
  678. if the built-in stack extension method is used).
  679. Do not make this value too large; the results are undefined if
  680. YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
  681. evaluated with infinite-precision integer arithmetic. */
  682. #ifndef YYMAXDEPTH
  683. # define YYMAXDEPTH 10000
  684. #endif
  685. #if YYERROR_VERBOSE
  686. # ifndef yystrlen
  687. # if defined __GLIBC__ && defined _STRING_H
  688. # define yystrlen strlen
  689. # else
  690. /* Return the length of YYSTR. */
  691. static YYSIZE_T
  692. yystrlen (const char *yystr)
  693. {
  694. YYSIZE_T yylen;
  695. for (yylen = 0; yystr[yylen]; yylen++)
  696. continue;
  697. return yylen;
  698. }
  699. # endif
  700. # endif
  701. # ifndef yystpcpy
  702. # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
  703. # define yystpcpy stpcpy
  704. # else
  705. /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
  706. YYDEST. */
  707. static char *
  708. yystpcpy (char *yydest, const char *yysrc)
  709. {
  710. char *yyd = yydest;
  711. const char *yys = yysrc;
  712. while ((*yyd++ = *yys++) != '\0')
  713. continue;
  714. return yyd - 1;
  715. }
  716. # endif
  717. # endif
  718. # ifndef yytnamerr
  719. /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
  720. quotes and backslashes, so that it's suitable for yyerror. The
  721. heuristic is that double-quoting is unnecessary unless the string
  722. contains an apostrophe, a comma, or backslash (other than
  723. backslash-backslash). YYSTR is taken from yytname. If YYRES is
  724. null, do not copy; instead, return the length of what the result
  725. would have been. */
  726. static YYSIZE_T
  727. yytnamerr (char *yyres, const char *yystr)
  728. {
  729. if (*yystr == '"')
  730. {
  731. YYSIZE_T yyn = 0;
  732. char const *yyp = yystr;
  733. for (;;)
  734. switch (*++yyp)
  735. {
  736. case '\'':
  737. case ',':
  738. goto do_not_strip_quotes;
  739. case '\\':
  740. if (*++yyp != '\\')
  741. goto do_not_strip_quotes;
  742. /* Fall through. */
  743. default:
  744. if (yyres)
  745. yyres[yyn] = *yyp;
  746. yyn++;
  747. break;
  748. case '"':
  749. if (yyres)
  750. yyres[yyn] = '\0';
  751. return yyn;
  752. }
  753. do_not_strip_quotes: ;
  754. }
  755. if (! yyres)
  756. return yystrlen (yystr);
  757. return yystpcpy (yyres, yystr) - yyres;
  758. }
  759. # endif
  760. /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
  761. about the unexpected token YYTOKEN for the state stack whose top is
  762. YYSSP.
  763. Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
  764. not large enough to hold the message. In that case, also set
  765. *YYMSG_ALLOC to the required number of bytes. Return 2 if the
  766. required number of bytes is too large to store. */
  767. static int
  768. yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
  769. yytype_int16 *yyssp, int yytoken)
  770. {
  771. YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
  772. YYSIZE_T yysize = yysize0;
  773. enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
  774. /* Internationalized format string. */
  775. const char *yyformat = YY_NULLPTR;
  776. /* Arguments of yyformat. */
  777. char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
  778. /* Number of reported tokens (one for the "unexpected", one per
  779. "expected"). */
  780. int yycount = 0;
  781. /* There are many possibilities here to consider:
  782. - If this state is a consistent state with a default action, then
  783. the only way this function was invoked is if the default action
  784. is an error action. In that case, don't check for expected
  785. tokens because there are none.
  786. - The only way there can be no lookahead present (in yychar) is if
  787. this state is a consistent state with a default action. Thus,
  788. detecting the absence of a lookahead is sufficient to determine
  789. that there is no unexpected or expected token to report. In that
  790. case, just report a simple "syntax error".
  791. - Don't assume there isn't a lookahead just because this state is a
  792. consistent state with a default action. There might have been a
  793. previous inconsistent state, consistent state with a non-default
  794. action, or user semantic action that manipulated yychar.
  795. - Of course, the expected token list depends on states to have
  796. correct lookahead information, and it depends on the parser not
  797. to perform extra reductions after fetching a lookahead from the
  798. scanner and before detecting a syntax error. Thus, state merging
  799. (from LALR or IELR) and default reductions corrupt the expected
  800. token list. However, the list is correct for canonical LR with
  801. one exception: it will still contain any token that will not be
  802. accepted due to an error action in a later state.
  803. */
  804. if (yytoken != YYEMPTY)
  805. {
  806. int yyn = yypact[*yyssp];
  807. yyarg[yycount++] = yytname[yytoken];
  808. if (!yypact_value_is_default (yyn))
  809. {
  810. /* Start YYX at -YYN if negative to avoid negative indexes in
  811. YYCHECK. In other words, skip the first -YYN actions for
  812. this state because they are default actions. */
  813. int yyxbegin = yyn < 0 ? -yyn : 0;
  814. /* Stay within bounds of both yycheck and yytname. */
  815. int yychecklim = YYLAST - yyn + 1;
  816. int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
  817. int yyx;
  818. for (yyx = yyxbegin; yyx < yyxend; ++yyx)
  819. if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
  820. && !yytable_value_is_error (yytable[yyx + yyn]))
  821. {
  822. if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
  823. {
  824. yycount = 1;
  825. yysize = yysize0;
  826. break;
  827. }
  828. yyarg[yycount++] = yytname[yyx];
  829. {
  830. YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
  831. if (! (yysize <= yysize1
  832. && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
  833. return 2;
  834. yysize = yysize1;
  835. }
  836. }
  837. }
  838. }
  839. switch (yycount)
  840. {
  841. # define YYCASE_(N, S) \
  842. case N: \
  843. yyformat = S; \
  844. break
  845. YYCASE_(0, YY_("syntax error"));
  846. YYCASE_(1, YY_("syntax error, unexpected %s"));
  847. YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
  848. YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
  849. YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
  850. YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
  851. # undef YYCASE_
  852. }
  853. {
  854. YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
  855. if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
  856. return 2;
  857. yysize = yysize1;
  858. }
  859. if (*yymsg_alloc < yysize)
  860. {
  861. *yymsg_alloc = 2 * yysize;
  862. if (! (yysize <= *yymsg_alloc
  863. && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
  864. *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
  865. return 1;
  866. }
  867. /* Avoid sprintf, as that infringes on the user's name space.
  868. Don't have undefined behavior even if the translation
  869. produced a string with the wrong number of "%s"s. */
  870. {
  871. char *yyp = *yymsg;
  872. int yyi = 0;
  873. while ((*yyp = *yyformat) != '\0')
  874. if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
  875. {
  876. yyp += yytnamerr (yyp, yyarg[yyi++]);
  877. yyformat += 2;
  878. }
  879. else
  880. {
  881. yyp++;
  882. yyformat++;
  883. }
  884. }
  885. return 0;
  886. }
  887. #endif /* YYERROR_VERBOSE */
  888. /*-----------------------------------------------.
  889. | Release the memory associated to this symbol. |
  890. `-----------------------------------------------*/
  891. static void
  892. yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
  893. {
  894. YYUSE (yyvaluep);
  895. if (!yymsg)
  896. yymsg = "Deleting";
  897. YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
  898. YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  899. YYUSE (yytype);
  900. YY_IGNORE_MAYBE_UNINITIALIZED_END
  901. }
  902. /* The lookahead symbol. */
  903. int yychar;
  904. /* The semantic value of the lookahead symbol. */
  905. YYSTYPE yylval;
  906. /* Number of syntax errors so far. */
  907. int yynerrs;
  908. /*----------.
  909. | yyparse. |
  910. `----------*/
  911. int
  912. yyparse (void)
  913. {
  914. int yystate;
  915. /* Number of tokens to shift before error messages enabled. */
  916. int yyerrstatus;
  917. /* The stacks and their tools:
  918. 'yyss': related to states.
  919. 'yyvs': related to semantic values.
  920. Refer to the stacks through separate pointers, to allow yyoverflow
  921. to reallocate them elsewhere. */
  922. /* The state stack. */
  923. yytype_int16 yyssa[YYINITDEPTH];
  924. yytype_int16 *yyss;
  925. yytype_int16 *yyssp;
  926. /* The semantic value stack. */
  927. YYSTYPE yyvsa[YYINITDEPTH];
  928. YYSTYPE *yyvs;
  929. YYSTYPE *yyvsp;
  930. YYSIZE_T yystacksize;
  931. int yyn;
  932. int yyresult;
  933. /* Lookahead token as an internal (translated) token number. */
  934. int yytoken = 0;
  935. /* The variables used to return semantic value and location from the
  936. action routines. */
  937. YYSTYPE yyval;
  938. #if YYERROR_VERBOSE
  939. /* Buffer for error messages, and its allocated size. */
  940. char yymsgbuf[128];
  941. char *yymsg = yymsgbuf;
  942. YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
  943. #endif
  944. #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
  945. /* The number of symbols on the RHS of the reduced rule.
  946. Keep to zero when no symbol should be popped. */
  947. int yylen = 0;
  948. yyssp = yyss = yyssa;
  949. yyvsp = yyvs = yyvsa;
  950. yystacksize = YYINITDEPTH;
  951. YYDPRINTF ((stderr, "Starting parse\n"));
  952. yystate = 0;
  953. yyerrstatus = 0;
  954. yynerrs = 0;
  955. yychar = YYEMPTY; /* Cause a token to be read. */
  956. goto yysetstate;
  957. /*------------------------------------------------------------.
  958. | yynewstate -- Push a new state, which is found in yystate. |
  959. `------------------------------------------------------------*/
  960. yynewstate:
  961. /* In all cases, when you get here, the value and location stacks
  962. have just been pushed. So pushing a state here evens the stacks. */
  963. yyssp++;
  964. yysetstate:
  965. *yyssp = yystate;
  966. if (yyss + yystacksize - 1 <= yyssp)
  967. {
  968. /* Get the current used size of the three stacks, in elements. */
  969. YYSIZE_T yysize = yyssp - yyss + 1;
  970. #ifdef yyoverflow
  971. {
  972. /* Give user a chance to reallocate the stack. Use copies of
  973. these so that the &'s don't force the real ones into
  974. memory. */
  975. YYSTYPE *yyvs1 = yyvs;
  976. yytype_int16 *yyss1 = yyss;
  977. /* Each stack pointer address is followed by the size of the
  978. data in use in that stack, in bytes. This used to be a
  979. conditional around just the two extra args, but that might
  980. be undefined if yyoverflow is a macro. */
  981. yyoverflow (YY_("memory exhausted"),
  982. &yyss1, yysize * sizeof (*yyssp),
  983. &yyvs1, yysize * sizeof (*yyvsp),
  984. &yystacksize);
  985. yyss = yyss1;
  986. yyvs = yyvs1;
  987. }
  988. #else /* no yyoverflow */
  989. # ifndef YYSTACK_RELOCATE
  990. goto yyexhaustedlab;
  991. # else
  992. /* Extend the stack our own way. */
  993. if (YYMAXDEPTH <= yystacksize)
  994. goto yyexhaustedlab;
  995. yystacksize *= 2;
  996. if (YYMAXDEPTH < yystacksize)
  997. yystacksize = YYMAXDEPTH;
  998. {
  999. yytype_int16 *yyss1 = yyss;
  1000. union yyalloc *yyptr =
  1001. (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
  1002. if (! yyptr)
  1003. goto yyexhaustedlab;
  1004. YYSTACK_RELOCATE (yyss_alloc, yyss);
  1005. YYSTACK_RELOCATE (yyvs_alloc, yyvs);
  1006. # undef YYSTACK_RELOCATE
  1007. if (yyss1 != yyssa)
  1008. YYSTACK_FREE (yyss1);
  1009. }
  1010. # endif
  1011. #endif /* no yyoverflow */
  1012. yyssp = yyss + yysize - 1;
  1013. yyvsp = yyvs + yysize - 1;
  1014. YYDPRINTF ((stderr, "Stack size increased to %lu\n",
  1015. (unsigned long int) yystacksize));
  1016. if (yyss + yystacksize - 1 <= yyssp)
  1017. YYABORT;
  1018. }
  1019. YYDPRINTF ((stderr, "Entering state %d\n", yystate));
  1020. if (yystate == YYFINAL)
  1021. YYACCEPT;
  1022. goto yybackup;
  1023. /*-----------.
  1024. | yybackup. |
  1025. `-----------*/
  1026. yybackup:
  1027. /* Do appropriate processing given the current state. Read a
  1028. lookahead token if we need one and don't already have one. */
  1029. /* First try to decide what to do without reference to lookahead token. */
  1030. yyn = yypact[yystate];
  1031. if (yypact_value_is_default (yyn))
  1032. goto yydefault;
  1033. /* Not known => get a lookahead token if don't already have one. */
  1034. /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
  1035. if (yychar == YYEMPTY)
  1036. {
  1037. YYDPRINTF ((stderr, "Reading a token: "));
  1038. yychar = yylex ();
  1039. }
  1040. if (yychar <= YYEOF)
  1041. {
  1042. yychar = yytoken = YYEOF;
  1043. YYDPRINTF ((stderr, "Now at end of input.\n"));
  1044. }
  1045. else
  1046. {
  1047. yytoken = YYTRANSLATE (yychar);
  1048. YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
  1049. }
  1050. /* If the proper action on seeing token YYTOKEN is to reduce or to
  1051. detect an error, take that action. */
  1052. yyn += yytoken;
  1053. if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
  1054. goto yydefault;
  1055. yyn = yytable[yyn];
  1056. if (yyn <= 0)
  1057. {
  1058. if (yytable_value_is_error (yyn))
  1059. goto yyerrlab;
  1060. yyn = -yyn;
  1061. goto yyreduce;
  1062. }
  1063. /* Count tokens shifted since error; after three, turn off error
  1064. status. */
  1065. if (yyerrstatus)
  1066. yyerrstatus--;
  1067. /* Shift the lookahead token. */
  1068. YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
  1069. /* Discard the shifted token. */
  1070. yychar = YYEMPTY;
  1071. yystate = yyn;
  1072. YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  1073. *++yyvsp = yylval;
  1074. YY_IGNORE_MAYBE_UNINITIALIZED_END
  1075. goto yynewstate;
  1076. /*-----------------------------------------------------------.
  1077. | yydefault -- do the default action for the current state. |
  1078. `-----------------------------------------------------------*/
  1079. yydefault:
  1080. yyn = yydefact[yystate];
  1081. if (yyn == 0)
  1082. goto yyerrlab;
  1083. goto yyreduce;
  1084. /*-----------------------------.
  1085. | yyreduce -- Do a reduction. |
  1086. `-----------------------------*/
  1087. yyreduce:
  1088. /* yyn is the number of a rule to reduce with. */
  1089. yylen = yyr2[yyn];
  1090. /* If YYLEN is nonzero, implement the default value of the action:
  1091. '$$ = $1'.
  1092. Otherwise, the following line sets YYVAL to garbage.
  1093. This behavior is undocumented and Bison
  1094. users should not rely upon it. Assigning to YYVAL
  1095. unconditionally makes the parser a bit smaller, and it avoids a
  1096. GCC warning that YYVAL may be used uninitialized. */
  1097. yyval = yyvsp[1-yylen];
  1098. YY_REDUCE_PRINT (yyn);
  1099. switch (yyn)
  1100. {
  1101. case 2:
  1102. #line 28 "as.y" /* yacc.c:1646 */
  1103. { printf("Main reconnu\n"); }
  1104. #line 1301 "as.tab.c" /* yacc.c:1646 */
  1105. break;
  1106. case 3:
  1107. #line 30 "as.y" /* yacc.c:1646 */
  1108. { printf("Sans Params\n"); }
  1109. #line 1307 "as.tab.c" /* yacc.c:1646 */
  1110. break;
  1111. case 5:
  1112. #line 32 "as.y" /* yacc.c:1646 */
  1113. { printf("Prametre : %s\n", (yyvsp[0].id)); }
  1114. #line 1313 "as.tab.c" /* yacc.c:1646 */
  1115. break;
  1116. case 8:
  1117. #line 36 "as.y" /* yacc.c:1646 */
  1118. { printf("Body reconnu\n"); }
  1119. #line 1319 "as.tab.c" /* yacc.c:1646 */
  1120. break;
  1121. case 16:
  1122. #line 48 "as.y" /* yacc.c:1646 */
  1123. { printf("If reconnu\n"); }
  1124. #line 1325 "as.tab.c" /* yacc.c:1646 */
  1125. break;
  1126. case 17:
  1127. #line 49 "as.y" /* yacc.c:1646 */
  1128. { printf("Else if reconnu\n"); }
  1129. #line 1331 "as.tab.c" /* yacc.c:1646 */
  1130. break;
  1131. case 18:
  1132. #line 50 "as.y" /* yacc.c:1646 */
  1133. { printf("Else reconnu\n"); }
  1134. #line 1337 "as.tab.c" /* yacc.c:1646 */
  1135. break;
  1136. case 20:
  1137. #line 52 "as.y" /* yacc.c:1646 */
  1138. { printf("While reconnu\n"); }
  1139. #line 1343 "as.tab.c" /* yacc.c:1646 */
  1140. break;
  1141. case 25:
  1142. #line 60 "as.y" /* yacc.c:1646 */
  1143. { printf("%s prend une valeur\n", (yyvsp[-3].id)); }
  1144. #line 1349 "as.tab.c" /* yacc.c:1646 */
  1145. break;
  1146. case 39:
  1147. #line 77 "as.y" /* yacc.c:1646 */
  1148. { printf("Declaration de %s\n", (yyvsp[-2].id)); }
  1149. #line 1355 "as.tab.c" /* yacc.c:1646 */
  1150. break;
  1151. case 40:
  1152. #line 78 "as.y" /* yacc.c:1646 */
  1153. { printf("Declaration de %s (CONSTANTE)\n", (yyvsp[-4].id)); }
  1154. #line 1361 "as.tab.c" /* yacc.c:1646 */
  1155. break;
  1156. case 41:
  1157. #line 79 "as.y" /* yacc.c:1646 */
  1158. { printf("Declaration de %s\n", (yyvsp[-1].id)); }
  1159. #line 1367 "as.tab.c" /* yacc.c:1646 */
  1160. break;
  1161. case 43:
  1162. #line 81 "as.y" /* yacc.c:1646 */
  1163. { printf("Declaration avec valeur\n"); }
  1164. #line 1373 "as.tab.c" /* yacc.c:1646 */
  1165. break;
  1166. case 44:
  1167. #line 82 "as.y" /* yacc.c:1646 */
  1168. { printf("Declaration sans valeur\n"); }
  1169. #line 1379 "as.tab.c" /* yacc.c:1646 */
  1170. break;
  1171. case 45:
  1172. #line 84 "as.y" /* yacc.c:1646 */
  1173. { printf("Appel de printf sur %s\n", (yyvsp[-1].id)); }
  1174. #line 1385 "as.tab.c" /* yacc.c:1646 */
  1175. break;
  1176. #line 1389 "as.tab.c" /* yacc.c:1646 */
  1177. default: break;
  1178. }
  1179. /* User semantic actions sometimes alter yychar, and that requires
  1180. that yytoken be updated with the new translation. We take the
  1181. approach of translating immediately before every use of yytoken.
  1182. One alternative is translating here after every semantic action,
  1183. but that translation would be missed if the semantic action invokes
  1184. YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
  1185. if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
  1186. incorrect destructor might then be invoked immediately. In the
  1187. case of YYERROR or YYBACKUP, subsequent parser actions might lead
  1188. to an incorrect destructor call or verbose syntax error message
  1189. before the lookahead is translated. */
  1190. YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
  1191. YYPOPSTACK (yylen);
  1192. yylen = 0;
  1193. YY_STACK_PRINT (yyss, yyssp);
  1194. *++yyvsp = yyval;
  1195. /* Now 'shift' the result of the reduction. Determine what state
  1196. that goes to, based on the state we popped back to and the rule
  1197. number reduced by. */
  1198. yyn = yyr1[yyn];
  1199. yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
  1200. if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
  1201. yystate = yytable[yystate];
  1202. else
  1203. yystate = yydefgoto[yyn - YYNTOKENS];
  1204. goto yynewstate;
  1205. /*--------------------------------------.
  1206. | yyerrlab -- here on detecting error. |
  1207. `--------------------------------------*/
  1208. yyerrlab:
  1209. /* Make sure we have latest lookahead translation. See comments at
  1210. user semantic actions for why this is necessary. */
  1211. yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
  1212. /* If not already recovering from an error, report this error. */
  1213. if (!yyerrstatus)
  1214. {
  1215. ++yynerrs;
  1216. #if ! YYERROR_VERBOSE
  1217. yyerror (YY_("syntax error"));
  1218. #else
  1219. # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
  1220. yyssp, yytoken)
  1221. {
  1222. char const *yymsgp = YY_("syntax error");
  1223. int yysyntax_error_status;
  1224. yysyntax_error_status = YYSYNTAX_ERROR;
  1225. if (yysyntax_error_status == 0)
  1226. yymsgp = yymsg;
  1227. else if (yysyntax_error_status == 1)
  1228. {
  1229. if (yymsg != yymsgbuf)
  1230. YYSTACK_FREE (yymsg);
  1231. yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
  1232. if (!yymsg)
  1233. {
  1234. yymsg = yymsgbuf;
  1235. yymsg_alloc = sizeof yymsgbuf;
  1236. yysyntax_error_status = 2;
  1237. }
  1238. else
  1239. {
  1240. yysyntax_error_status = YYSYNTAX_ERROR;
  1241. yymsgp = yymsg;
  1242. }
  1243. }
  1244. yyerror (yymsgp);
  1245. if (yysyntax_error_status == 2)
  1246. goto yyexhaustedlab;
  1247. }
  1248. # undef YYSYNTAX_ERROR
  1249. #endif
  1250. }
  1251. if (yyerrstatus == 3)
  1252. {
  1253. /* If just tried and failed to reuse lookahead token after an
  1254. error, discard it. */
  1255. if (yychar <= YYEOF)
  1256. {
  1257. /* Return failure if at end of input. */
  1258. if (yychar == YYEOF)
  1259. YYABORT;
  1260. }
  1261. else
  1262. {
  1263. yydestruct ("Error: discarding",
  1264. yytoken, &yylval);
  1265. yychar = YYEMPTY;
  1266. }
  1267. }
  1268. /* Else will try to reuse lookahead token after shifting the error
  1269. token. */
  1270. goto yyerrlab1;
  1271. /*---------------------------------------------------.
  1272. | yyerrorlab -- error raised explicitly by YYERROR. |
  1273. `---------------------------------------------------*/
  1274. yyerrorlab:
  1275. /* Pacify compilers like GCC when the user code never invokes
  1276. YYERROR and the label yyerrorlab therefore never appears in user
  1277. code. */
  1278. if (/*CONSTCOND*/ 0)
  1279. goto yyerrorlab;
  1280. /* Do not reclaim the symbols of the rule whose action triggered
  1281. this YYERROR. */
  1282. YYPOPSTACK (yylen);
  1283. yylen = 0;
  1284. YY_STACK_PRINT (yyss, yyssp);
  1285. yystate = *yyssp;
  1286. goto yyerrlab1;
  1287. /*-------------------------------------------------------------.
  1288. | yyerrlab1 -- common code for both syntax error and YYERROR. |
  1289. `-------------------------------------------------------------*/
  1290. yyerrlab1:
  1291. yyerrstatus = 3; /* Each real token shifted decrements this. */
  1292. for (;;)
  1293. {
  1294. yyn = yypact[yystate];
  1295. if (!yypact_value_is_default (yyn))
  1296. {
  1297. yyn += YYTERROR;
  1298. if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
  1299. {
  1300. yyn = yytable[yyn];
  1301. if (0 < yyn)
  1302. break;
  1303. }
  1304. }
  1305. /* Pop the current state because it cannot handle the error token. */
  1306. if (yyssp == yyss)
  1307. YYABORT;
  1308. yydestruct ("Error: popping",
  1309. yystos[yystate], yyvsp);
  1310. YYPOPSTACK (1);
  1311. yystate = *yyssp;
  1312. YY_STACK_PRINT (yyss, yyssp);
  1313. }
  1314. YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
  1315. *++yyvsp = yylval;
  1316. YY_IGNORE_MAYBE_UNINITIALIZED_END
  1317. /* Shift the error token. */
  1318. YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
  1319. yystate = yyn;
  1320. goto yynewstate;
  1321. /*-------------------------------------.
  1322. | yyacceptlab -- YYACCEPT comes here. |
  1323. `-------------------------------------*/
  1324. yyacceptlab:
  1325. yyresult = 0;
  1326. goto yyreturn;
  1327. /*-----------------------------------.
  1328. | yyabortlab -- YYABORT comes here. |
  1329. `-----------------------------------*/
  1330. yyabortlab:
  1331. yyresult = 1;
  1332. goto yyreturn;
  1333. #if !defined yyoverflow || YYERROR_VERBOSE
  1334. /*-------------------------------------------------.
  1335. | yyexhaustedlab -- memory exhaustion comes here. |
  1336. `-------------------------------------------------*/
  1337. yyexhaustedlab:
  1338. yyerror (YY_("memory exhausted"));
  1339. yyresult = 2;
  1340. /* Fall through. */
  1341. #endif
  1342. yyreturn:
  1343. if (yychar != YYEMPTY)
  1344. {
  1345. /* Make sure we have latest lookahead translation. See comments at
  1346. user semantic actions for why this is necessary. */
  1347. yytoken = YYTRANSLATE (yychar);
  1348. yydestruct ("Cleanup: discarding lookahead",
  1349. yytoken, &yylval);
  1350. }
  1351. /* Do not reclaim the symbols of the rule whose action triggered
  1352. this YYABORT or YYACCEPT. */
  1353. YYPOPSTACK (yylen);
  1354. YY_STACK_PRINT (yyss, yyssp);
  1355. while (yyssp != yyss)
  1356. {
  1357. yydestruct ("Cleanup: popping",
  1358. yystos[*yyssp], yyvsp);
  1359. YYPOPSTACK (1);
  1360. }
  1361. #ifndef yyoverflow
  1362. if (yyss != yyssa)
  1363. YYSTACK_FREE (yyss);
  1364. #endif
  1365. #if YYERROR_VERBOSE
  1366. if (yymsg != yymsgbuf)
  1367. YYSTACK_FREE (yymsg);
  1368. #endif
  1369. return yyresult;
  1370. }
  1371. #line 98 "as.y" /* yacc.c:1906 */
  1372. #include <stdio.h>
  1373. void main(void) {
  1374. yyparse();
  1375. }