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.

y.tab.c 52KB

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