plural.c 49 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961
  1. /* A Bison parser, made by GNU Bison 2.3a. */
  2. /* Skeleton implementation for Bison's Yacc-like parsers in C
  3. Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
  4. Free Software Foundation, Inc.
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2, or (at your option)
  8. any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 51 Franklin Street, Fifth Floor,
  16. Boston, MA 02110-1301, USA. */
  17. /* As a special exception, you may create a larger work that contains
  18. part or all of the Bison parser skeleton and distribute that work
  19. under terms of your choice, so long as that work isn't itself a
  20. parser generator using the skeleton or a modified version thereof
  21. as a parser skeleton. Alternatively, if you modify or redistribute
  22. the parser skeleton itself, you may (at your option) remove this
  23. special exception, which will cause the skeleton and the resulting
  24. Bison output files to be licensed under the GNU General Public
  25. License without this special exception.
  26. This special exception was added by the Free Software Foundation in
  27. version 2.2 of Bison. */
  28. /* C LALR(1) parser skeleton written by Richard Stallman, by
  29. simplifying the original so-called "semantic" parser. */
  30. /* All symbols defined below should begin with yy or YY, to avoid
  31. infringing on user name space. This should be done even for local
  32. variables, as they might otherwise be expanded by user macros.
  33. There are some unavoidable exceptions within include files to
  34. define necessary library symbols; they are noted "INFRINGES ON
  35. USER NAME SPACE" below. */
  36. /* Identify Bison output. */
  37. #define YYBISON 1
  38. /* Bison version. */
  39. #define YYBISON_VERSION "2.3a"
  40. /* Skeleton name. */
  41. #define YYSKELETON_NAME "yacc.c"
  42. /* Pure parsers. */
  43. #define YYPURE 1
  44. /* Using locations. */
  45. #define YYLSP_NEEDED 0
  46. /* Substitute the variable and function names. */
  47. #define yyparse __gettextparse
  48. #define yylex __gettextlex
  49. #define yyerror __gettexterror
  50. #define yylval __gettextlval
  51. #define yychar __gettextchar
  52. #define yydebug __gettextdebug
  53. #define yynerrs __gettextnerrs
  54. /* Copy the first part of user declarations. */
  55. /* Line 164 of yacc.c. */
  56. #line 1 "plural.y"
  57. /* Expression parsing for plural form selection.
  58. Copyright (C) 2000-2001, 2003, 2005-2006 Free Software Foundation, Inc.
  59. Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
  60. This program is free software; you can redistribute it and/or modify it
  61. under the terms of the GNU Library General Public License as published
  62. by the Free Software Foundation; either version 2, or (at your option)
  63. any later version.
  64. This program is distributed in the hope that it will be useful,
  65. but WITHOUT ANY WARRANTY; without even the implied warranty of
  66. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  67. Library General Public License for more details.
  68. You should have received a copy of the GNU Library General Public
  69. License along with this program; if not, write to the Free Software
  70. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
  71. USA. */
  72. /* For bison < 2.0, the bison generated parser uses alloca. AIX 3 forces us
  73. to put this declaration at the beginning of the file. The declaration in
  74. bison's skeleton file comes too late. This must come before <config.h>
  75. because <config.h> may include arbitrary system headers.
  76. This can go away once the AM_INTL_SUBDIR macro requires bison >= 2.0. */
  77. #if defined _AIX && !defined __GNUC__
  78. #pragma alloca
  79. #endif
  80. #ifdef HAVE_CONFIG_H
  81. # include <config.h>
  82. #endif
  83. #include <stddef.h>
  84. #include <stdlib.h>
  85. #include <string.h>
  86. #include "plural-exp.h"
  87. /* The main function generated by the parser is called __gettextparse,
  88. but we want it to be called PLURAL_PARSE. */
  89. #ifndef _LIBC
  90. # define __gettextparse PLURAL_PARSE
  91. #endif
  92. #define YYLEX_PARAM &((struct parse_args *) arg)->cp
  93. #define YYPARSE_PARAM arg
  94. /* Enabling traces. */
  95. #ifndef YYDEBUG
  96. # define YYDEBUG 0
  97. #endif
  98. /* Enabling verbose error messages. */
  99. #ifdef YYERROR_VERBOSE
  100. # undef YYERROR_VERBOSE
  101. # define YYERROR_VERBOSE 1
  102. #else
  103. # define YYERROR_VERBOSE 0
  104. #endif
  105. /* Enabling the token table. */
  106. #ifndef YYTOKEN_TABLE
  107. # define YYTOKEN_TABLE 0
  108. #endif
  109. /* Tokens. */
  110. #ifndef YYTOKENTYPE
  111. # define YYTOKENTYPE
  112. /* Put the tokens into the symbol table, so that GDB and other debuggers
  113. know about them. */
  114. enum yytokentype {
  115. EQUOP2 = 258,
  116. CMPOP2 = 259,
  117. ADDOP2 = 260,
  118. MULOP2 = 261,
  119. NUMBER = 262
  120. };
  121. #endif
  122. /* Tokens. */
  123. #define EQUOP2 258
  124. #define CMPOP2 259
  125. #define ADDOP2 260
  126. #define MULOP2 261
  127. #define NUMBER 262
  128. #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
  129. typedef union YYSTYPE
  130. {/* Line 191 of yacc.c. */
  131. #line 51 "plural.y"
  132. unsigned long int num;
  133. enum expression_operator op;
  134. struct expression *exp;
  135. }
  136. /* Line 191 of yacc.c. */
  137. #line 175 "plural.c"
  138. YYSTYPE;
  139. # define YYSTYPE_IS_TRIVIAL 1
  140. # define yystype YYSTYPE /* obsolescent; will be withdrawn */
  141. # define YYSTYPE_IS_DECLARED 1
  142. #endif
  143. /* Copy the second part of user declarations. */
  144. /* Line 221 of yacc.c. */
  145. #line 57 "plural.y"
  146. /* Prototypes for local functions. */
  147. static int yylex (YYSTYPE *lval, const char **pexp);
  148. static void yyerror (const char *str);
  149. /* Allocation of expressions. */
  150. static struct expression *
  151. new_exp (int nargs, enum expression_operator op,
  152. struct expression * const *args)
  153. {
  154. int i;
  155. struct expression *newp;
  156. /* If any of the argument could not be malloc'ed, just return NULL. */
  157. for (i = nargs - 1; i >= 0; i--)
  158. if (args[i] == NULL)
  159. goto fail;
  160. /* Allocate a new expression. */
  161. newp = (struct expression *) malloc (sizeof (*newp));
  162. if (newp != NULL)
  163. {
  164. newp->nargs = nargs;
  165. newp->operation = op;
  166. for (i = nargs - 1; i >= 0; i--)
  167. newp->val.args[i] = args[i];
  168. return newp;
  169. }
  170. fail:
  171. for (i = nargs - 1; i >= 0; i--)
  172. FREE_EXPRESSION (args[i]);
  173. return NULL;
  174. }
  175. static inline struct expression *
  176. new_exp_0 (enum expression_operator op)
  177. {
  178. return new_exp (0, op, NULL);
  179. }
  180. static inline struct expression *
  181. new_exp_1 (enum expression_operator op, struct expression *right)
  182. {
  183. struct expression *args[1];
  184. args[0] = right;
  185. return new_exp (1, op, args);
  186. }
  187. static struct expression *
  188. new_exp_2 (enum expression_operator op, struct expression *left,
  189. struct expression *right)
  190. {
  191. struct expression *args[2];
  192. args[0] = left;
  193. args[1] = right;
  194. return new_exp (2, op, args);
  195. }
  196. static inline struct expression *
  197. new_exp_3 (enum expression_operator op, struct expression *bexp,
  198. struct expression *tbranch, struct expression *fbranch)
  199. {
  200. struct expression *args[3];
  201. args[0] = bexp;
  202. args[1] = tbranch;
  203. args[2] = fbranch;
  204. return new_exp (3, op, args);
  205. }
  206. /* Line 221 of yacc.c. */
  207. #line 265 "plural.c"
  208. #ifdef short
  209. # undef short
  210. #endif
  211. #ifdef YYTYPE_UINT8
  212. typedef YYTYPE_UINT8 yytype_uint8;
  213. #else
  214. typedef unsigned char yytype_uint8;
  215. #endif
  216. #ifdef YYTYPE_INT8
  217. typedef YYTYPE_INT8 yytype_int8;
  218. #elif (defined __STDC__ || defined __C99__FUNC__ \
  219. || defined __cplusplus || defined _MSC_VER)
  220. typedef signed char yytype_int8;
  221. #else
  222. typedef short int yytype_int8;
  223. #endif
  224. #ifdef YYTYPE_UINT16
  225. typedef YYTYPE_UINT16 yytype_uint16;
  226. #else
  227. typedef unsigned short int yytype_uint16;
  228. #endif
  229. #ifdef YYTYPE_INT16
  230. typedef YYTYPE_INT16 yytype_int16;
  231. #else
  232. typedef short int yytype_int16;
  233. #endif
  234. #ifndef YYSIZE_T
  235. # ifdef __SIZE_TYPE__
  236. # define YYSIZE_T __SIZE_TYPE__
  237. # elif defined size_t
  238. # define YYSIZE_T size_t
  239. # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
  240. || defined __cplusplus || defined _MSC_VER)
  241. # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
  242. # define YYSIZE_T size_t
  243. # else
  244. # define YYSIZE_T unsigned int
  245. # endif
  246. #endif
  247. #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
  248. #ifndef YY_
  249. # if YYENABLE_NLS
  250. # if ENABLE_NLS
  251. # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
  252. # define YY_(msgid) dgettext ("bison-runtime", msgid)
  253. # endif
  254. # endif
  255. # ifndef YY_
  256. # define YY_(msgid) msgid
  257. # endif
  258. #endif
  259. /* Suppress unused-variable warnings by "using" E. */
  260. #if ! defined lint || defined __GNUC__
  261. # define YYUSE(e) ((void) (e))
  262. #else
  263. # define YYUSE(e) /* empty */
  264. #endif
  265. /* Identity function, used to suppress warnings about constant conditions. */
  266. #ifndef lint
  267. # define YYID(n) (n)
  268. #else
  269. #if (defined __STDC__ || defined __C99__FUNC__ \
  270. || defined __cplusplus || defined _MSC_VER)
  271. static int
  272. YYID (int yyi)
  273. #else
  274. static int
  275. YYID (yyi)
  276. int yyi;
  277. #endif
  278. {
  279. return yyi;
  280. }
  281. #endif
  282. #if ! defined yyoverflow || YYERROR_VERBOSE
  283. /* The parser invokes alloca or malloc; define the necessary symbols. */
  284. # ifdef YYSTACK_USE_ALLOCA
  285. # if YYSTACK_USE_ALLOCA
  286. # ifdef __GNUC__
  287. # define YYSTACK_ALLOC __builtin_alloca
  288. # elif defined __BUILTIN_VA_ARG_INCR
  289. # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
  290. # elif defined _AIX
  291. # define YYSTACK_ALLOC __alloca
  292. # elif defined _MSC_VER
  293. # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
  294. # define alloca _alloca
  295. # else
  296. # define YYSTACK_ALLOC alloca
  297. # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
  298. || defined __cplusplus || defined _MSC_VER)
  299. # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
  300. # ifndef _STDLIB_H
  301. # define _STDLIB_H 1
  302. # endif
  303. # endif
  304. # endif
  305. # endif
  306. # endif
  307. # ifdef YYSTACK_ALLOC
  308. /* Pacify GCC's `empty if-body' warning. */
  309. # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
  310. # ifndef YYSTACK_ALLOC_MAXIMUM
  311. /* The OS might guarantee only one guard page at the bottom of the stack,
  312. and a page size can be as small as 4096 bytes. So we cannot safely
  313. invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
  314. to allow for a few compiler-allocated temporary stack slots. */
  315. # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
  316. # endif
  317. # else
  318. # define YYSTACK_ALLOC YYMALLOC
  319. # define YYSTACK_FREE YYFREE
  320. # ifndef YYSTACK_ALLOC_MAXIMUM
  321. # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
  322. # endif
  323. # if (defined __cplusplus && ! defined _STDLIB_H \
  324. && ! ((defined YYMALLOC || defined malloc) \
  325. && (defined YYFREE || defined free)))
  326. # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
  327. # ifndef _STDLIB_H
  328. # define _STDLIB_H 1
  329. # endif
  330. # endif
  331. # ifndef YYMALLOC
  332. # define YYMALLOC malloc
  333. # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
  334. || defined __cplusplus || defined _MSC_VER)
  335. void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
  336. # endif
  337. # endif
  338. # ifndef YYFREE
  339. # define YYFREE free
  340. # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
  341. || defined __cplusplus || defined _MSC_VER)
  342. void free (void *); /* INFRINGES ON USER NAME SPACE */
  343. # endif
  344. # endif
  345. # endif
  346. #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
  347. #if (! defined yyoverflow \
  348. && (! defined __cplusplus \
  349. || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
  350. /* A type that is properly aligned for any stack member. */
  351. union yyalloc
  352. {
  353. yytype_int16 yyss;
  354. YYSTYPE yyvs;
  355. };
  356. /* The size of the maximum gap between one aligned stack and the next. */
  357. # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
  358. /* The size of an array large to enough to hold all stacks, each with
  359. N elements. */
  360. # define YYSTACK_BYTES(N) \
  361. ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
  362. + YYSTACK_GAP_MAXIMUM)
  363. /* Copy COUNT objects from FROM to TO. The source and destination do
  364. not overlap. */
  365. # ifndef YYCOPY
  366. # if defined __GNUC__ && 1 < __GNUC__
  367. # define YYCOPY(To, From, Count) \
  368. __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
  369. # else
  370. # define YYCOPY(To, From, Count) \
  371. do \
  372. { \
  373. YYSIZE_T yyi; \
  374. for (yyi = 0; yyi < (Count); yyi++) \
  375. (To)[yyi] = (From)[yyi]; \
  376. } \
  377. while (YYID (0))
  378. # endif
  379. # endif
  380. /* Relocate STACK from its old location to the new one. The
  381. local variables YYSIZE and YYSTACKSIZE give the old and new number of
  382. elements in the stack, and YYPTR gives the new location of the
  383. stack. Advance YYPTR to a properly aligned location for the next
  384. stack. */
  385. # define YYSTACK_RELOCATE(Stack) \
  386. do \
  387. { \
  388. YYSIZE_T yynewbytes; \
  389. YYCOPY (&yyptr->Stack, Stack, yysize); \
  390. Stack = &yyptr->Stack; \
  391. yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
  392. yyptr += yynewbytes / sizeof (*yyptr); \
  393. } \
  394. while (YYID (0))
  395. #endif
  396. /* YYFINAL -- State number of the termination state. */
  397. #define YYFINAL 9
  398. /* YYLAST -- Last index in YYTABLE. */
  399. #define YYLAST 54
  400. /* YYNTOKENS -- Number of terminals. */
  401. #define YYNTOKENS 16
  402. /* YYNNTS -- Number of nonterminals. */
  403. #define YYNNTS 3
  404. /* YYNRULES -- Number of rules. */
  405. #define YYNRULES 13
  406. /* YYNRULES -- Number of states. */
  407. #define YYNSTATES 27
  408. /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
  409. #define YYUNDEFTOK 2
  410. #define YYMAXUTOK 262
  411. #define YYTRANSLATE(YYX) \
  412. ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
  413. /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
  414. static const yytype_uint8 yytranslate[] =
  415. {
  416. 0, 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, 2, 2, 2, 2,
  419. 2, 2, 2, 10, 2, 2, 2, 2, 5, 2,
  420. 14, 15, 2, 2, 2, 2, 2, 2, 2, 2,
  421. 2, 2, 2, 2, 2, 2, 2, 2, 12, 2,
  422. 2, 2, 2, 3, 2, 2, 2, 2, 2, 2,
  423. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  424. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  425. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  426. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  427. 13, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  428. 2, 2, 2, 2, 4, 2, 2, 2, 2, 2,
  429. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  430. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  431. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  432. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  433. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  434. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  435. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  436. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  437. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  438. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  439. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  440. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  441. 2, 2, 2, 2, 2, 2, 1, 2, 6, 7,
  442. 8, 9, 11
  443. };
  444. #if YYDEBUG
  445. /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
  446. YYRHS. */
  447. static const yytype_uint8 yyprhs[] =
  448. {
  449. 0, 0, 3, 5, 11, 15, 19, 23, 27, 31,
  450. 35, 38, 40, 42
  451. };
  452. /* YYRHS -- A `-1'-separated list of the rules' RHS. */
  453. static const yytype_int8 yyrhs[] =
  454. {
  455. 17, 0, -1, 18, -1, 18, 3, 18, 12, 18,
  456. -1, 18, 4, 18, -1, 18, 5, 18, -1, 18,
  457. 6, 18, -1, 18, 7, 18, -1, 18, 8, 18,
  458. -1, 18, 9, 18, -1, 10, 18, -1, 13, -1,
  459. 11, -1, 14, 18, 15, -1
  460. };
  461. /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
  462. static const yytype_uint8 yyrline[] =
  463. {
  464. 0, 154, 154, 162, 166, 170, 174, 178, 182, 186,
  465. 190, 194, 198, 203
  466. };
  467. #endif
  468. #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
  469. /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
  470. First, the terminals, then, starting at YYNTOKENS, nonterminals. */
  471. static const char *const yytname[] =
  472. {
  473. "$end", "error", "$undefined", "'?'", "'|'", "'&'", "EQUOP2", "CMPOP2",
  474. "ADDOP2", "MULOP2", "'!'", "NUMBER", "':'", "'n'", "'('", "')'",
  475. "$accept", "start", "exp", 0
  476. };
  477. #endif
  478. # ifdef YYPRINT
  479. /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
  480. token YYLEX-NUM. */
  481. static const yytype_uint16 yytoknum[] =
  482. {
  483. 0, 256, 257, 63, 124, 38, 258, 259, 260, 261,
  484. 33, 262, 58, 110, 40, 41
  485. };
  486. # endif
  487. /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
  488. static const yytype_uint8 yyr1[] =
  489. {
  490. 0, 16, 17, 18, 18, 18, 18, 18, 18, 18,
  491. 18, 18, 18, 18
  492. };
  493. /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
  494. static const yytype_uint8 yyr2[] =
  495. {
  496. 0, 2, 1, 5, 3, 3, 3, 3, 3, 3,
  497. 2, 1, 1, 3
  498. };
  499. /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
  500. STATE-NUM when YYTABLE doesn't specify something else to do. Zero
  501. means the default is an error. */
  502. static const yytype_uint8 yydefact[] =
  503. {
  504. 0, 0, 12, 11, 0, 0, 2, 10, 0, 1,
  505. 0, 0, 0, 0, 0, 0, 0, 13, 0, 4,
  506. 5, 6, 7, 8, 9, 0, 3
  507. };
  508. /* YYDEFGOTO[NTERM-NUM]. */
  509. static const yytype_int8 yydefgoto[] =
  510. {
  511. -1, 5, 6
  512. };
  513. /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
  514. STATE-NUM. */
  515. #define YYPACT_NINF -10
  516. static const yytype_int8 yypact[] =
  517. {
  518. -9, -9, -10, -10, -9, 8, 36, -10, 13, -10,
  519. -9, -9, -9, -9, -9, -9, -9, -10, 26, 41,
  520. 45, 18, -2, 14, -10, -9, 36
  521. };
  522. /* YYPGOTO[NTERM-NUM]. */
  523. static const yytype_int8 yypgoto[] =
  524. {
  525. -10, -10, -1
  526. };
  527. /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
  528. positive, shift that token. If negative, reduce the rule which
  529. number is the opposite. If zero, do what YYDEFACT says.
  530. If YYTABLE_NINF, syntax error. */
  531. #define YYTABLE_NINF -1
  532. static const yytype_uint8 yytable[] =
  533. {
  534. 7, 1, 2, 8, 3, 4, 15, 16, 9, 18,
  535. 19, 20, 21, 22, 23, 24, 10, 11, 12, 13,
  536. 14, 15, 16, 16, 26, 14, 15, 16, 17, 10,
  537. 11, 12, 13, 14, 15, 16, 0, 0, 25, 10,
  538. 11, 12, 13, 14, 15, 16, 12, 13, 14, 15,
  539. 16, 13, 14, 15, 16
  540. };
  541. static const yytype_int8 yycheck[] =
  542. {
  543. 1, 10, 11, 4, 13, 14, 8, 9, 0, 10,
  544. 11, 12, 13, 14, 15, 16, 3, 4, 5, 6,
  545. 7, 8, 9, 9, 25, 7, 8, 9, 15, 3,
  546. 4, 5, 6, 7, 8, 9, -1, -1, 12, 3,
  547. 4, 5, 6, 7, 8, 9, 5, 6, 7, 8,
  548. 9, 6, 7, 8, 9
  549. };
  550. /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
  551. symbol of state STATE-NUM. */
  552. static const yytype_uint8 yystos[] =
  553. {
  554. 0, 10, 11, 13, 14, 17, 18, 18, 18, 0,
  555. 3, 4, 5, 6, 7, 8, 9, 15, 18, 18,
  556. 18, 18, 18, 18, 18, 12, 18
  557. };
  558. #define yyerrok (yyerrstatus = 0)
  559. #define yyclearin (yychar = YYEMPTY)
  560. #define YYEMPTY (-2)
  561. #define YYEOF 0
  562. #define YYACCEPT goto yyacceptlab
  563. #define YYABORT goto yyabortlab
  564. #define YYERROR goto yyerrorlab
  565. /* Like YYERROR except do call yyerror. This remains here temporarily
  566. to ease the transition to the new meaning of YYERROR, for GCC.
  567. Once GCC version 2 has supplanted version 1, this can go. */
  568. #define YYFAIL goto yyerrlab
  569. #define YYRECOVERING() (!!yyerrstatus)
  570. #define YYBACKUP(Token, Value) \
  571. do \
  572. if (yychar == YYEMPTY && yylen == 1) \
  573. { \
  574. yychar = (Token); \
  575. yylval = (Value); \
  576. yytoken = YYTRANSLATE (yychar); \
  577. YYPOPSTACK (1); \
  578. goto yybackup; \
  579. } \
  580. else \
  581. { \
  582. yyerror (YY_("syntax error: cannot back up")); \
  583. YYERROR; \
  584. } \
  585. while (YYID (0))
  586. #define YYTERROR 1
  587. #define YYERRCODE 256
  588. /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
  589. If N is 0, then set CURRENT to the empty location which ends
  590. the previous symbol: RHS[0] (always defined). */
  591. #define YYRHSLOC(Rhs, K) ((Rhs)[K])
  592. #ifndef YYLLOC_DEFAULT
  593. # define YYLLOC_DEFAULT(Current, Rhs, N) \
  594. do \
  595. if (YYID (N)) \
  596. { \
  597. (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
  598. (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
  599. (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
  600. (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
  601. } \
  602. else \
  603. { \
  604. (Current).first_line = (Current).last_line = \
  605. YYRHSLOC (Rhs, 0).last_line; \
  606. (Current).first_column = (Current).last_column = \
  607. YYRHSLOC (Rhs, 0).last_column; \
  608. } \
  609. while (YYID (0))
  610. #endif
  611. /* YY_LOCATION_PRINT -- Print the location on the stream.
  612. This macro was not mandated originally: define only if we know
  613. we won't break user code: when these are the locations we know. */
  614. #ifndef YY_LOCATION_PRINT
  615. # if YYLTYPE_IS_TRIVIAL
  616. # define YY_LOCATION_PRINT(File, Loc) \
  617. fprintf (File, "%d.%d-%d.%d", \
  618. (Loc).first_line, (Loc).first_column, \
  619. (Loc).last_line, (Loc).last_column)
  620. # else
  621. # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
  622. # endif
  623. #endif
  624. /* YYLEX -- calling `yylex' with the right arguments. */
  625. #ifdef YYLEX_PARAM
  626. # define YYLEX yylex (&yylval, YYLEX_PARAM)
  627. #else
  628. # define YYLEX yylex (&yylval)
  629. #endif
  630. /* Enable debugging if requested. */
  631. #if YYDEBUG
  632. # ifndef YYFPRINTF
  633. # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
  634. # define YYFPRINTF fprintf
  635. # endif
  636. # define YYDPRINTF(Args) \
  637. do { \
  638. if (yydebug) \
  639. YYFPRINTF Args; \
  640. } while (YYID (0))
  641. # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
  642. do { \
  643. if (yydebug) \
  644. { \
  645. YYFPRINTF (stderr, "%s ", Title); \
  646. yy_symbol_print (stderr, \
  647. Type, Value); \
  648. YYFPRINTF (stderr, "\n"); \
  649. } \
  650. } while (YYID (0))
  651. /*--------------------------------.
  652. | Print this symbol on YYOUTPUT. |
  653. `--------------------------------*/
  654. /*ARGSUSED*/
  655. #if (defined __STDC__ || defined __C99__FUNC__ \
  656. || defined __cplusplus || defined _MSC_VER)
  657. static void
  658. yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
  659. #else
  660. static void
  661. yy_symbol_value_print (yyoutput, yytype, yyvaluep)
  662. FILE *yyoutput;
  663. int yytype;
  664. YYSTYPE const * const yyvaluep;
  665. #endif
  666. {
  667. if (!yyvaluep)
  668. return;
  669. # ifdef YYPRINT
  670. if (yytype < YYNTOKENS)
  671. YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
  672. # else
  673. YYUSE (yyoutput);
  674. # endif
  675. switch (yytype)
  676. {
  677. default:
  678. break;
  679. }
  680. }
  681. /*--------------------------------.
  682. | Print this symbol on YYOUTPUT. |
  683. `--------------------------------*/
  684. #if (defined __STDC__ || defined __C99__FUNC__ \
  685. || defined __cplusplus || defined _MSC_VER)
  686. static void
  687. yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
  688. #else
  689. static void
  690. yy_symbol_print (yyoutput, yytype, yyvaluep)
  691. FILE *yyoutput;
  692. int yytype;
  693. YYSTYPE const * const yyvaluep;
  694. #endif
  695. {
  696. if (yytype < YYNTOKENS)
  697. YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
  698. else
  699. YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
  700. yy_symbol_value_print (yyoutput, yytype, yyvaluep);
  701. YYFPRINTF (yyoutput, ")");
  702. }
  703. /*------------------------------------------------------------------.
  704. | yy_stack_print -- Print the state stack from its BOTTOM up to its |
  705. | TOP (included). |
  706. `------------------------------------------------------------------*/
  707. #if (defined __STDC__ || defined __C99__FUNC__ \
  708. || defined __cplusplus || defined _MSC_VER)
  709. static void
  710. yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
  711. #else
  712. static void
  713. yy_stack_print (yybottom, yytop)
  714. yytype_int16 *yybottom;
  715. yytype_int16 *yytop;
  716. #endif
  717. {
  718. YYFPRINTF (stderr, "Stack now");
  719. for (; yybottom <= yytop; yybottom++)
  720. {
  721. int yybot = *yybottom;
  722. YYFPRINTF (stderr, " %d", yybot);
  723. }
  724. YYFPRINTF (stderr, "\n");
  725. }
  726. # define YY_STACK_PRINT(Bottom, Top) \
  727. do { \
  728. if (yydebug) \
  729. yy_stack_print ((Bottom), (Top)); \
  730. } while (YYID (0))
  731. /*------------------------------------------------.
  732. | Report that the YYRULE is going to be reduced. |
  733. `------------------------------------------------*/
  734. #if (defined __STDC__ || defined __C99__FUNC__ \
  735. || defined __cplusplus || defined _MSC_VER)
  736. static void
  737. yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
  738. #else
  739. static void
  740. yy_reduce_print (yyvsp, yyrule)
  741. YYSTYPE *yyvsp;
  742. int yyrule;
  743. #endif
  744. {
  745. int yynrhs = yyr2[yyrule];
  746. int yyi;
  747. unsigned long int yylno = yyrline[yyrule];
  748. YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
  749. yyrule - 1, yylno);
  750. /* The symbols being reduced. */
  751. for (yyi = 0; yyi < yynrhs; yyi++)
  752. {
  753. fprintf (stderr, " $%d = ", yyi + 1);
  754. yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
  755. &(yyvsp[(yyi + 1) - (yynrhs)])
  756. );
  757. fprintf (stderr, "\n");
  758. }
  759. }
  760. # define YY_REDUCE_PRINT(Rule) \
  761. do { \
  762. if (yydebug) \
  763. yy_reduce_print (yyvsp, Rule); \
  764. } while (YYID (0))
  765. /* Nonzero means print parse trace. It is left uninitialized so that
  766. multiple parsers can coexist. */
  767. int yydebug;
  768. #else /* !YYDEBUG */
  769. # define YYDPRINTF(Args)
  770. # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
  771. # define YY_STACK_PRINT(Bottom, Top)
  772. # define YY_REDUCE_PRINT(Rule)
  773. #endif /* !YYDEBUG */
  774. /* YYINITDEPTH -- initial size of the parser's stacks. */
  775. #ifndef YYINITDEPTH
  776. # define YYINITDEPTH 200
  777. #endif
  778. /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
  779. if the built-in stack extension method is used).
  780. Do not make this value too large; the results are undefined if
  781. YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
  782. evaluated with infinite-precision integer arithmetic. */
  783. #ifndef YYMAXDEPTH
  784. # define YYMAXDEPTH 10000
  785. #endif
  786. #if YYERROR_VERBOSE
  787. # ifndef yystrlen
  788. # if defined __GLIBC__ && defined _STRING_H
  789. # define yystrlen strlen
  790. # else
  791. /* Return the length of YYSTR. */
  792. #if (defined __STDC__ || defined __C99__FUNC__ \
  793. || defined __cplusplus || defined _MSC_VER)
  794. static YYSIZE_T
  795. yystrlen (const char *yystr)
  796. #else
  797. static YYSIZE_T
  798. yystrlen (yystr)
  799. const char *yystr;
  800. #endif
  801. {
  802. YYSIZE_T yylen;
  803. for (yylen = 0; yystr[yylen]; yylen++)
  804. continue;
  805. return yylen;
  806. }
  807. # endif
  808. # endif
  809. # ifndef yystpcpy
  810. # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
  811. # define yystpcpy stpcpy
  812. # else
  813. /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
  814. YYDEST. */
  815. #if (defined __STDC__ || defined __C99__FUNC__ \
  816. || defined __cplusplus || defined _MSC_VER)
  817. static char *
  818. yystpcpy (char *yydest, const char *yysrc)
  819. #else
  820. static char *
  821. yystpcpy (yydest, yysrc)
  822. char *yydest;
  823. const char *yysrc;
  824. #endif
  825. {
  826. char *yyd = yydest;
  827. const char *yys = yysrc;
  828. while ((*yyd++ = *yys++) != '\0')
  829. continue;
  830. return yyd - 1;
  831. }
  832. # endif
  833. # endif
  834. # ifndef yytnamerr
  835. /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
  836. quotes and backslashes, so that it's suitable for yyerror. The
  837. heuristic is that double-quoting is unnecessary unless the string
  838. contains an apostrophe, a comma, or backslash (other than
  839. backslash-backslash). YYSTR is taken from yytname. If YYRES is
  840. null, do not copy; instead, return the length of what the result
  841. would have been. */
  842. static YYSIZE_T
  843. yytnamerr (char *yyres, const char *yystr)
  844. {
  845. if (*yystr == '"')
  846. {
  847. YYSIZE_T yyn = 0;
  848. char const *yyp = yystr;
  849. for (;;)
  850. switch (*++yyp)
  851. {
  852. case '\'':
  853. case ',':
  854. goto do_not_strip_quotes;
  855. case '\\':
  856. if (*++yyp != '\\')
  857. goto do_not_strip_quotes;
  858. /* Fall through. */
  859. default:
  860. if (yyres)
  861. yyres[yyn] = *yyp;
  862. yyn++;
  863. break;
  864. case '"':
  865. if (yyres)
  866. yyres[yyn] = '\0';
  867. return yyn;
  868. }
  869. do_not_strip_quotes: ;
  870. }
  871. if (! yyres)
  872. return yystrlen (yystr);
  873. return yystpcpy (yyres, yystr) - yyres;
  874. }
  875. # endif
  876. /* Copy into YYRESULT an error message about the unexpected token
  877. YYCHAR while in state YYSTATE. Return the number of bytes copied,
  878. including the terminating null byte. If YYRESULT is null, do not
  879. copy anything; just return the number of bytes that would be
  880. copied. As a special case, return 0 if an ordinary "syntax error"
  881. message will do. Return YYSIZE_MAXIMUM if overflow occurs during
  882. size calculation. */
  883. static YYSIZE_T
  884. yysyntax_error (char *yyresult, int yystate, int yychar)
  885. {
  886. int yyn = yypact[yystate];
  887. if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
  888. return 0;
  889. else
  890. {
  891. int yytype = YYTRANSLATE (yychar);
  892. YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
  893. YYSIZE_T yysize = yysize0;
  894. YYSIZE_T yysize1;
  895. int yysize_overflow = 0;
  896. enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
  897. char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
  898. int yyx;
  899. # if 0
  900. /* This is so xgettext sees the translatable formats that are
  901. constructed on the fly. */
  902. YY_("syntax error, unexpected %s");
  903. YY_("syntax error, unexpected %s, expecting %s");
  904. YY_("syntax error, unexpected %s, expecting %s or %s");
  905. YY_("syntax error, unexpected %s, expecting %s or %s or %s");
  906. YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
  907. # endif
  908. char *yyfmt;
  909. char const *yyf;
  910. static char const yyunexpected[] = "syntax error, unexpected %s";
  911. static char const yyexpecting[] = ", expecting %s";
  912. static char const yyor[] = " or %s";
  913. char yyformat[sizeof yyunexpected
  914. + sizeof yyexpecting - 1
  915. + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
  916. * (sizeof yyor - 1))];
  917. char const *yyprefix = yyexpecting;
  918. /* Start YYX at -YYN if negative to avoid negative indexes in
  919. YYCHECK. */
  920. int yyxbegin = yyn < 0 ? -yyn : 0;
  921. /* Stay within bounds of both yycheck and yytname. */
  922. int yychecklim = YYLAST - yyn + 1;
  923. int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
  924. int yycount = 1;
  925. yyarg[0] = yytname[yytype];
  926. yyfmt = yystpcpy (yyformat, yyunexpected);
  927. for (yyx = yyxbegin; yyx < yyxend; ++yyx)
  928. if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
  929. {
  930. if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
  931. {
  932. yycount = 1;
  933. yysize = yysize0;
  934. yyformat[sizeof yyunexpected - 1] = '\0';
  935. break;
  936. }
  937. yyarg[yycount++] = yytname[yyx];
  938. yysize1 = yysize + yytnamerr (0, yytname[yyx]);
  939. yysize_overflow |= (yysize1 < yysize);
  940. yysize = yysize1;
  941. yyfmt = yystpcpy (yyfmt, yyprefix);
  942. yyprefix = yyor;
  943. }
  944. yyf = YY_(yyformat);
  945. yysize1 = yysize + yystrlen (yyf);
  946. yysize_overflow |= (yysize1 < yysize);
  947. yysize = yysize1;
  948. if (yysize_overflow)
  949. return YYSIZE_MAXIMUM;
  950. if (yyresult)
  951. {
  952. /* Avoid sprintf, as that infringes on the user's name space.
  953. Don't have undefined behavior even if the translation
  954. produced a string with the wrong number of "%s"s. */
  955. char *yyp = yyresult;
  956. int yyi = 0;
  957. while ((*yyp = *yyf) != '\0')
  958. {
  959. if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
  960. {
  961. yyp += yytnamerr (yyp, yyarg[yyi++]);
  962. yyf += 2;
  963. }
  964. else
  965. {
  966. yyp++;
  967. yyf++;
  968. }
  969. }
  970. }
  971. return yysize;
  972. }
  973. }
  974. #endif /* YYERROR_VERBOSE */
  975. /*-----------------------------------------------.
  976. | Release the memory associated to this symbol. |
  977. `-----------------------------------------------*/
  978. /*ARGSUSED*/
  979. #if (defined __STDC__ || defined __C99__FUNC__ \
  980. || defined __cplusplus || defined _MSC_VER)
  981. static void
  982. yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
  983. #else
  984. static void
  985. yydestruct (yymsg, yytype, yyvaluep)
  986. const char *yymsg;
  987. int yytype;
  988. YYSTYPE *yyvaluep;
  989. #endif
  990. {
  991. YYUSE (yyvaluep);
  992. if (!yymsg)
  993. yymsg = "Deleting";
  994. YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
  995. switch (yytype)
  996. {
  997. default:
  998. break;
  999. }
  1000. }
  1001. /* Prevent warnings from -Wmissing-prototypes. */
  1002. #ifdef YYPARSE_PARAM
  1003. #if defined __STDC__ || defined __cplusplus
  1004. int yyparse (void *YYPARSE_PARAM);
  1005. #else
  1006. int yyparse ();
  1007. #endif
  1008. #else /* ! YYPARSE_PARAM */
  1009. #if defined __STDC__ || defined __cplusplus
  1010. int yyparse (void);
  1011. #else
  1012. int yyparse ();
  1013. #endif
  1014. #endif /* ! YYPARSE_PARAM */
  1015. /*----------.
  1016. | yyparse. |
  1017. `----------*/
  1018. #ifdef YYPARSE_PARAM
  1019. #if (defined __STDC__ || defined __C99__FUNC__ \
  1020. || defined __cplusplus || defined _MSC_VER)
  1021. int
  1022. yyparse (void *YYPARSE_PARAM)
  1023. #else
  1024. int
  1025. yyparse (YYPARSE_PARAM)
  1026. void *YYPARSE_PARAM;
  1027. #endif
  1028. #else /* ! YYPARSE_PARAM */
  1029. #if (defined __STDC__ || defined __C99__FUNC__ \
  1030. || defined __cplusplus || defined _MSC_VER)
  1031. int
  1032. yyparse (void)
  1033. #else
  1034. int
  1035. yyparse ()
  1036. #endif
  1037. #endif
  1038. {
  1039. /* The lookahead symbol. */
  1040. int yychar;
  1041. /* The semantic value of the lookahead symbol. */
  1042. YYSTYPE yylval;
  1043. /* Number of syntax errors so far. */
  1044. int yynerrs;
  1045. int yystate;
  1046. int yyn;
  1047. int yyresult;
  1048. /* Number of tokens to shift before error messages enabled. */
  1049. int yyerrstatus;
  1050. /* Lookahead token as an internal (translated) token number. */
  1051. int yytoken = 0;
  1052. #if YYERROR_VERBOSE
  1053. /* Buffer for error messages, and its allocated size. */
  1054. char yymsgbuf[128];
  1055. char *yymsg = yymsgbuf;
  1056. YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
  1057. #endif
  1058. /* Three stacks and their tools:
  1059. `yyss': related to states,
  1060. `yyvs': related to semantic values,
  1061. `yyls': related to locations.
  1062. Refer to the stacks thru separate pointers, to allow yyoverflow
  1063. to reallocate them elsewhere. */
  1064. /* The state stack. */
  1065. yytype_int16 yyssa[YYINITDEPTH];
  1066. yytype_int16 *yyss = yyssa;
  1067. yytype_int16 *yyssp;
  1068. /* The semantic value stack. */
  1069. YYSTYPE yyvsa[YYINITDEPTH];
  1070. YYSTYPE *yyvs = yyvsa;
  1071. YYSTYPE *yyvsp;
  1072. #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
  1073. YYSIZE_T yystacksize = YYINITDEPTH;
  1074. /* The variables used to return semantic value and location from the
  1075. action routines. */
  1076. YYSTYPE yyval;
  1077. /* The number of symbols on the RHS of the reduced rule.
  1078. Keep to zero when no symbol should be popped. */
  1079. int yylen = 0;
  1080. YYDPRINTF ((stderr, "Starting parse\n"));
  1081. yystate = 0;
  1082. yyerrstatus = 0;
  1083. yynerrs = 0;
  1084. yychar = YYEMPTY; /* Cause a token to be read. */
  1085. /* Initialize stack pointers.
  1086. Waste one element of value and location stack
  1087. so that they stay on the same level as the state stack.
  1088. The wasted elements are never initialized. */
  1089. yyssp = yyss;
  1090. yyvsp = yyvs;
  1091. goto yysetstate;
  1092. /*------------------------------------------------------------.
  1093. | yynewstate -- Push a new state, which is found in yystate. |
  1094. `------------------------------------------------------------*/
  1095. yynewstate:
  1096. /* In all cases, when you get here, the value and location stacks
  1097. have just been pushed. So pushing a state here evens the stacks. */
  1098. yyssp++;
  1099. yysetstate:
  1100. *yyssp = yystate;
  1101. if (yyss + yystacksize - 1 <= yyssp)
  1102. {
  1103. /* Get the current used size of the three stacks, in elements. */
  1104. YYSIZE_T yysize = yyssp - yyss + 1;
  1105. #ifdef yyoverflow
  1106. {
  1107. /* Give user a chance to reallocate the stack. Use copies of
  1108. these so that the &'s don't force the real ones into
  1109. memory. */
  1110. YYSTYPE *yyvs1 = yyvs;
  1111. yytype_int16 *yyss1 = yyss;
  1112. /* Each stack pointer address is followed by the size of the
  1113. data in use in that stack, in bytes. This used to be a
  1114. conditional around just the two extra args, but that might
  1115. be undefined if yyoverflow is a macro. */
  1116. yyoverflow (YY_("memory exhausted"),
  1117. &yyss1, yysize * sizeof (*yyssp),
  1118. &yyvs1, yysize * sizeof (*yyvsp),
  1119. &yystacksize);
  1120. yyss = yyss1;
  1121. yyvs = yyvs1;
  1122. }
  1123. #else /* no yyoverflow */
  1124. # ifndef YYSTACK_RELOCATE
  1125. goto yyexhaustedlab;
  1126. # else
  1127. /* Extend the stack our own way. */
  1128. if (YYMAXDEPTH <= yystacksize)
  1129. goto yyexhaustedlab;
  1130. yystacksize *= 2;
  1131. if (YYMAXDEPTH < yystacksize)
  1132. yystacksize = YYMAXDEPTH;
  1133. {
  1134. yytype_int16 *yyss1 = yyss;
  1135. union yyalloc *yyptr =
  1136. (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
  1137. if (! yyptr)
  1138. goto yyexhaustedlab;
  1139. YYSTACK_RELOCATE (yyss);
  1140. YYSTACK_RELOCATE (yyvs);
  1141. # undef YYSTACK_RELOCATE
  1142. if (yyss1 != yyssa)
  1143. YYSTACK_FREE (yyss1);
  1144. }
  1145. # endif
  1146. #endif /* no yyoverflow */
  1147. yyssp = yyss + yysize - 1;
  1148. yyvsp = yyvs + yysize - 1;
  1149. YYDPRINTF ((stderr, "Stack size increased to %lu\n",
  1150. (unsigned long int) yystacksize));
  1151. if (yyss + yystacksize - 1 <= yyssp)
  1152. YYABORT;
  1153. }
  1154. YYDPRINTF ((stderr, "Entering state %d\n", yystate));
  1155. if (yystate == YYFINAL)
  1156. YYACCEPT;
  1157. goto yybackup;
  1158. /*-----------.
  1159. | yybackup. |
  1160. `-----------*/
  1161. yybackup:
  1162. /* Do appropriate processing given the current state. Read a
  1163. lookahead token if we need one and don't already have one. */
  1164. /* First try to decide what to do without reference to lookahead token. */
  1165. yyn = yypact[yystate];
  1166. if (yyn == YYPACT_NINF)
  1167. goto yydefault;
  1168. /* Not known => get a lookahead token if don't already have one. */
  1169. /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
  1170. if (yychar == YYEMPTY)
  1171. {
  1172. YYDPRINTF ((stderr, "Reading a token: "));
  1173. yychar = YYLEX;
  1174. }
  1175. if (yychar <= YYEOF)
  1176. {
  1177. yychar = yytoken = YYEOF;
  1178. YYDPRINTF ((stderr, "Now at end of input.\n"));
  1179. }
  1180. else
  1181. {
  1182. yytoken = YYTRANSLATE (yychar);
  1183. YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
  1184. }
  1185. /* If the proper action on seeing token YYTOKEN is to reduce or to
  1186. detect an error, take that action. */
  1187. yyn += yytoken;
  1188. if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
  1189. goto yydefault;
  1190. yyn = yytable[yyn];
  1191. if (yyn <= 0)
  1192. {
  1193. if (yyn == 0 || yyn == YYTABLE_NINF)
  1194. goto yyerrlab;
  1195. yyn = -yyn;
  1196. goto yyreduce;
  1197. }
  1198. /* Count tokens shifted since error; after three, turn off error
  1199. status. */
  1200. if (yyerrstatus)
  1201. yyerrstatus--;
  1202. /* Shift the lookahead token. */
  1203. YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
  1204. /* Discard the shifted token. */
  1205. yychar = YYEMPTY;
  1206. yystate = yyn;
  1207. *++yyvsp = yylval;
  1208. goto yynewstate;
  1209. /*-----------------------------------------------------------.
  1210. | yydefault -- do the default action for the current state. |
  1211. `-----------------------------------------------------------*/
  1212. yydefault:
  1213. yyn = yydefact[yystate];
  1214. if (yyn == 0)
  1215. goto yyerrlab;
  1216. goto yyreduce;
  1217. /*-----------------------------.
  1218. | yyreduce -- Do a reduction. |
  1219. `-----------------------------*/
  1220. yyreduce:
  1221. /* yyn is the number of a rule to reduce with. */
  1222. yylen = yyr2[yyn];
  1223. /* If YYLEN is nonzero, implement the default value of the action:
  1224. `$$ = $1'.
  1225. Otherwise, the following line sets YYVAL to garbage.
  1226. This behavior is undocumented and Bison
  1227. users should not rely upon it. Assigning to YYVAL
  1228. unconditionally makes the parser a bit smaller, and it avoids a
  1229. GCC warning that YYVAL may be used uninitialized. */
  1230. yyval = yyvsp[1-yylen];
  1231. YY_REDUCE_PRINT (yyn);
  1232. switch (yyn)
  1233. {
  1234. case 2:
  1235. /* Line 1269 of yacc.c. */
  1236. #line 155 "plural.y"
  1237. {
  1238. if ((yyvsp[(1) - (1)].exp) == NULL)
  1239. YYABORT;
  1240. ((struct parse_args *) arg)->res = (yyvsp[(1) - (1)].exp);
  1241. }
  1242. break;
  1243. case 3:
  1244. /* Line 1269 of yacc.c. */
  1245. #line 163 "plural.y"
  1246. {
  1247. (yyval.exp) = new_exp_3 (qmop, (yyvsp[(1) - (5)].exp), (yyvsp[(3) - (5)].exp), (yyvsp[(5) - (5)].exp));
  1248. }
  1249. break;
  1250. case 4:
  1251. /* Line 1269 of yacc.c. */
  1252. #line 167 "plural.y"
  1253. {
  1254. (yyval.exp) = new_exp_2 (lor, (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
  1255. }
  1256. break;
  1257. case 5:
  1258. /* Line 1269 of yacc.c. */
  1259. #line 171 "plural.y"
  1260. {
  1261. (yyval.exp) = new_exp_2 (land, (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
  1262. }
  1263. break;
  1264. case 6:
  1265. /* Line 1269 of yacc.c. */
  1266. #line 175 "plural.y"
  1267. {
  1268. (yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
  1269. }
  1270. break;
  1271. case 7:
  1272. /* Line 1269 of yacc.c. */
  1273. #line 179 "plural.y"
  1274. {
  1275. (yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
  1276. }
  1277. break;
  1278. case 8:
  1279. /* Line 1269 of yacc.c. */
  1280. #line 183 "plural.y"
  1281. {
  1282. (yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
  1283. }
  1284. break;
  1285. case 9:
  1286. /* Line 1269 of yacc.c. */
  1287. #line 187 "plural.y"
  1288. {
  1289. (yyval.exp) = new_exp_2 ((yyvsp[(2) - (3)].op), (yyvsp[(1) - (3)].exp), (yyvsp[(3) - (3)].exp));
  1290. }
  1291. break;
  1292. case 10:
  1293. /* Line 1269 of yacc.c. */
  1294. #line 191 "plural.y"
  1295. {
  1296. (yyval.exp) = new_exp_1 (lnot, (yyvsp[(2) - (2)].exp));
  1297. }
  1298. break;
  1299. case 11:
  1300. /* Line 1269 of yacc.c. */
  1301. #line 195 "plural.y"
  1302. {
  1303. (yyval.exp) = new_exp_0 (var);
  1304. }
  1305. break;
  1306. case 12:
  1307. /* Line 1269 of yacc.c. */
  1308. #line 199 "plural.y"
  1309. {
  1310. if (((yyval.exp) = new_exp_0 (num)) != NULL)
  1311. (yyval.exp)->val.num = (yyvsp[(1) - (1)].num);
  1312. }
  1313. break;
  1314. case 13:
  1315. /* Line 1269 of yacc.c. */
  1316. #line 204 "plural.y"
  1317. {
  1318. (yyval.exp) = (yyvsp[(2) - (3)].exp);
  1319. }
  1320. break;
  1321. /* Line 1269 of yacc.c. */
  1322. #line 1572 "plural.c"
  1323. default: break;
  1324. }
  1325. YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
  1326. YYPOPSTACK (yylen);
  1327. yylen = 0;
  1328. YY_STACK_PRINT (yyss, yyssp);
  1329. *++yyvsp = yyval;
  1330. /* Now `shift' the result of the reduction. Determine what state
  1331. that goes to, based on the state we popped back to and the rule
  1332. number reduced by. */
  1333. yyn = yyr1[yyn];
  1334. yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
  1335. if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
  1336. yystate = yytable[yystate];
  1337. else
  1338. yystate = yydefgoto[yyn - YYNTOKENS];
  1339. goto yynewstate;
  1340. /*------------------------------------.
  1341. | yyerrlab -- here on detecting error |
  1342. `------------------------------------*/
  1343. yyerrlab:
  1344. /* If not already recovering from an error, report this error. */
  1345. if (!yyerrstatus)
  1346. {
  1347. ++yynerrs;
  1348. #if ! YYERROR_VERBOSE
  1349. yyerror (YY_("syntax error"));
  1350. #else
  1351. {
  1352. YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
  1353. if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
  1354. {
  1355. YYSIZE_T yyalloc = 2 * yysize;
  1356. if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
  1357. yyalloc = YYSTACK_ALLOC_MAXIMUM;
  1358. if (yymsg != yymsgbuf)
  1359. YYSTACK_FREE (yymsg);
  1360. yymsg = (char *) YYSTACK_ALLOC (yyalloc);
  1361. if (yymsg)
  1362. yymsg_alloc = yyalloc;
  1363. else
  1364. {
  1365. yymsg = yymsgbuf;
  1366. yymsg_alloc = sizeof yymsgbuf;
  1367. }
  1368. }
  1369. if (0 < yysize && yysize <= yymsg_alloc)
  1370. {
  1371. (void) yysyntax_error (yymsg, yystate, yychar);
  1372. yyerror (yymsg);
  1373. }
  1374. else
  1375. {
  1376. yyerror (YY_("syntax error"));
  1377. if (yysize != 0)
  1378. goto yyexhaustedlab;
  1379. }
  1380. }
  1381. #endif
  1382. }
  1383. if (yyerrstatus == 3)
  1384. {
  1385. /* If just tried and failed to reuse lookahead token after an
  1386. error, discard it. */
  1387. if (yychar <= YYEOF)
  1388. {
  1389. /* Return failure if at end of input. */
  1390. if (yychar == YYEOF)
  1391. YYABORT;
  1392. }
  1393. else
  1394. {
  1395. yydestruct ("Error: discarding",
  1396. yytoken, &yylval);
  1397. yychar = YYEMPTY;
  1398. }
  1399. }
  1400. /* Else will try to reuse lookahead token after shifting the error
  1401. token. */
  1402. goto yyerrlab1;
  1403. /*---------------------------------------------------.
  1404. | yyerrorlab -- error raised explicitly by YYERROR. |
  1405. `---------------------------------------------------*/
  1406. yyerrorlab:
  1407. /* Pacify compilers like GCC when the user code never invokes
  1408. YYERROR and the label yyerrorlab therefore never appears in user
  1409. code. */
  1410. if (/*CONSTCOND*/ 0)
  1411. goto yyerrorlab;
  1412. /* Do not reclaim the symbols of the rule which action triggered
  1413. this YYERROR. */
  1414. YYPOPSTACK (yylen);
  1415. yylen = 0;
  1416. YY_STACK_PRINT (yyss, yyssp);
  1417. yystate = *yyssp;
  1418. goto yyerrlab1;
  1419. /*-------------------------------------------------------------.
  1420. | yyerrlab1 -- common code for both syntax error and YYERROR. |
  1421. `-------------------------------------------------------------*/
  1422. yyerrlab1:
  1423. yyerrstatus = 3; /* Each real token shifted decrements this. */
  1424. for (;;)
  1425. {
  1426. yyn = yypact[yystate];
  1427. if (yyn != YYPACT_NINF)
  1428. {
  1429. yyn += YYTERROR;
  1430. if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
  1431. {
  1432. yyn = yytable[yyn];
  1433. if (0 < yyn)
  1434. break;
  1435. }
  1436. }
  1437. /* Pop the current state because it cannot handle the error token. */
  1438. if (yyssp == yyss)
  1439. YYABORT;
  1440. yydestruct ("Error: popping",
  1441. yystos[yystate], yyvsp);
  1442. YYPOPSTACK (1);
  1443. yystate = *yyssp;
  1444. YY_STACK_PRINT (yyss, yyssp);
  1445. }
  1446. *++yyvsp = yylval;
  1447. /* Shift the error token. */
  1448. YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
  1449. yystate = yyn;
  1450. goto yynewstate;
  1451. /*-------------------------------------.
  1452. | yyacceptlab -- YYACCEPT comes here. |
  1453. `-------------------------------------*/
  1454. yyacceptlab:
  1455. yyresult = 0;
  1456. goto yyreturn;
  1457. /*-----------------------------------.
  1458. | yyabortlab -- YYABORT comes here. |
  1459. `-----------------------------------*/
  1460. yyabortlab:
  1461. yyresult = 1;
  1462. goto yyreturn;
  1463. #ifndef yyoverflow
  1464. /*-------------------------------------------------.
  1465. | yyexhaustedlab -- memory exhaustion comes here. |
  1466. `-------------------------------------------------*/
  1467. yyexhaustedlab:
  1468. yyerror (YY_("memory exhausted"));
  1469. yyresult = 2;
  1470. /* Fall through. */
  1471. #endif
  1472. yyreturn:
  1473. if (yychar != YYEMPTY)
  1474. yydestruct ("Cleanup: discarding lookahead",
  1475. yytoken, &yylval);
  1476. /* Do not reclaim the symbols of the rule which action triggered
  1477. this YYABORT or YYACCEPT. */
  1478. YYPOPSTACK (yylen);
  1479. YY_STACK_PRINT (yyss, yyssp);
  1480. while (yyssp != yyss)
  1481. {
  1482. yydestruct ("Cleanup: popping",
  1483. yystos[*yyssp], yyvsp);
  1484. YYPOPSTACK (1);
  1485. }
  1486. #ifndef yyoverflow
  1487. if (yyss != yyssa)
  1488. YYSTACK_FREE (yyss);
  1489. #endif
  1490. #if YYERROR_VERBOSE
  1491. if (yymsg != yymsgbuf)
  1492. YYSTACK_FREE (yymsg);
  1493. #endif
  1494. /* Make sure YYID is used. */
  1495. return YYID (yyresult);
  1496. }
  1497. /* Line 1486 of yacc.c. */
  1498. #line 209 "plural.y"
  1499. void
  1500. internal_function
  1501. FREE_EXPRESSION (struct expression *exp)
  1502. {
  1503. if (exp == NULL)
  1504. return;
  1505. /* Handle the recursive case. */
  1506. switch (exp->nargs)
  1507. {
  1508. case 3:
  1509. FREE_EXPRESSION (exp->val.args[2]);
  1510. /* FALLTHROUGH */
  1511. case 2:
  1512. FREE_EXPRESSION (exp->val.args[1]);
  1513. /* FALLTHROUGH */
  1514. case 1:
  1515. FREE_EXPRESSION (exp->val.args[0]);
  1516. /* FALLTHROUGH */
  1517. default:
  1518. break;
  1519. }
  1520. free (exp);
  1521. }
  1522. static int
  1523. yylex (YYSTYPE *lval, const char **pexp)
  1524. {
  1525. const char *exp = *pexp;
  1526. int result;
  1527. while (1)
  1528. {
  1529. if (exp[0] == '\0')
  1530. {
  1531. *pexp = exp;
  1532. return YYEOF;
  1533. }
  1534. if (exp[0] != ' ' && exp[0] != '\t')
  1535. break;
  1536. ++exp;
  1537. }
  1538. result = *exp++;
  1539. switch (result)
  1540. {
  1541. case '0': case '1': case '2': case '3': case '4':
  1542. case '5': case '6': case '7': case '8': case '9':
  1543. {
  1544. unsigned long int n = result - '0';
  1545. while (exp[0] >= '0' && exp[0] <= '9')
  1546. {
  1547. n *= 10;
  1548. n += exp[0] - '0';
  1549. ++exp;
  1550. }
  1551. lval->num = n;
  1552. result = NUMBER;
  1553. }
  1554. break;
  1555. case '=':
  1556. if (exp[0] == '=')
  1557. {
  1558. ++exp;
  1559. lval->op = equal;
  1560. result = EQUOP2;
  1561. }
  1562. else
  1563. result = YYERRCODE;
  1564. break;
  1565. case '!':
  1566. if (exp[0] == '=')
  1567. {
  1568. ++exp;
  1569. lval->op = not_equal;
  1570. result = EQUOP2;
  1571. }
  1572. break;
  1573. case '&':
  1574. case '|':
  1575. if (exp[0] == result)
  1576. ++exp;
  1577. else
  1578. result = YYERRCODE;
  1579. break;
  1580. case '<':
  1581. if (exp[0] == '=')
  1582. {
  1583. ++exp;
  1584. lval->op = less_or_equal;
  1585. }
  1586. else
  1587. lval->op = less_than;
  1588. result = CMPOP2;
  1589. break;
  1590. case '>':
  1591. if (exp[0] == '=')
  1592. {
  1593. ++exp;
  1594. lval->op = greater_or_equal;
  1595. }
  1596. else
  1597. lval->op = greater_than;
  1598. result = CMPOP2;
  1599. break;
  1600. case '*':
  1601. lval->op = mult;
  1602. result = MULOP2;
  1603. break;
  1604. case '/':
  1605. lval->op = divide;
  1606. result = MULOP2;
  1607. break;
  1608. case '%':
  1609. lval->op = module;
  1610. result = MULOP2;
  1611. break;
  1612. case '+':
  1613. lval->op = plus;
  1614. result = ADDOP2;
  1615. break;
  1616. case '-':
  1617. lval->op = minus;
  1618. result = ADDOP2;
  1619. break;
  1620. case 'n':
  1621. case '?':
  1622. case ':':
  1623. case '(':
  1624. case ')':
  1625. /* Nothing, just return the character. */
  1626. break;
  1627. case ';':
  1628. case '\n':
  1629. case '\0':
  1630. /* Be safe and let the user call this function again. */
  1631. --exp;
  1632. result = YYEOF;
  1633. break;
  1634. default:
  1635. result = YYERRCODE;
  1636. #if YYDEBUG != 0
  1637. --exp;
  1638. #endif
  1639. break;
  1640. }
  1641. *pexp = exp;
  1642. return result;
  1643. }
  1644. static void
  1645. yyerror (const char *str)
  1646. {
  1647. /* Do nothing. We don't print error messages here. */
  1648. }