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.

analyse_syntaxique.tab.c 55KB

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