parse.c 69 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695
  1. /* A Bison parser, made by GNU Bison 2.3. */
  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.3"
  40. /* Skeleton name. */
  41. #define YYSKELETON_NAME "yacc.c"
  42. /* Pure parsers. */
  43. #define YYPURE 0
  44. /* Using locations. */
  45. #define YYLSP_NEEDED 0
  46. /* Tokens. */
  47. #ifndef YYTOKENTYPE
  48. # define YYTOKENTYPE
  49. /* Put the tokens into the symbol table, so that GDB and other debuggers
  50. know about them. */
  51. enum yytokentype {
  52. CHAR = 258,
  53. NUMBER = 259,
  54. SECTEND = 260,
  55. SCDECL = 261,
  56. XSCDECL = 262,
  57. NAME = 263,
  58. PREVCCL = 264,
  59. EOF_OP = 265,
  60. OPTION_OP = 266,
  61. OPT_OUTFILE = 267,
  62. OPT_PREFIX = 268,
  63. OPT_YYCLASS = 269,
  64. CCE_ALNUM = 270,
  65. CCE_ALPHA = 271,
  66. CCE_BLANK = 272,
  67. CCE_CNTRL = 273,
  68. CCE_DIGIT = 274,
  69. CCE_GRAPH = 275,
  70. CCE_LOWER = 276,
  71. CCE_PRINT = 277,
  72. CCE_PUNCT = 278,
  73. CCE_SPACE = 279,
  74. CCE_UPPER = 280,
  75. CCE_XDIGIT = 281
  76. };
  77. #endif
  78. /* Tokens. */
  79. #define CHAR 258
  80. #define NUMBER 259
  81. #define SECTEND 260
  82. #define SCDECL 261
  83. #define XSCDECL 262
  84. #define NAME 263
  85. #define PREVCCL 264
  86. #define EOF_OP 265
  87. #define OPTION_OP 266
  88. #define OPT_OUTFILE 267
  89. #define OPT_PREFIX 268
  90. #define OPT_YYCLASS 269
  91. #define CCE_ALNUM 270
  92. #define CCE_ALPHA 271
  93. #define CCE_BLANK 272
  94. #define CCE_CNTRL 273
  95. #define CCE_DIGIT 274
  96. #define CCE_GRAPH 275
  97. #define CCE_LOWER 276
  98. #define CCE_PRINT 277
  99. #define CCE_PUNCT 278
  100. #define CCE_SPACE 279
  101. #define CCE_UPPER 280
  102. #define CCE_XDIGIT 281
  103. /* Copy the first part of user declarations. */
  104. #line 9 "./parse.y"
  105. /*-
  106. * Copyright (c) 1990 The Regents of the University of California.
  107. * All rights reserved.
  108. *
  109. * This code is derived from software contributed to Berkeley by
  110. * Vern Paxson.
  111. *
  112. * The United States Government has rights in this work pursuant
  113. * to contract no. DE-AC03-76SF00098 between the United States
  114. * Department of Energy and the University of California.
  115. *
  116. * Redistribution and use in source and binary forms with or without
  117. * modification are permitted provided that: (1) source distributions retain
  118. * this entire copyright notice and comment, and (2) distributions including
  119. * binaries display the following acknowledgement: ``This product includes
  120. * software developed by the University of California, Berkeley and its
  121. * contributors'' in the documentation or other materials provided with the
  122. * distribution and in all advertising materials mentioning features or use
  123. * of this software. Neither the name of the University nor the names of
  124. * its contributors may be used to endorse or promote products derived from
  125. * this software without specific prior written permission.
  126. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  127. * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  128. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  129. */
  130. /* $Header: /opt/vlysenkov/CVSROOT/arcadia/contrib/tools/flex-old/parse.c,v 1.2 2007-11-30 02:28:15 pg Exp $ */
  131. /* Some versions of bison are broken in that they use alloca() but don't
  132. * declare it properly. The following is the patented (just kidding!)
  133. * #ifdef chud to fix the problem, courtesy of Francois Pinard.
  134. */
  135. #ifdef YYBISON
  136. /* AIX requires this to be the first thing in the file. What a piece. */
  137. # ifdef _AIX
  138. #pragma alloca
  139. # endif
  140. #endif
  141. #include "flexdef.h"
  142. /* The remainder of the alloca() cruft has to come after including flexdef.h,
  143. * so HAVE_ALLOCA_H is (possibly) defined.
  144. */
  145. #ifdef YYBISON
  146. # ifdef __GNUC__
  147. # ifndef alloca
  148. # define alloca __builtin_alloca
  149. # endif
  150. # else
  151. # if HAVE_ALLOCA_H
  152. # include <alloca.h>
  153. # else
  154. # ifdef __hpux
  155. void *alloca ();
  156. # else
  157. # ifdef __TURBOC__
  158. # include <malloc.h>
  159. # else
  160. char *alloca ();
  161. # endif
  162. # endif
  163. # endif
  164. # endif
  165. #endif
  166. /* Bletch, ^^^^ that was ugly! */
  167. int pat, scnum, eps, headcnt, trailcnt, anyccl, lastchar, i, rulelen;
  168. int trlcontxt, xcluflg, currccl, cclsorted, varlength, variable_trail_rule;
  169. int *scon_stk;
  170. int scon_stk_ptr;
  171. static int madeany = false; /* whether we've made the '.' character class */
  172. int previous_continued_action; /* whether the previous rule's action was '|' */
  173. /* Expand a POSIX character class expression. */
  174. #define CCL_EXPR(func) \
  175. { \
  176. int c; \
  177. for ( c = 0; c < csize; ++c ) \
  178. if ( isascii(c) && func(c) ) \
  179. ccladd( currccl, c ); \
  180. }
  181. /* While POSIX defines isblank(), it's not ANSI C. */
  182. #define IS_BLANK(c) ((c) == ' ' || (c) == '\t')
  183. /* On some over-ambitious machines, such as DEC Alpha's, the default
  184. * token type is "long" instead of "int"; this leads to problems with
  185. * declaring yylval in flexdef.h. But so far, all the yacc's I've seen
  186. * wrap their definitions of YYSTYPE with "#ifndef YYSTYPE"'s, so the
  187. * following should ensure that the default token type is "int".
  188. */
  189. #define YYSTYPE int
  190. /* Enabling traces. */
  191. #ifndef YYDEBUG
  192. # define YYDEBUG 0
  193. #endif
  194. /* Enabling verbose error messages. */
  195. #ifdef YYERROR_VERBOSE
  196. # undef YYERROR_VERBOSE
  197. # define YYERROR_VERBOSE 1
  198. #else
  199. # define YYERROR_VERBOSE 0
  200. #endif
  201. /* Enabling the token table. */
  202. #ifndef YYTOKEN_TABLE
  203. # define YYTOKEN_TABLE 0
  204. #endif
  205. #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
  206. typedef int YYSTYPE;
  207. # define yystype YYSTYPE /* obsolescent; will be withdrawn */
  208. # define YYSTYPE_IS_DECLARED 1
  209. # define YYSTYPE_IS_TRIVIAL 1
  210. #endif
  211. /* Copy the second part of user declarations. */
  212. /* Line 216 of yacc.c. */
  213. #line 260 "y.tab.c"
  214. #ifdef short
  215. # undef short
  216. #endif
  217. #ifdef YYTYPE_UINT8
  218. typedef YYTYPE_UINT8 yytype_uint8;
  219. #else
  220. typedef unsigned char yytype_uint8;
  221. #endif
  222. #ifdef YYTYPE_INT8
  223. typedef YYTYPE_INT8 yytype_int8;
  224. #elif (defined __STDC__ || defined __C99__FUNC__ \
  225. || defined __cplusplus || defined _MSC_VER)
  226. typedef signed char yytype_int8;
  227. #else
  228. typedef short int yytype_int8;
  229. #endif
  230. #ifdef YYTYPE_UINT16
  231. typedef YYTYPE_UINT16 yytype_uint16;
  232. #else
  233. typedef unsigned short int yytype_uint16;
  234. #endif
  235. #ifdef YYTYPE_INT16
  236. typedef YYTYPE_INT16 yytype_int16;
  237. #else
  238. typedef short int yytype_int16;
  239. #endif
  240. #ifndef YYSIZE_T
  241. # ifdef __SIZE_TYPE__
  242. # define YYSIZE_T __SIZE_TYPE__
  243. # elif defined size_t
  244. # define YYSIZE_T size_t
  245. # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
  246. || defined __cplusplus || defined _MSC_VER)
  247. # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
  248. # define YYSIZE_T size_t
  249. # else
  250. # define YYSIZE_T unsigned int
  251. # endif
  252. #endif
  253. #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
  254. #ifndef YY_
  255. # if YYENABLE_NLS
  256. # if ENABLE_NLS
  257. # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
  258. # define YY_(msgid) dgettext ("bison-runtime", msgid)
  259. # endif
  260. # endif
  261. # ifndef YY_
  262. # define YY_(msgid) msgid
  263. # endif
  264. #endif
  265. /* Suppress unused-variable warnings by "using" E. */
  266. #if ! defined lint || defined __GNUC__
  267. # define YYUSE(e) ((void) (e))
  268. #else
  269. # define YYUSE(e) /* empty */
  270. #endif
  271. /* Identity function, used to suppress warnings about constant conditions. */
  272. #ifndef lint
  273. # define YYID(n) (n)
  274. #else
  275. #if (defined __STDC__ || defined __C99__FUNC__ \
  276. || defined __cplusplus || defined _MSC_VER)
  277. static int
  278. YYID (int i)
  279. #else
  280. static int
  281. YYID (i)
  282. int i;
  283. #endif
  284. {
  285. return i;
  286. }
  287. #endif
  288. #if ! defined yyoverflow || YYERROR_VERBOSE
  289. /* The parser invokes alloca or malloc; define the necessary symbols. */
  290. # ifdef YYSTACK_USE_ALLOCA
  291. # if YYSTACK_USE_ALLOCA
  292. # ifdef __GNUC__
  293. # define YYSTACK_ALLOC __builtin_alloca
  294. # elif defined __BUILTIN_VA_ARG_INCR
  295. # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
  296. # elif defined _AIX
  297. # define YYSTACK_ALLOC __alloca
  298. # elif defined _MSC_VER
  299. # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
  300. # define alloca _alloca
  301. # else
  302. # define YYSTACK_ALLOC alloca
  303. # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
  304. || defined __cplusplus || defined _MSC_VER)
  305. # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
  306. # ifndef _STDLIB_H
  307. # define _STDLIB_H 1
  308. # endif
  309. # endif
  310. # endif
  311. # endif
  312. # endif
  313. # ifdef YYSTACK_ALLOC
  314. /* Pacify GCC's `empty if-body' warning. */
  315. # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
  316. # ifndef YYSTACK_ALLOC_MAXIMUM
  317. /* The OS might guarantee only one guard page at the bottom of the stack,
  318. and a page size can be as small as 4096 bytes. So we cannot safely
  319. invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
  320. to allow for a few compiler-allocated temporary stack slots. */
  321. # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
  322. # endif
  323. # else
  324. # define YYSTACK_ALLOC YYMALLOC
  325. # define YYSTACK_FREE YYFREE
  326. # ifndef YYSTACK_ALLOC_MAXIMUM
  327. # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
  328. # endif
  329. # if (defined __cplusplus && ! defined _STDLIB_H \
  330. && ! ((defined YYMALLOC || defined malloc) \
  331. && (defined YYFREE || defined free)))
  332. # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
  333. # ifndef _STDLIB_H
  334. # define _STDLIB_H 1
  335. # endif
  336. # endif
  337. # ifndef YYMALLOC
  338. # define YYMALLOC malloc
  339. # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
  340. || defined __cplusplus || defined _MSC_VER)
  341. void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
  342. # endif
  343. # endif
  344. # ifndef YYFREE
  345. # define YYFREE free
  346. # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
  347. || defined __cplusplus || defined _MSC_VER)
  348. void free (void *); /* INFRINGES ON USER NAME SPACE */
  349. # endif
  350. # endif
  351. # endif
  352. #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
  353. #if (! defined yyoverflow \
  354. && (! defined __cplusplus \
  355. || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
  356. /* A type that is properly aligned for any stack member. */
  357. union yyalloc
  358. {
  359. yytype_int16 yyss;
  360. YYSTYPE yyvs;
  361. };
  362. /* The size of the maximum gap between one aligned stack and the next. */
  363. # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
  364. /* The size of an array large to enough to hold all stacks, each with
  365. N elements. */
  366. # define YYSTACK_BYTES(N) \
  367. ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
  368. + YYSTACK_GAP_MAXIMUM)
  369. /* Copy COUNT objects from FROM to TO. The source and destination do
  370. not overlap. */
  371. # ifndef YYCOPY
  372. # if defined __GNUC__ && 1 < __GNUC__
  373. # define YYCOPY(To, From, Count) \
  374. __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
  375. # else
  376. # define YYCOPY(To, From, Count) \
  377. do \
  378. { \
  379. YYSIZE_T yyi; \
  380. for (yyi = 0; yyi < (Count); yyi++) \
  381. (To)[yyi] = (From)[yyi]; \
  382. } \
  383. while (YYID (0))
  384. # endif
  385. # endif
  386. /* Relocate STACK from its old location to the new one. The
  387. local variables YYSIZE and YYSTACKSIZE give the old and new number of
  388. elements in the stack, and YYPTR gives the new location of the
  389. stack. Advance YYPTR to a properly aligned location for the next
  390. stack. */
  391. # define YYSTACK_RELOCATE(Stack) \
  392. do \
  393. { \
  394. YYSIZE_T yynewbytes; \
  395. YYCOPY (&yyptr->Stack, Stack, yysize); \
  396. Stack = &yyptr->Stack; \
  397. yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
  398. yyptr += yynewbytes / sizeof (*yyptr); \
  399. } \
  400. while (YYID (0))
  401. #endif
  402. /* YYFINAL -- State number of the termination state. */
  403. #define YYFINAL 3
  404. /* YYLAST -- Last index in YYTABLE. */
  405. #define YYLAST 110
  406. /* YYNTOKENS -- Number of terminals. */
  407. #define YYNTOKENS 48
  408. /* YYNNTS -- Number of nonterminals. */
  409. #define YYNNTS 26
  410. /* YYNRULES -- Number of rules. */
  411. #define YYNRULES 76
  412. /* YYNRULES -- Number of states. */
  413. #define YYNSTATES 107
  414. /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
  415. #define YYUNDEFTOK 2
  416. #define YYMAXUTOK 281
  417. #define YYTRANSLATE(YYX) \
  418. ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
  419. /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
  420. static const yytype_uint8 yytranslate[] =
  421. {
  422. 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  423. 28, 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, 42, 2, 36, 2, 2, 2,
  426. 43, 44, 34, 39, 35, 47, 41, 38, 2, 2,
  427. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  428. 32, 27, 33, 40, 2, 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, 45, 2, 46, 31, 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, 29, 37, 30, 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, 2, 2, 2, 2,
  442. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  443. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  444. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  445. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  446. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  447. 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
  448. 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
  449. 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
  450. 25, 26
  451. };
  452. #if YYDEBUG
  453. /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
  454. YYRHS. */
  455. static const yytype_uint8 yyprhs[] =
  456. {
  457. 0, 0, 3, 9, 10, 14, 17, 18, 20, 22,
  458. 24, 26, 29, 31, 33, 36, 39, 40, 44, 48,
  459. 52, 58, 64, 65, 66, 69, 71, 73, 75, 76,
  460. 81, 85, 86, 90, 92, 94, 96, 99, 103, 106,
  461. 108, 112, 114, 117, 120, 122, 125, 128, 131, 138,
  462. 144, 149, 151, 153, 155, 159, 163, 165, 169, 174,
  463. 179, 182, 185, 186, 188, 190, 192, 194, 196, 198,
  464. 200, 202, 204, 206, 208, 210, 213
  465. };
  466. /* YYRHS -- A `-1'-separated list of the rules' RHS. */
  467. static const yytype_int8 yyrhs[] =
  468. {
  469. 49, 0, -1, 50, 51, 52, 58, 59, -1, -1,
  470. 51, 53, 54, -1, 51, 55, -1, -1, 1, -1,
  471. 5, -1, 6, -1, 7, -1, 54, 8, -1, 8,
  472. -1, 1, -1, 11, 56, -1, 56, 57, -1, -1,
  473. 12, 27, 8, -1, 13, 27, 8, -1, 14, 27,
  474. 8, -1, 58, 62, 59, 60, 28, -1, 58, 62,
  475. 29, 58, 30, -1, -1, -1, 31, 65, -1, 65,
  476. -1, 10, -1, 1, -1, -1, 32, 61, 63, 33,
  477. -1, 32, 34, 33, -1, -1, 63, 35, 64, -1,
  478. 64, -1, 1, -1, 8, -1, 67, 66, -1, 67,
  479. 66, 36, -1, 66, 36, -1, 66, -1, 66, 37,
  480. 68, -1, 68, -1, 66, 38, -1, 68, 69, -1,
  481. 69, -1, 69, 34, -1, 69, 39, -1, 69, 40,
  482. -1, 69, 29, 4, 35, 4, 30, -1, 69, 29,
  483. 4, 35, 30, -1, 69, 29, 4, 30, -1, 41,
  484. -1, 70, -1, 9, -1, 42, 73, 42, -1, 43,
  485. 66, 44, -1, 3, -1, 45, 71, 46, -1, 45,
  486. 31, 71, 46, -1, 71, 3, 47, 3, -1, 71,
  487. 3, -1, 71, 72, -1, -1, 15, -1, 16, -1,
  488. 17, -1, 18, -1, 19, -1, 20, -1, 21, -1,
  489. 22, -1, 23, -1, 24, -1, 25, -1, 26, -1,
  490. 73, 3, -1, -1
  491. };
  492. /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
  493. static const yytype_uint16 yyrline[] =
  494. {
  495. 0, 112, 112, 142, 149, 150, 151, 152, 156, 164,
  496. 167, 171, 174, 177, 181, 184, 185, 188, 193, 195,
  497. 199, 201, 203, 207, 219, 255, 279, 302, 307, 310,
  498. 313, 331, 334, 336, 338, 342, 365, 420, 423, 466,
  499. 484, 490, 495, 522, 530, 534, 541, 547, 553, 581,
  500. 595, 614, 636, 654, 661, 664, 667, 678, 681, 688,
  501. 716, 727, 735, 742, 743, 744, 745, 746, 747, 748,
  502. 749, 750, 751, 752, 758, 761, 772
  503. };
  504. #endif
  505. #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
  506. /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
  507. First, the terminals, then, starting at YYNTOKENS, nonterminals. */
  508. static const char *const yytname[] =
  509. {
  510. "$end", "error", "$undefined", "CHAR", "NUMBER", "SECTEND", "SCDECL",
  511. "XSCDECL", "NAME", "PREVCCL", "EOF_OP", "OPTION_OP", "OPT_OUTFILE",
  512. "OPT_PREFIX", "OPT_YYCLASS", "CCE_ALNUM", "CCE_ALPHA", "CCE_BLANK",
  513. "CCE_CNTRL", "CCE_DIGIT", "CCE_GRAPH", "CCE_LOWER", "CCE_PRINT",
  514. "CCE_PUNCT", "CCE_SPACE", "CCE_UPPER", "CCE_XDIGIT", "'='", "'\\n'",
  515. "'{'", "'}'", "'^'", "'<'", "'>'", "'*'", "','", "'$'", "'|'", "'/'",
  516. "'+'", "'?'", "'.'", "'\"'", "'('", "')'", "'['", "']'", "'-'",
  517. "$accept", "goal", "initlex", "sect1", "sect1end", "startconddecl",
  518. "namelist1", "options", "optionlist", "option", "sect2", "initforrule",
  519. "flexrule", "scon_stk_ptr", "scon", "namelist2", "sconname", "rule",
  520. "re", "re2", "series", "singleton", "fullccl", "ccl", "ccl_expr",
  521. "string", 0
  522. };
  523. #endif
  524. # ifdef YYPRINT
  525. /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
  526. token YYLEX-NUM. */
  527. static const yytype_uint16 yytoknum[] =
  528. {
  529. 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
  530. 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
  531. 275, 276, 277, 278, 279, 280, 281, 61, 10, 123,
  532. 125, 94, 60, 62, 42, 44, 36, 124, 47, 43,
  533. 63, 46, 34, 40, 41, 91, 93, 45
  534. };
  535. # endif
  536. /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
  537. static const yytype_uint8 yyr1[] =
  538. {
  539. 0, 48, 49, 50, 51, 51, 51, 51, 52, 53,
  540. 53, 54, 54, 54, 55, 56, 56, 57, 57, 57,
  541. 58, 58, 58, 59, 60, 60, 60, 60, 61, 62,
  542. 62, 62, 63, 63, 63, 64, 65, 65, 65, 65,
  543. 66, 66, 67, 68, 68, 69, 69, 69, 69, 69,
  544. 69, 69, 69, 69, 69, 69, 69, 70, 70, 71,
  545. 71, 71, 71, 72, 72, 72, 72, 72, 72, 72,
  546. 72, 72, 72, 72, 72, 73, 73
  547. };
  548. /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
  549. static const yytype_uint8 yyr2[] =
  550. {
  551. 0, 2, 5, 0, 3, 2, 0, 1, 1, 1,
  552. 1, 2, 1, 1, 2, 2, 0, 3, 3, 3,
  553. 5, 5, 0, 0, 2, 1, 1, 1, 0, 4,
  554. 3, 0, 3, 1, 1, 1, 2, 3, 2, 1,
  555. 3, 1, 2, 2, 1, 2, 2, 2, 6, 5,
  556. 4, 1, 1, 1, 3, 3, 1, 3, 4, 4,
  557. 2, 2, 0, 1, 1, 1, 1, 1, 1, 1,
  558. 1, 1, 1, 1, 1, 2, 0
  559. };
  560. /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
  561. STATE-NUM when YYTABLE doesn't specify something else to do. Zero
  562. means the default is an error. */
  563. static const yytype_uint8 yydefact[] =
  564. {
  565. 3, 0, 0, 1, 7, 0, 8, 9, 10, 16,
  566. 22, 0, 5, 14, 31, 13, 12, 4, 0, 0,
  567. 0, 15, 28, 2, 23, 11, 0, 0, 0, 0,
  568. 0, 22, 0, 17, 18, 19, 30, 34, 35, 0,
  569. 33, 31, 27, 56, 53, 26, 0, 51, 76, 0,
  570. 62, 0, 25, 39, 0, 41, 44, 52, 29, 0,
  571. 21, 24, 0, 0, 62, 0, 20, 38, 0, 42,
  572. 36, 43, 0, 45, 46, 47, 32, 75, 54, 55,
  573. 0, 60, 63, 64, 65, 66, 67, 68, 69, 70,
  574. 71, 72, 73, 74, 57, 61, 40, 37, 0, 58,
  575. 0, 50, 0, 59, 0, 49, 48
  576. };
  577. /* YYDEFGOTO[NTERM-NUM]. */
  578. static const yytype_int8 yydefgoto[] =
  579. {
  580. -1, 1, 2, 5, 10, 11, 17, 12, 13, 21,
  581. 14, 23, 51, 30, 24, 39, 40, 52, 53, 54,
  582. 55, 56, 57, 65, 95, 62
  583. };
  584. /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
  585. STATE-NUM. */
  586. #define YYPACT_NINF -52
  587. static const yytype_int8 yypact[] =
  588. {
  589. -52, 1, 78, -52, -52, 81, -52, -52, -52, -52,
  590. -52, 6, -52, -2, 5, -52, -52, 20, -14, 9,
  591. 16, -52, 39, -52, 31, -52, 51, 74, 82, 61,
  592. 30, -52, -1, -52, -52, -52, -52, -52, -52, 58,
  593. -52, 44, -52, -52, -52, -52, 24, -52, -52, 24,
  594. 66, 70, -52, 25, 24, 24, 41, -52, -52, 91,
  595. -52, -52, 26, 27, -52, 0, -52, -52, 24, -52,
  596. 59, 41, 96, -52, -52, -52, -52, -52, -52, -52,
  597. 32, 54, -52, -52, -52, -52, -52, -52, -52, -52,
  598. -52, -52, -52, -52, -52, -52, 24, -52, 4, -52,
  599. 99, -52, 2, -52, 73, -52, -52
  600. };
  601. /* YYPGOTO[NTERM-NUM]. */
  602. static const yytype_int8 yypgoto[] =
  603. {
  604. -52, -52, -52, -52, -52, -52, -52, -52, -52, -52,
  605. 75, 80, -52, -52, -52, -52, 46, 62, 23, -52,
  606. 42, -51, -52, 43, -52, -52
  607. };
  608. /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
  609. positive, shift that token. If negative, reduce the rule which
  610. number is the opposite. If zero, do what YYDEFACT says.
  611. If YYTABLE_NINF, syntax error. */
  612. #define YYTABLE_NINF -24
  613. static const yytype_int8 yytable[] =
  614. {
  615. 42, 3, 43, 81, 71, -23, 104, 15, 44, 45,
  616. 18, 19, 20, 26, 16, 82, 83, 84, 85, 86,
  617. 87, 88, 89, 90, 91, 92, 93, 43, 25, 77,
  618. 46, 37, 105, 44, 101, 81, 27, 22, 38, 102,
  619. 47, 48, 49, 28, 50, 71, 94, 82, 83, 84,
  620. 85, 86, 87, 88, 89, 90, 91, 92, 93, 33,
  621. 31, 67, 68, 69, 68, 47, 48, 49, 78, 50,
  622. 72, 79, 63, 29, 60, 73, 22, 70, 99, 4,
  623. 74, 75, 34, -6, -6, -6, 6, 7, 8, -6,
  624. 35, 58, 9, 59, 36, 97, 68, 64, 66, 38,
  625. 98, 100, 103, 106, 32, 76, 41, 80, 61, 0,
  626. 96
  627. };
  628. static const yytype_int8 yycheck[] =
  629. {
  630. 1, 0, 3, 3, 55, 0, 4, 1, 9, 10,
  631. 12, 13, 14, 27, 8, 15, 16, 17, 18, 19,
  632. 20, 21, 22, 23, 24, 25, 26, 3, 8, 3,
  633. 31, 1, 30, 9, 30, 3, 27, 32, 8, 35,
  634. 41, 42, 43, 27, 45, 96, 46, 15, 16, 17,
  635. 18, 19, 20, 21, 22, 23, 24, 25, 26, 8,
  636. 29, 36, 37, 38, 37, 41, 42, 43, 42, 45,
  637. 29, 44, 49, 34, 30, 34, 32, 54, 46, 1,
  638. 39, 40, 8, 5, 6, 7, 5, 6, 7, 11,
  639. 8, 33, 11, 35, 33, 36, 37, 31, 28, 8,
  640. 4, 47, 3, 30, 24, 59, 31, 64, 46, -1,
  641. 68
  642. };
  643. /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
  644. symbol of state STATE-NUM. */
  645. static const yytype_uint8 yystos[] =
  646. {
  647. 0, 49, 50, 0, 1, 51, 5, 6, 7, 11,
  648. 52, 53, 55, 56, 58, 1, 8, 54, 12, 13,
  649. 14, 57, 32, 59, 62, 8, 27, 27, 27, 34,
  650. 61, 29, 59, 8, 8, 8, 33, 1, 8, 63,
  651. 64, 58, 1, 3, 9, 10, 31, 41, 42, 43,
  652. 45, 60, 65, 66, 67, 68, 69, 70, 33, 35,
  653. 30, 65, 73, 66, 31, 71, 28, 36, 37, 38,
  654. 66, 69, 29, 34, 39, 40, 64, 3, 42, 44,
  655. 71, 3, 15, 16, 17, 18, 19, 20, 21, 22,
  656. 23, 24, 25, 26, 46, 72, 68, 36, 4, 46,
  657. 47, 30, 35, 3, 4, 30, 30
  658. };
  659. #define yyerrok (yyerrstatus = 0)
  660. #define yyclearin (yychar = YYEMPTY)
  661. #define YYEMPTY (-2)
  662. #define YYEOF 0
  663. #define YYACCEPT goto yyacceptlab
  664. #define YYABORT goto yyabortlab
  665. #define YYERROR goto yyerrorlab
  666. /* Like YYERROR except do call yyerror. This remains here temporarily
  667. to ease the transition to the new meaning of YYERROR, for GCC.
  668. Once GCC version 2 has supplanted version 1, this can go. */
  669. #define YYFAIL goto yyerrlab
  670. #define YYRECOVERING() (!!yyerrstatus)
  671. #define YYBACKUP(Token, Value) \
  672. do \
  673. if (yychar == YYEMPTY && yylen == 1) \
  674. { \
  675. yychar = (Token); \
  676. yylval = (Value); \
  677. yytoken = YYTRANSLATE (yychar); \
  678. YYPOPSTACK (1); \
  679. goto yybackup; \
  680. } \
  681. else \
  682. { \
  683. yyerror (YY_("syntax error: cannot back up")); \
  684. YYERROR; \
  685. } \
  686. while (YYID (0))
  687. #define YYTERROR 1
  688. #define YYERRCODE 256
  689. /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
  690. If N is 0, then set CURRENT to the empty location which ends
  691. the previous symbol: RHS[0] (always defined). */
  692. #define YYRHSLOC(Rhs, K) ((Rhs)[K])
  693. #ifndef YYLLOC_DEFAULT
  694. # define YYLLOC_DEFAULT(Current, Rhs, N) \
  695. do \
  696. if (YYID (N)) \
  697. { \
  698. (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
  699. (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
  700. (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
  701. (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
  702. } \
  703. else \
  704. { \
  705. (Current).first_line = (Current).last_line = \
  706. YYRHSLOC (Rhs, 0).last_line; \
  707. (Current).first_column = (Current).last_column = \
  708. YYRHSLOC (Rhs, 0).last_column; \
  709. } \
  710. while (YYID (0))
  711. #endif
  712. /* YY_LOCATION_PRINT -- Print the location on the stream.
  713. This macro was not mandated originally: define only if we know
  714. we won't break user code: when these are the locations we know. */
  715. #ifndef YY_LOCATION_PRINT
  716. # if YYLTYPE_IS_TRIVIAL
  717. # define YY_LOCATION_PRINT(File, Loc) \
  718. fprintf (File, "%d.%d-%d.%d", \
  719. (Loc).first_line, (Loc).first_column, \
  720. (Loc).last_line, (Loc).last_column)
  721. # else
  722. # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
  723. # endif
  724. #endif
  725. /* YYLEX -- calling `yylex' with the right arguments. */
  726. #ifdef YYLEX_PARAM
  727. # define YYLEX yylex (YYLEX_PARAM)
  728. #else
  729. # define YYLEX yylex ()
  730. #endif
  731. /* Enable debugging if requested. */
  732. #if YYDEBUG
  733. # ifndef YYFPRINTF
  734. # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
  735. # define YYFPRINTF fprintf
  736. # endif
  737. # define YYDPRINTF(Args) \
  738. do { \
  739. if (yydebug) \
  740. YYFPRINTF Args; \
  741. } while (YYID (0))
  742. # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
  743. do { \
  744. if (yydebug) \
  745. { \
  746. YYFPRINTF (stderr, "%s ", Title); \
  747. yy_symbol_print (stderr, \
  748. Type, Value); \
  749. YYFPRINTF (stderr, "\n"); \
  750. } \
  751. } while (YYID (0))
  752. /*--------------------------------.
  753. | Print this symbol on YYOUTPUT. |
  754. `--------------------------------*/
  755. /*ARGSUSED*/
  756. #if (defined __STDC__ || defined __C99__FUNC__ \
  757. || defined __cplusplus || defined _MSC_VER)
  758. static void
  759. yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
  760. #else
  761. static void
  762. yy_symbol_value_print (yyoutput, yytype, yyvaluep)
  763. FILE *yyoutput;
  764. int yytype;
  765. YYSTYPE const * const yyvaluep;
  766. #endif
  767. {
  768. if (!yyvaluep)
  769. return;
  770. # ifdef YYPRINT
  771. if (yytype < YYNTOKENS)
  772. YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
  773. # else
  774. YYUSE (yyoutput);
  775. # endif
  776. switch (yytype)
  777. {
  778. default:
  779. break;
  780. }
  781. }
  782. /*--------------------------------.
  783. | Print this symbol on YYOUTPUT. |
  784. `--------------------------------*/
  785. #if (defined __STDC__ || defined __C99__FUNC__ \
  786. || defined __cplusplus || defined _MSC_VER)
  787. static void
  788. yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
  789. #else
  790. static void
  791. yy_symbol_print (yyoutput, yytype, yyvaluep)
  792. FILE *yyoutput;
  793. int yytype;
  794. YYSTYPE const * const yyvaluep;
  795. #endif
  796. {
  797. if (yytype < YYNTOKENS)
  798. YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
  799. else
  800. YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
  801. yy_symbol_value_print (yyoutput, yytype, yyvaluep);
  802. YYFPRINTF (yyoutput, ")");
  803. }
  804. /*------------------------------------------------------------------.
  805. | yy_stack_print -- Print the state stack from its BOTTOM up to its |
  806. | TOP (included). |
  807. `------------------------------------------------------------------*/
  808. #if (defined __STDC__ || defined __C99__FUNC__ \
  809. || defined __cplusplus || defined _MSC_VER)
  810. static void
  811. yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
  812. #else
  813. static void
  814. yy_stack_print (bottom, top)
  815. yytype_int16 *bottom;
  816. yytype_int16 *top;
  817. #endif
  818. {
  819. YYFPRINTF (stderr, "Stack now");
  820. for (; bottom <= top; ++bottom)
  821. YYFPRINTF (stderr, " %d", *bottom);
  822. YYFPRINTF (stderr, "\n");
  823. }
  824. # define YY_STACK_PRINT(Bottom, Top) \
  825. do { \
  826. if (yydebug) \
  827. yy_stack_print ((Bottom), (Top)); \
  828. } while (YYID (0))
  829. /*------------------------------------------------.
  830. | Report that the YYRULE is going to be reduced. |
  831. `------------------------------------------------*/
  832. #if (defined __STDC__ || defined __C99__FUNC__ \
  833. || defined __cplusplus || defined _MSC_VER)
  834. static void
  835. yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
  836. #else
  837. static void
  838. yy_reduce_print (yyvsp, yyrule)
  839. YYSTYPE *yyvsp;
  840. int yyrule;
  841. #endif
  842. {
  843. int yynrhs = yyr2[yyrule];
  844. int yyi;
  845. unsigned long int yylno = yyrline[yyrule];
  846. YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
  847. yyrule - 1, yylno);
  848. /* The symbols being reduced. */
  849. for (yyi = 0; yyi < yynrhs; yyi++)
  850. {
  851. fprintf (stderr, " $%d = ", yyi + 1);
  852. yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
  853. &(yyvsp[(yyi + 1) - (yynrhs)])
  854. );
  855. fprintf (stderr, "\n");
  856. }
  857. }
  858. # define YY_REDUCE_PRINT(Rule) \
  859. do { \
  860. if (yydebug) \
  861. yy_reduce_print (yyvsp, Rule); \
  862. } while (YYID (0))
  863. /* Nonzero means print parse trace. It is left uninitialized so that
  864. multiple parsers can coexist. */
  865. int yydebug;
  866. #else /* !YYDEBUG */
  867. # define YYDPRINTF(Args)
  868. # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
  869. # define YY_STACK_PRINT(Bottom, Top)
  870. # define YY_REDUCE_PRINT(Rule)
  871. #endif /* !YYDEBUG */
  872. /* YYINITDEPTH -- initial size of the parser's stacks. */
  873. #ifndef YYINITDEPTH
  874. # define YYINITDEPTH 200
  875. #endif
  876. /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
  877. if the built-in stack extension method is used).
  878. Do not make this value too large; the results are undefined if
  879. YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
  880. evaluated with infinite-precision integer arithmetic. */
  881. #ifndef YYMAXDEPTH
  882. # define YYMAXDEPTH 10000
  883. #endif
  884. #if YYERROR_VERBOSE
  885. # ifndef yystrlen
  886. # if defined __GLIBC__ && defined _STRING_H
  887. # define yystrlen strlen
  888. # else
  889. /* Return the length of YYSTR. */
  890. #if (defined __STDC__ || defined __C99__FUNC__ \
  891. || defined __cplusplus || defined _MSC_VER)
  892. static YYSIZE_T
  893. yystrlen (const char *yystr)
  894. #else
  895. static YYSIZE_T
  896. yystrlen (yystr)
  897. const char *yystr;
  898. #endif
  899. {
  900. YYSIZE_T yylen;
  901. for (yylen = 0; yystr[yylen]; yylen++)
  902. continue;
  903. return yylen;
  904. }
  905. # endif
  906. # endif
  907. # ifndef yystpcpy
  908. # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
  909. # define yystpcpy stpcpy
  910. # else
  911. /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
  912. YYDEST. */
  913. #if (defined __STDC__ || defined __C99__FUNC__ \
  914. || defined __cplusplus || defined _MSC_VER)
  915. static char *
  916. yystpcpy (char *yydest, const char *yysrc)
  917. #else
  918. static char *
  919. yystpcpy (yydest, yysrc)
  920. char *yydest;
  921. const char *yysrc;
  922. #endif
  923. {
  924. char *yyd = yydest;
  925. const char *yys = yysrc;
  926. while ((*yyd++ = *yys++) != '\0')
  927. continue;
  928. return yyd - 1;
  929. }
  930. # endif
  931. # endif
  932. # ifndef yytnamerr
  933. /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
  934. quotes and backslashes, so that it's suitable for yyerror. The
  935. heuristic is that double-quoting is unnecessary unless the string
  936. contains an apostrophe, a comma, or backslash (other than
  937. backslash-backslash). YYSTR is taken from yytname. If YYRES is
  938. null, do not copy; instead, return the length of what the result
  939. would have been. */
  940. static YYSIZE_T
  941. yytnamerr (char *yyres, const char *yystr)
  942. {
  943. if (*yystr == '"')
  944. {
  945. YYSIZE_T yyn = 0;
  946. char const *yyp = yystr;
  947. for (;;)
  948. switch (*++yyp)
  949. {
  950. case '\'':
  951. case ',':
  952. goto do_not_strip_quotes;
  953. case '\\':
  954. if (*++yyp != '\\')
  955. goto do_not_strip_quotes;
  956. /* Fall through. */
  957. default:
  958. if (yyres)
  959. yyres[yyn] = *yyp;
  960. yyn++;
  961. break;
  962. case '"':
  963. if (yyres)
  964. yyres[yyn] = '\0';
  965. return yyn;
  966. }
  967. do_not_strip_quotes: ;
  968. }
  969. if (! yyres)
  970. return yystrlen (yystr);
  971. return yystpcpy (yyres, yystr) - yyres;
  972. }
  973. # endif
  974. /* Copy into YYRESULT an error message about the unexpected token
  975. YYCHAR while in state YYSTATE. Return the number of bytes copied,
  976. including the terminating null byte. If YYRESULT is null, do not
  977. copy anything; just return the number of bytes that would be
  978. copied. As a special case, return 0 if an ordinary "syntax error"
  979. message will do. Return YYSIZE_MAXIMUM if overflow occurs during
  980. size calculation. */
  981. static YYSIZE_T
  982. yysyntax_error (char *yyresult, int yystate, int yychar)
  983. {
  984. int yyn = yypact[yystate];
  985. if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
  986. return 0;
  987. else
  988. {
  989. int yytype = YYTRANSLATE (yychar);
  990. YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
  991. YYSIZE_T yysize = yysize0;
  992. YYSIZE_T yysize1;
  993. int yysize_overflow = 0;
  994. enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
  995. char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
  996. int yyx;
  997. # if 0
  998. /* This is so xgettext sees the translatable formats that are
  999. constructed on the fly. */
  1000. YY_("syntax error, unexpected %s");
  1001. YY_("syntax error, unexpected %s, expecting %s");
  1002. YY_("syntax error, unexpected %s, expecting %s or %s");
  1003. YY_("syntax error, unexpected %s, expecting %s or %s or %s");
  1004. YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
  1005. # endif
  1006. char *yyfmt;
  1007. char const *yyf;
  1008. static char const yyunexpected[] = "syntax error, unexpected %s";
  1009. static char const yyexpecting[] = ", expecting %s";
  1010. static char const yyor[] = " or %s";
  1011. char yyformat[sizeof yyunexpected
  1012. + sizeof yyexpecting - 1
  1013. + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
  1014. * (sizeof yyor - 1))];
  1015. char const *yyprefix = yyexpecting;
  1016. /* Start YYX at -YYN if negative to avoid negative indexes in
  1017. YYCHECK. */
  1018. int yyxbegin = yyn < 0 ? -yyn : 0;
  1019. /* Stay within bounds of both yycheck and yytname. */
  1020. int yychecklim = YYLAST - yyn + 1;
  1021. int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
  1022. int yycount = 1;
  1023. yyarg[0] = yytname[yytype];
  1024. yyfmt = yystpcpy (yyformat, yyunexpected);
  1025. for (yyx = yyxbegin; yyx < yyxend; ++yyx)
  1026. if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
  1027. {
  1028. if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
  1029. {
  1030. yycount = 1;
  1031. yysize = yysize0;
  1032. yyformat[sizeof yyunexpected - 1] = '\0';
  1033. break;
  1034. }
  1035. yyarg[yycount++] = yytname[yyx];
  1036. yysize1 = yysize + yytnamerr (0, yytname[yyx]);
  1037. yysize_overflow |= (yysize1 < yysize);
  1038. yysize = yysize1;
  1039. yyfmt = yystpcpy (yyfmt, yyprefix);
  1040. yyprefix = yyor;
  1041. }
  1042. yyf = YY_(yyformat);
  1043. yysize1 = yysize + yystrlen (yyf);
  1044. yysize_overflow |= (yysize1 < yysize);
  1045. yysize = yysize1;
  1046. if (yysize_overflow)
  1047. return YYSIZE_MAXIMUM;
  1048. if (yyresult)
  1049. {
  1050. /* Avoid sprintf, as that infringes on the user's name space.
  1051. Don't have undefined behavior even if the translation
  1052. produced a string with the wrong number of "%s"s. */
  1053. char *yyp = yyresult;
  1054. int yyi = 0;
  1055. while ((*yyp = *yyf) != '\0')
  1056. {
  1057. if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
  1058. {
  1059. yyp += yytnamerr (yyp, yyarg[yyi++]);
  1060. yyf += 2;
  1061. }
  1062. else
  1063. {
  1064. yyp++;
  1065. yyf++;
  1066. }
  1067. }
  1068. }
  1069. return yysize;
  1070. }
  1071. }
  1072. #endif /* YYERROR_VERBOSE */
  1073. /*-----------------------------------------------.
  1074. | Release the memory associated to this symbol. |
  1075. `-----------------------------------------------*/
  1076. /*ARGSUSED*/
  1077. #if (defined __STDC__ || defined __C99__FUNC__ \
  1078. || defined __cplusplus || defined _MSC_VER)
  1079. static void
  1080. yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
  1081. #else
  1082. static void
  1083. yydestruct (yymsg, yytype, yyvaluep)
  1084. const char *yymsg;
  1085. int yytype;
  1086. YYSTYPE *yyvaluep;
  1087. #endif
  1088. {
  1089. YYUSE (yyvaluep);
  1090. if (!yymsg)
  1091. yymsg = "Deleting";
  1092. YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
  1093. switch (yytype)
  1094. {
  1095. default:
  1096. break;
  1097. }
  1098. }
  1099. /* Prevent warnings from -Wmissing-prototypes. */
  1100. #ifdef YYPARSE_PARAM
  1101. #if defined __STDC__ || defined __cplusplus
  1102. int yyparse (void *YYPARSE_PARAM);
  1103. #else
  1104. int yyparse ();
  1105. #endif
  1106. #else /* ! YYPARSE_PARAM */
  1107. #if defined __STDC__ || defined __cplusplus
  1108. int yyparse (void);
  1109. #else
  1110. int yyparse ();
  1111. #endif
  1112. #endif /* ! YYPARSE_PARAM */
  1113. /* The look-ahead symbol. */
  1114. int yychar;
  1115. /* The semantic value of the look-ahead symbol. */
  1116. YYSTYPE yylval;
  1117. /* Number of syntax errors so far. */
  1118. int yynerrs;
  1119. /*----------.
  1120. | yyparse. |
  1121. `----------*/
  1122. #ifdef YYPARSE_PARAM
  1123. #if (defined __STDC__ || defined __C99__FUNC__ \
  1124. || defined __cplusplus || defined _MSC_VER)
  1125. int
  1126. yyparse (void *YYPARSE_PARAM)
  1127. #else
  1128. int
  1129. yyparse (YYPARSE_PARAM)
  1130. void *YYPARSE_PARAM;
  1131. #endif
  1132. #else /* ! YYPARSE_PARAM */
  1133. #if (defined __STDC__ || defined __C99__FUNC__ \
  1134. || defined __cplusplus || defined _MSC_VER)
  1135. int
  1136. yyparse (void)
  1137. #else
  1138. int
  1139. yyparse ()
  1140. #endif
  1141. #endif
  1142. {
  1143. int yystate;
  1144. int yyn;
  1145. int yyresult;
  1146. /* Number of tokens to shift before error messages enabled. */
  1147. int yyerrstatus;
  1148. /* Look-ahead token as an internal (translated) token number. */
  1149. int yytoken = 0;
  1150. #if YYERROR_VERBOSE
  1151. /* Buffer for error messages, and its allocated size. */
  1152. char yymsgbuf[128];
  1153. char *yymsg = yymsgbuf;
  1154. YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
  1155. #endif
  1156. /* Three stacks and their tools:
  1157. `yyss': related to states,
  1158. `yyvs': related to semantic values,
  1159. `yyls': related to locations.
  1160. Refer to the stacks thru separate pointers, to allow yyoverflow
  1161. to reallocate them elsewhere. */
  1162. /* The state stack. */
  1163. yytype_int16 yyssa[YYINITDEPTH];
  1164. yytype_int16 *yyss = yyssa;
  1165. yytype_int16 *yyssp;
  1166. /* The semantic value stack. */
  1167. YYSTYPE yyvsa[YYINITDEPTH];
  1168. YYSTYPE *yyvs = yyvsa;
  1169. YYSTYPE *yyvsp;
  1170. #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
  1171. YYSIZE_T yystacksize = YYINITDEPTH;
  1172. /* The variables used to return semantic value and location from the
  1173. action routines. */
  1174. YYSTYPE yyval;
  1175. /* The number of symbols on the RHS of the reduced rule.
  1176. Keep to zero when no symbol should be popped. */
  1177. int yylen = 0;
  1178. YYDPRINTF ((stderr, "Starting parse\n"));
  1179. yystate = 0;
  1180. yyerrstatus = 0;
  1181. yynerrs = 0;
  1182. yychar = YYEMPTY; /* Cause a token to be read. */
  1183. /* Initialize stack pointers.
  1184. Waste one element of value and location stack
  1185. so that they stay on the same level as the state stack.
  1186. The wasted elements are never initialized. */
  1187. yyssp = yyss;
  1188. yyvsp = yyvs;
  1189. goto yysetstate;
  1190. /*------------------------------------------------------------.
  1191. | yynewstate -- Push a new state, which is found in yystate. |
  1192. `------------------------------------------------------------*/
  1193. yynewstate:
  1194. /* In all cases, when you get here, the value and location stacks
  1195. have just been pushed. So pushing a state here evens the stacks. */
  1196. yyssp++;
  1197. yysetstate:
  1198. *yyssp = yystate;
  1199. if (yyss + yystacksize - 1 <= yyssp)
  1200. {
  1201. /* Get the current used size of the three stacks, in elements. */
  1202. YYSIZE_T yysize = yyssp - yyss + 1;
  1203. #ifdef yyoverflow
  1204. {
  1205. /* Give user a chance to reallocate the stack. Use copies of
  1206. these so that the &'s don't force the real ones into
  1207. memory. */
  1208. YYSTYPE *yyvs1 = yyvs;
  1209. yytype_int16 *yyss1 = yyss;
  1210. /* Each stack pointer address is followed by the size of the
  1211. data in use in that stack, in bytes. This used to be a
  1212. conditional around just the two extra args, but that might
  1213. be undefined if yyoverflow is a macro. */
  1214. yyoverflow (YY_("memory exhausted"),
  1215. &yyss1, yysize * sizeof (*yyssp),
  1216. &yyvs1, yysize * sizeof (*yyvsp),
  1217. &yystacksize);
  1218. yyss = yyss1;
  1219. yyvs = yyvs1;
  1220. }
  1221. #else /* no yyoverflow */
  1222. # ifndef YYSTACK_RELOCATE
  1223. goto yyexhaustedlab;
  1224. # else
  1225. /* Extend the stack our own way. */
  1226. if (YYMAXDEPTH <= yystacksize)
  1227. goto yyexhaustedlab;
  1228. yystacksize *= 2;
  1229. if (YYMAXDEPTH < yystacksize)
  1230. yystacksize = YYMAXDEPTH;
  1231. {
  1232. yytype_int16 *yyss1 = yyss;
  1233. union yyalloc *yyptr =
  1234. (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
  1235. if (! yyptr)
  1236. goto yyexhaustedlab;
  1237. YYSTACK_RELOCATE (yyss);
  1238. YYSTACK_RELOCATE (yyvs);
  1239. # undef YYSTACK_RELOCATE
  1240. if (yyss1 != yyssa)
  1241. YYSTACK_FREE (yyss1);
  1242. }
  1243. # endif
  1244. #endif /* no yyoverflow */
  1245. yyssp = yyss + yysize - 1;
  1246. yyvsp = yyvs + yysize - 1;
  1247. YYDPRINTF ((stderr, "Stack size increased to %lu\n",
  1248. (unsigned long int) yystacksize));
  1249. if (yyss + yystacksize - 1 <= yyssp)
  1250. YYABORT;
  1251. }
  1252. YYDPRINTF ((stderr, "Entering state %d\n", yystate));
  1253. goto yybackup;
  1254. /*-----------.
  1255. | yybackup. |
  1256. `-----------*/
  1257. yybackup:
  1258. /* Do appropriate processing given the current state. Read a
  1259. look-ahead token if we need one and don't already have one. */
  1260. /* First try to decide what to do without reference to look-ahead token. */
  1261. yyn = yypact[yystate];
  1262. if (yyn == YYPACT_NINF)
  1263. goto yydefault;
  1264. /* Not known => get a look-ahead token if don't already have one. */
  1265. /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
  1266. if (yychar == YYEMPTY)
  1267. {
  1268. YYDPRINTF ((stderr, "Reading a token: "));
  1269. yychar = YYLEX;
  1270. }
  1271. if (yychar <= YYEOF)
  1272. {
  1273. yychar = yytoken = YYEOF;
  1274. YYDPRINTF ((stderr, "Now at end of input.\n"));
  1275. }
  1276. else
  1277. {
  1278. yytoken = YYTRANSLATE (yychar);
  1279. YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
  1280. }
  1281. /* If the proper action on seeing token YYTOKEN is to reduce or to
  1282. detect an error, take that action. */
  1283. yyn += yytoken;
  1284. if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
  1285. goto yydefault;
  1286. yyn = yytable[yyn];
  1287. if (yyn <= 0)
  1288. {
  1289. if (yyn == 0 || yyn == YYTABLE_NINF)
  1290. goto yyerrlab;
  1291. yyn = -yyn;
  1292. goto yyreduce;
  1293. }
  1294. if (yyn == YYFINAL)
  1295. YYACCEPT;
  1296. /* Count tokens shifted since error; after three, turn off error
  1297. status. */
  1298. if (yyerrstatus)
  1299. yyerrstatus--;
  1300. /* Shift the look-ahead token. */
  1301. YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
  1302. /* Discard the shifted token unless it is eof. */
  1303. if (yychar != YYEOF)
  1304. yychar = YYEMPTY;
  1305. yystate = yyn;
  1306. *++yyvsp = yylval;
  1307. goto yynewstate;
  1308. /*-----------------------------------------------------------.
  1309. | yydefault -- do the default action for the current state. |
  1310. `-----------------------------------------------------------*/
  1311. yydefault:
  1312. yyn = yydefact[yystate];
  1313. if (yyn == 0)
  1314. goto yyerrlab;
  1315. goto yyreduce;
  1316. /*-----------------------------.
  1317. | yyreduce -- Do a reduction. |
  1318. `-----------------------------*/
  1319. yyreduce:
  1320. /* yyn is the number of a rule to reduce with. */
  1321. yylen = yyr2[yyn];
  1322. /* If YYLEN is nonzero, implement the default value of the action:
  1323. `$$ = $1'.
  1324. Otherwise, the following line sets YYVAL to garbage.
  1325. This behavior is undocumented and Bison
  1326. users should not rely upon it. Assigning to YYVAL
  1327. unconditionally makes the parser a bit smaller, and it avoids a
  1328. GCC warning that YYVAL may be used uninitialized. */
  1329. yyval = yyvsp[1-yylen];
  1330. YY_REDUCE_PRINT (yyn);
  1331. switch (yyn)
  1332. {
  1333. case 2:
  1334. #line 113 "./parse.y"
  1335. { /* add default rule */
  1336. int def_rule;
  1337. pat = cclinit();
  1338. cclnegate( pat );
  1339. def_rule = mkstate( -pat );
  1340. /* Remember the number of the default rule so we
  1341. * don't generate "can't match" warnings for it.
  1342. */
  1343. default_rule = num_rules;
  1344. finish_rule( def_rule, false, 0, 0 );
  1345. for ( i = 1; i <= lastsc; ++i )
  1346. scset[i] = mkbranch( scset[i], def_rule );
  1347. if ( spprdflt )
  1348. add_action(
  1349. "YY_FATAL_ERROR( \"flex scanner jammed\" )" );
  1350. else
  1351. add_action( "ECHO" );
  1352. add_action( ";\n\tYY_BREAK\n" );
  1353. }
  1354. break;
  1355. case 3:
  1356. #line 142 "./parse.y"
  1357. { /* initialize for processing rules */
  1358. /* Create default DFA start condition. */
  1359. scinstal( "INITIAL", false );
  1360. }
  1361. break;
  1362. case 7:
  1363. #line 153 "./parse.y"
  1364. { synerr( "unknown error processing section 1" ); }
  1365. break;
  1366. case 8:
  1367. #line 157 "./parse.y"
  1368. {
  1369. check_options();
  1370. scon_stk = allocate_integer_array( lastsc + 1 );
  1371. scon_stk_ptr = 0;
  1372. }
  1373. break;
  1374. case 9:
  1375. #line 165 "./parse.y"
  1376. { xcluflg = false; }
  1377. break;
  1378. case 10:
  1379. #line 168 "./parse.y"
  1380. { xcluflg = true; }
  1381. break;
  1382. case 11:
  1383. #line 172 "./parse.y"
  1384. { scinstal( nmstr, xcluflg ); }
  1385. break;
  1386. case 12:
  1387. #line 175 "./parse.y"
  1388. { scinstal( nmstr, xcluflg ); }
  1389. break;
  1390. case 13:
  1391. #line 178 "./parse.y"
  1392. { synerr( "bad start condition list" ); }
  1393. break;
  1394. case 17:
  1395. #line 189 "./parse.y"
  1396. {
  1397. outfilename = copy_string( nmstr );
  1398. did_outfilename = 1;
  1399. }
  1400. break;
  1401. case 18:
  1402. #line 194 "./parse.y"
  1403. { prefix = copy_string( nmstr ); }
  1404. break;
  1405. case 19:
  1406. #line 196 "./parse.y"
  1407. { yyclass = copy_string( nmstr ); }
  1408. break;
  1409. case 20:
  1410. #line 200 "./parse.y"
  1411. { scon_stk_ptr = (yyvsp[(2) - (5)]); }
  1412. break;
  1413. case 21:
  1414. #line 202 "./parse.y"
  1415. { scon_stk_ptr = (yyvsp[(2) - (5)]); }
  1416. break;
  1417. case 23:
  1418. #line 207 "./parse.y"
  1419. {
  1420. /* Initialize for a parse of one rule. */
  1421. trlcontxt = variable_trail_rule = varlength = false;
  1422. trailcnt = headcnt = rulelen = 0;
  1423. current_state_type = STATE_NORMAL;
  1424. previous_continued_action = continued_action;
  1425. in_rule = true;
  1426. new_rule();
  1427. }
  1428. break;
  1429. case 24:
  1430. #line 220 "./parse.y"
  1431. {
  1432. pat = (yyvsp[(2) - (2)]);
  1433. finish_rule( pat, variable_trail_rule,
  1434. headcnt, trailcnt );
  1435. if ( scon_stk_ptr > 0 )
  1436. {
  1437. for ( i = 1; i <= scon_stk_ptr; ++i )
  1438. scbol[scon_stk[i]] =
  1439. mkbranch( scbol[scon_stk[i]],
  1440. pat );
  1441. }
  1442. else
  1443. {
  1444. /* Add to all non-exclusive start conditions,
  1445. * including the default (0) start condition.
  1446. */
  1447. for ( i = 1; i <= lastsc; ++i )
  1448. if ( ! scxclu[i] )
  1449. scbol[i] = mkbranch( scbol[i],
  1450. pat );
  1451. }
  1452. if ( ! bol_needed )
  1453. {
  1454. bol_needed = true;
  1455. if ( performance_report > 1 )
  1456. pinpoint_message(
  1457. "'^' operator results in sub-optimal performance" );
  1458. }
  1459. }
  1460. break;
  1461. case 25:
  1462. #line 256 "./parse.y"
  1463. {
  1464. pat = (yyvsp[(1) - (1)]);
  1465. finish_rule( pat, variable_trail_rule,
  1466. headcnt, trailcnt );
  1467. if ( scon_stk_ptr > 0 )
  1468. {
  1469. for ( i = 1; i <= scon_stk_ptr; ++i )
  1470. scset[scon_stk[i]] =
  1471. mkbranch( scset[scon_stk[i]],
  1472. pat );
  1473. }
  1474. else
  1475. {
  1476. for ( i = 1; i <= lastsc; ++i )
  1477. if ( ! scxclu[i] )
  1478. scset[i] =
  1479. mkbranch( scset[i],
  1480. pat );
  1481. }
  1482. }
  1483. break;
  1484. case 26:
  1485. #line 280 "./parse.y"
  1486. {
  1487. if ( scon_stk_ptr > 0 )
  1488. build_eof_action();
  1489. else
  1490. {
  1491. /* This EOF applies to all start conditions
  1492. * which don't already have EOF actions.
  1493. */
  1494. for ( i = 1; i <= lastsc; ++i )
  1495. if ( ! sceof[i] )
  1496. scon_stk[++scon_stk_ptr] = i;
  1497. if ( scon_stk_ptr == 0 )
  1498. warn(
  1499. "all start conditions already have <<EOF>> rules" );
  1500. else
  1501. build_eof_action();
  1502. }
  1503. }
  1504. break;
  1505. case 27:
  1506. #line 303 "./parse.y"
  1507. { synerr( "unrecognized rule" ); }
  1508. break;
  1509. case 28:
  1510. #line 307 "./parse.y"
  1511. { (yyval) = scon_stk_ptr; }
  1512. break;
  1513. case 29:
  1514. #line 311 "./parse.y"
  1515. { (yyval) = (yyvsp[(2) - (4)]); }
  1516. break;
  1517. case 30:
  1518. #line 314 "./parse.y"
  1519. {
  1520. (yyval) = scon_stk_ptr;
  1521. for ( i = 1; i <= lastsc; ++i )
  1522. {
  1523. int j;
  1524. for ( j = 1; j <= scon_stk_ptr; ++j )
  1525. if ( scon_stk[j] == i )
  1526. break;
  1527. if ( j > scon_stk_ptr )
  1528. scon_stk[++scon_stk_ptr] = i;
  1529. }
  1530. }
  1531. break;
  1532. case 31:
  1533. #line 331 "./parse.y"
  1534. { (yyval) = scon_stk_ptr; }
  1535. break;
  1536. case 34:
  1537. #line 339 "./parse.y"
  1538. { synerr( "bad start condition list" ); }
  1539. break;
  1540. case 35:
  1541. #line 343 "./parse.y"
  1542. {
  1543. if ( (scnum = sclookup( nmstr )) == 0 )
  1544. format_pinpoint_message(
  1545. "undeclared start condition %s",
  1546. nmstr );
  1547. else
  1548. {
  1549. for ( i = 1; i <= scon_stk_ptr; ++i )
  1550. if ( scon_stk[i] == scnum )
  1551. {
  1552. format_warn(
  1553. "<%s> specified twice",
  1554. scname[scnum] );
  1555. break;
  1556. }
  1557. if ( i > scon_stk_ptr )
  1558. scon_stk[++scon_stk_ptr] = scnum;
  1559. }
  1560. }
  1561. break;
  1562. case 36:
  1563. #line 366 "./parse.y"
  1564. {
  1565. if ( transchar[lastst[(yyvsp[(2) - (2)])]] != SYM_EPSILON )
  1566. /* Provide final transition \now/ so it
  1567. * will be marked as a trailing context
  1568. * state.
  1569. */
  1570. (yyvsp[(2) - (2)]) = link_machines( (yyvsp[(2) - (2)]),
  1571. mkstate( SYM_EPSILON ) );
  1572. mark_beginning_as_normal( (yyvsp[(2) - (2)]) );
  1573. current_state_type = STATE_NORMAL;
  1574. if ( previous_continued_action )
  1575. {
  1576. /* We need to treat this as variable trailing
  1577. * context so that the backup does not happen
  1578. * in the action but before the action switch
  1579. * statement. If the backup happens in the
  1580. * action, then the rules "falling into" this
  1581. * one's action will *also* do the backup,
  1582. * erroneously.
  1583. */
  1584. if ( ! varlength || headcnt != 0 )
  1585. warn(
  1586. "trailing context made variable due to preceding '|' action" );
  1587. /* Mark as variable. */
  1588. varlength = true;
  1589. headcnt = 0;
  1590. }
  1591. if ( lex_compat || (varlength && headcnt == 0) )
  1592. { /* variable trailing context rule */
  1593. /* Mark the first part of the rule as the
  1594. * accepting "head" part of a trailing
  1595. * context rule.
  1596. *
  1597. * By the way, we didn't do this at the
  1598. * beginning of this production because back
  1599. * then current_state_type was set up for a
  1600. * trail rule, and add_accept() can create
  1601. * a new state ...
  1602. */
  1603. add_accept( (yyvsp[(1) - (2)]),
  1604. num_rules | YY_TRAILING_HEAD_MASK );
  1605. variable_trail_rule = true;
  1606. }
  1607. else
  1608. trailcnt = rulelen;
  1609. (yyval) = link_machines( (yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]) );
  1610. }
  1611. break;
  1612. case 37:
  1613. #line 421 "./parse.y"
  1614. { synerr( "trailing context used twice" ); }
  1615. break;
  1616. case 38:
  1617. #line 424 "./parse.y"
  1618. {
  1619. headcnt = 0;
  1620. trailcnt = 1;
  1621. rulelen = 1;
  1622. varlength = false;
  1623. current_state_type = STATE_TRAILING_CONTEXT;
  1624. if ( trlcontxt )
  1625. {
  1626. synerr( "trailing context used twice" );
  1627. (yyval) = mkstate( SYM_EPSILON );
  1628. }
  1629. else if ( previous_continued_action )
  1630. {
  1631. /* See the comment in the rule for "re2 re"
  1632. * above.
  1633. */
  1634. warn(
  1635. "trailing context made variable due to preceding '|' action" );
  1636. varlength = true;
  1637. }
  1638. if ( lex_compat || varlength )
  1639. {
  1640. /* Again, see the comment in the rule for
  1641. * "re2 re" above.
  1642. */
  1643. add_accept( (yyvsp[(1) - (2)]),
  1644. num_rules | YY_TRAILING_HEAD_MASK );
  1645. variable_trail_rule = true;
  1646. }
  1647. trlcontxt = true;
  1648. eps = mkstate( SYM_EPSILON );
  1649. (yyval) = link_machines( (yyvsp[(1) - (2)]),
  1650. link_machines( eps, mkstate( '\n' ) ) );
  1651. }
  1652. break;
  1653. case 39:
  1654. #line 467 "./parse.y"
  1655. {
  1656. (yyval) = (yyvsp[(1) - (1)]);
  1657. if ( trlcontxt )
  1658. {
  1659. if ( lex_compat || (varlength && headcnt == 0) )
  1660. /* Both head and trail are
  1661. * variable-length.
  1662. */
  1663. variable_trail_rule = true;
  1664. else
  1665. trailcnt = rulelen;
  1666. }
  1667. }
  1668. break;
  1669. case 40:
  1670. #line 485 "./parse.y"
  1671. {
  1672. varlength = true;
  1673. (yyval) = mkor( (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]) );
  1674. }
  1675. break;
  1676. case 41:
  1677. #line 491 "./parse.y"
  1678. { (yyval) = (yyvsp[(1) - (1)]); }
  1679. break;
  1680. case 42:
  1681. #line 496 "./parse.y"
  1682. {
  1683. /* This rule is written separately so the
  1684. * reduction will occur before the trailing
  1685. * series is parsed.
  1686. */
  1687. if ( trlcontxt )
  1688. synerr( "trailing context used twice" );
  1689. else
  1690. trlcontxt = true;
  1691. if ( varlength )
  1692. /* We hope the trailing context is
  1693. * fixed-length.
  1694. */
  1695. varlength = false;
  1696. else
  1697. headcnt = rulelen;
  1698. rulelen = 0;
  1699. current_state_type = STATE_TRAILING_CONTEXT;
  1700. (yyval) = (yyvsp[(1) - (2)]);
  1701. }
  1702. break;
  1703. case 43:
  1704. #line 523 "./parse.y"
  1705. {
  1706. /* This is where concatenation of adjacent patterns
  1707. * gets done.
  1708. */
  1709. (yyval) = link_machines( (yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]) );
  1710. }
  1711. break;
  1712. case 44:
  1713. #line 531 "./parse.y"
  1714. { (yyval) = (yyvsp[(1) - (1)]); }
  1715. break;
  1716. case 45:
  1717. #line 535 "./parse.y"
  1718. {
  1719. varlength = true;
  1720. (yyval) = mkclos( (yyvsp[(1) - (2)]) );
  1721. }
  1722. break;
  1723. case 46:
  1724. #line 542 "./parse.y"
  1725. {
  1726. varlength = true;
  1727. (yyval) = mkposcl( (yyvsp[(1) - (2)]) );
  1728. }
  1729. break;
  1730. case 47:
  1731. #line 548 "./parse.y"
  1732. {
  1733. varlength = true;
  1734. (yyval) = mkopt( (yyvsp[(1) - (2)]) );
  1735. }
  1736. break;
  1737. case 48:
  1738. #line 554 "./parse.y"
  1739. {
  1740. varlength = true;
  1741. if ( (yyvsp[(3) - (6)]) > (yyvsp[(5) - (6)]) || (yyvsp[(3) - (6)]) < 0 )
  1742. {
  1743. synerr( "bad iteration values" );
  1744. (yyval) = (yyvsp[(1) - (6)]);
  1745. }
  1746. else
  1747. {
  1748. if ( (yyvsp[(3) - (6)]) == 0 )
  1749. {
  1750. if ( (yyvsp[(5) - (6)]) <= 0 )
  1751. {
  1752. synerr(
  1753. "bad iteration values" );
  1754. (yyval) = (yyvsp[(1) - (6)]);
  1755. }
  1756. else
  1757. (yyval) = mkopt(
  1758. mkrep( (yyvsp[(1) - (6)]), 1, (yyvsp[(5) - (6)]) ) );
  1759. }
  1760. else
  1761. (yyval) = mkrep( (yyvsp[(1) - (6)]), (yyvsp[(3) - (6)]), (yyvsp[(5) - (6)]) );
  1762. }
  1763. }
  1764. break;
  1765. case 49:
  1766. #line 582 "./parse.y"
  1767. {
  1768. varlength = true;
  1769. if ( (yyvsp[(3) - (5)]) <= 0 )
  1770. {
  1771. synerr( "iteration value must be positive" );
  1772. (yyval) = (yyvsp[(1) - (5)]);
  1773. }
  1774. else
  1775. (yyval) = mkrep( (yyvsp[(1) - (5)]), (yyvsp[(3) - (5)]), INFINITY );
  1776. }
  1777. break;
  1778. case 50:
  1779. #line 596 "./parse.y"
  1780. {
  1781. /* The singleton could be something like "(foo)",
  1782. * in which case we have no idea what its length
  1783. * is, so we punt here.
  1784. */
  1785. varlength = true;
  1786. if ( (yyvsp[(3) - (4)]) <= 0 )
  1787. {
  1788. synerr( "iteration value must be positive" );
  1789. (yyval) = (yyvsp[(1) - (4)]);
  1790. }
  1791. else
  1792. (yyval) = link_machines( (yyvsp[(1) - (4)]),
  1793. copysingl( (yyvsp[(1) - (4)]), (yyvsp[(3) - (4)]) - 1 ) );
  1794. }
  1795. break;
  1796. case 51:
  1797. #line 615 "./parse.y"
  1798. {
  1799. if ( ! madeany )
  1800. {
  1801. /* Create the '.' character class. */
  1802. anyccl = cclinit();
  1803. ccladd( anyccl, '\n' );
  1804. cclnegate( anyccl );
  1805. if ( useecs )
  1806. mkeccl( ccltbl + cclmap[anyccl],
  1807. ccllen[anyccl], nextecm,
  1808. ecgroup, csize, csize );
  1809. madeany = true;
  1810. }
  1811. ++rulelen;
  1812. (yyval) = mkstate( -anyccl );
  1813. }
  1814. break;
  1815. case 52:
  1816. #line 637 "./parse.y"
  1817. {
  1818. if ( ! cclsorted )
  1819. /* Sort characters for fast searching. We
  1820. * use a shell sort since this list could
  1821. * be large.
  1822. */
  1823. cshell( ccltbl + cclmap[(yyvsp[(1) - (1)])], ccllen[(yyvsp[(1) - (1)])], true );
  1824. if ( useecs )
  1825. mkeccl( ccltbl + cclmap[(yyvsp[(1) - (1)])], ccllen[(yyvsp[(1) - (1)])],
  1826. nextecm, ecgroup, csize, csize );
  1827. ++rulelen;
  1828. (yyval) = mkstate( -(yyvsp[(1) - (1)]) );
  1829. }
  1830. break;
  1831. case 53:
  1832. #line 655 "./parse.y"
  1833. {
  1834. ++rulelen;
  1835. (yyval) = mkstate( -(yyvsp[(1) - (1)]) );
  1836. }
  1837. break;
  1838. case 54:
  1839. #line 662 "./parse.y"
  1840. { (yyval) = (yyvsp[(2) - (3)]); }
  1841. break;
  1842. case 55:
  1843. #line 665 "./parse.y"
  1844. { (yyval) = (yyvsp[(2) - (3)]); }
  1845. break;
  1846. case 56:
  1847. #line 668 "./parse.y"
  1848. {
  1849. ++rulelen;
  1850. if ( caseins && (yyvsp[(1) - (1)]) >= 'A' && (yyvsp[(1) - (1)]) <= 'Z' )
  1851. (yyvsp[(1) - (1)]) = clower( (yyvsp[(1) - (1)]) );
  1852. (yyval) = mkstate( (yyvsp[(1) - (1)]) );
  1853. }
  1854. break;
  1855. case 57:
  1856. #line 679 "./parse.y"
  1857. { (yyval) = (yyvsp[(2) - (3)]); }
  1858. break;
  1859. case 58:
  1860. #line 682 "./parse.y"
  1861. {
  1862. cclnegate( (yyvsp[(3) - (4)]) );
  1863. (yyval) = (yyvsp[(3) - (4)]);
  1864. }
  1865. break;
  1866. case 59:
  1867. #line 689 "./parse.y"
  1868. {
  1869. if ( caseins )
  1870. {
  1871. if ( (yyvsp[(2) - (4)]) >= 'A' && (yyvsp[(2) - (4)]) <= 'Z' )
  1872. (yyvsp[(2) - (4)]) = clower( (yyvsp[(2) - (4)]) );
  1873. if ( (yyvsp[(4) - (4)]) >= 'A' && (yyvsp[(4) - (4)]) <= 'Z' )
  1874. (yyvsp[(4) - (4)]) = clower( (yyvsp[(4) - (4)]) );
  1875. }
  1876. if ( (yyvsp[(2) - (4)]) > (yyvsp[(4) - (4)]) )
  1877. synerr( "negative range in character class" );
  1878. else
  1879. {
  1880. for ( i = (yyvsp[(2) - (4)]); i <= (yyvsp[(4) - (4)]); ++i )
  1881. ccladd( (yyvsp[(1) - (4)]), i );
  1882. /* Keep track if this ccl is staying in
  1883. * alphabetical order.
  1884. */
  1885. cclsorted = cclsorted && ((yyvsp[(2) - (4)]) > lastchar);
  1886. lastchar = (yyvsp[(4) - (4)]);
  1887. }
  1888. (yyval) = (yyvsp[(1) - (4)]);
  1889. }
  1890. break;
  1891. case 60:
  1892. #line 717 "./parse.y"
  1893. {
  1894. if ( caseins && (yyvsp[(2) - (2)]) >= 'A' && (yyvsp[(2) - (2)]) <= 'Z' )
  1895. (yyvsp[(2) - (2)]) = clower( (yyvsp[(2) - (2)]) );
  1896. ccladd( (yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]) );
  1897. cclsorted = cclsorted && ((yyvsp[(2) - (2)]) > lastchar);
  1898. lastchar = (yyvsp[(2) - (2)]);
  1899. (yyval) = (yyvsp[(1) - (2)]);
  1900. }
  1901. break;
  1902. case 61:
  1903. #line 728 "./parse.y"
  1904. {
  1905. /* Too hard to properly maintain cclsorted. */
  1906. cclsorted = false;
  1907. (yyval) = (yyvsp[(1) - (2)]);
  1908. }
  1909. break;
  1910. case 62:
  1911. #line 735 "./parse.y"
  1912. {
  1913. cclsorted = true;
  1914. lastchar = 0;
  1915. currccl = (yyval) = cclinit();
  1916. }
  1917. break;
  1918. case 63:
  1919. #line 742 "./parse.y"
  1920. { CCL_EXPR(isalnum) }
  1921. break;
  1922. case 64:
  1923. #line 743 "./parse.y"
  1924. { CCL_EXPR(isalpha) }
  1925. break;
  1926. case 65:
  1927. #line 744 "./parse.y"
  1928. { CCL_EXPR(IS_BLANK) }
  1929. break;
  1930. case 66:
  1931. #line 745 "./parse.y"
  1932. { CCL_EXPR(iscntrl) }
  1933. break;
  1934. case 67:
  1935. #line 746 "./parse.y"
  1936. { CCL_EXPR(isdigit) }
  1937. break;
  1938. case 68:
  1939. #line 747 "./parse.y"
  1940. { CCL_EXPR(isgraph) }
  1941. break;
  1942. case 69:
  1943. #line 748 "./parse.y"
  1944. { CCL_EXPR(islower) }
  1945. break;
  1946. case 70:
  1947. #line 749 "./parse.y"
  1948. { CCL_EXPR(isprint) }
  1949. break;
  1950. case 71:
  1951. #line 750 "./parse.y"
  1952. { CCL_EXPR(ispunct) }
  1953. break;
  1954. case 72:
  1955. #line 751 "./parse.y"
  1956. { CCL_EXPR(isspace) }
  1957. break;
  1958. case 73:
  1959. #line 752 "./parse.y"
  1960. {
  1961. if ( caseins )
  1962. CCL_EXPR(islower)
  1963. else
  1964. CCL_EXPR(isupper)
  1965. }
  1966. break;
  1967. case 74:
  1968. #line 758 "./parse.y"
  1969. { CCL_EXPR(isxdigit) }
  1970. break;
  1971. case 75:
  1972. #line 762 "./parse.y"
  1973. {
  1974. if ( caseins && (yyvsp[(2) - (2)]) >= 'A' && (yyvsp[(2) - (2)]) <= 'Z' )
  1975. (yyvsp[(2) - (2)]) = clower( (yyvsp[(2) - (2)]) );
  1976. ++rulelen;
  1977. (yyval) = link_machines( (yyvsp[(1) - (2)]), mkstate( (yyvsp[(2) - (2)]) ) );
  1978. }
  1979. break;
  1980. case 76:
  1981. #line 772 "./parse.y"
  1982. { (yyval) = mkstate( SYM_EPSILON ); }
  1983. break;
  1984. /* Line 1267 of yacc.c. */
  1985. #line 2342 "y.tab.c"
  1986. default: break;
  1987. }
  1988. YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
  1989. YYPOPSTACK (yylen);
  1990. yylen = 0;
  1991. YY_STACK_PRINT (yyss, yyssp);
  1992. *++yyvsp = yyval;
  1993. /* Now `shift' the result of the reduction. Determine what state
  1994. that goes to, based on the state we popped back to and the rule
  1995. number reduced by. */
  1996. yyn = yyr1[yyn];
  1997. yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
  1998. if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
  1999. yystate = yytable[yystate];
  2000. else
  2001. yystate = yydefgoto[yyn - YYNTOKENS];
  2002. goto yynewstate;
  2003. /*------------------------------------.
  2004. | yyerrlab -- here on detecting error |
  2005. `------------------------------------*/
  2006. yyerrlab:
  2007. /* If not already recovering from an error, report this error. */
  2008. if (!yyerrstatus)
  2009. {
  2010. ++yynerrs;
  2011. #if ! YYERROR_VERBOSE
  2012. yyerror (YY_("syntax error"));
  2013. #else
  2014. {
  2015. YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
  2016. if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
  2017. {
  2018. YYSIZE_T yyalloc = 2 * yysize;
  2019. if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
  2020. yyalloc = YYSTACK_ALLOC_MAXIMUM;
  2021. if (yymsg != yymsgbuf)
  2022. YYSTACK_FREE (yymsg);
  2023. yymsg = (char *) YYSTACK_ALLOC (yyalloc);
  2024. if (yymsg)
  2025. yymsg_alloc = yyalloc;
  2026. else
  2027. {
  2028. yymsg = yymsgbuf;
  2029. yymsg_alloc = sizeof yymsgbuf;
  2030. }
  2031. }
  2032. if (0 < yysize && yysize <= yymsg_alloc)
  2033. {
  2034. (void) yysyntax_error (yymsg, yystate, yychar);
  2035. yyerror (yymsg);
  2036. }
  2037. else
  2038. {
  2039. yyerror (YY_("syntax error"));
  2040. if (yysize != 0)
  2041. goto yyexhaustedlab;
  2042. }
  2043. }
  2044. #endif
  2045. }
  2046. if (yyerrstatus == 3)
  2047. {
  2048. /* If just tried and failed to reuse look-ahead token after an
  2049. error, discard it. */
  2050. if (yychar <= YYEOF)
  2051. {
  2052. /* Return failure if at end of input. */
  2053. if (yychar == YYEOF)
  2054. YYABORT;
  2055. }
  2056. else
  2057. {
  2058. yydestruct ("Error: discarding",
  2059. yytoken, &yylval);
  2060. yychar = YYEMPTY;
  2061. }
  2062. }
  2063. /* Else will try to reuse look-ahead token after shifting the error
  2064. token. */
  2065. goto yyerrlab1;
  2066. /*---------------------------------------------------.
  2067. | yyerrorlab -- error raised explicitly by YYERROR. |
  2068. `---------------------------------------------------*/
  2069. yyerrorlab:
  2070. /* Pacify compilers like GCC when the user code never invokes
  2071. YYERROR and the label yyerrorlab therefore never appears in user
  2072. code. */
  2073. if (/*CONSTCOND*/ 0)
  2074. goto yyerrorlab;
  2075. /* Do not reclaim the symbols of the rule which action triggered
  2076. this YYERROR. */
  2077. YYPOPSTACK (yylen);
  2078. yylen = 0;
  2079. YY_STACK_PRINT (yyss, yyssp);
  2080. yystate = *yyssp;
  2081. goto yyerrlab1;
  2082. /*-------------------------------------------------------------.
  2083. | yyerrlab1 -- common code for both syntax error and YYERROR. |
  2084. `-------------------------------------------------------------*/
  2085. yyerrlab1:
  2086. yyerrstatus = 3; /* Each real token shifted decrements this. */
  2087. for (;;)
  2088. {
  2089. yyn = yypact[yystate];
  2090. if (yyn != YYPACT_NINF)
  2091. {
  2092. yyn += YYTERROR;
  2093. if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
  2094. {
  2095. yyn = yytable[yyn];
  2096. if (0 < yyn)
  2097. break;
  2098. }
  2099. }
  2100. /* Pop the current state because it cannot handle the error token. */
  2101. if (yyssp == yyss)
  2102. YYABORT;
  2103. yydestruct ("Error: popping",
  2104. yystos[yystate], yyvsp);
  2105. YYPOPSTACK (1);
  2106. yystate = *yyssp;
  2107. YY_STACK_PRINT (yyss, yyssp);
  2108. }
  2109. if (yyn == YYFINAL)
  2110. YYACCEPT;
  2111. *++yyvsp = yylval;
  2112. /* Shift the error token. */
  2113. YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
  2114. yystate = yyn;
  2115. goto yynewstate;
  2116. /*-------------------------------------.
  2117. | yyacceptlab -- YYACCEPT comes here. |
  2118. `-------------------------------------*/
  2119. yyacceptlab:
  2120. yyresult = 0;
  2121. goto yyreturn;
  2122. /*-----------------------------------.
  2123. | yyabortlab -- YYABORT comes here. |
  2124. `-----------------------------------*/
  2125. yyabortlab:
  2126. yyresult = 1;
  2127. goto yyreturn;
  2128. #ifndef yyoverflow
  2129. /*-------------------------------------------------.
  2130. | yyexhaustedlab -- memory exhaustion comes here. |
  2131. `-------------------------------------------------*/
  2132. yyexhaustedlab:
  2133. yyerror (YY_("memory exhausted"));
  2134. yyresult = 2;
  2135. /* Fall through. */
  2136. #endif
  2137. yyreturn:
  2138. if (yychar != YYEOF && yychar != YYEMPTY)
  2139. yydestruct ("Cleanup: discarding lookahead",
  2140. yytoken, &yylval);
  2141. /* Do not reclaim the symbols of the rule which action triggered
  2142. this YYABORT or YYACCEPT. */
  2143. YYPOPSTACK (yylen);
  2144. YY_STACK_PRINT (yyss, yyssp);
  2145. while (yyssp != yyss)
  2146. {
  2147. yydestruct ("Cleanup: popping",
  2148. yystos[*yyssp], yyvsp);
  2149. YYPOPSTACK (1);
  2150. }
  2151. #ifndef yyoverflow
  2152. if (yyss != yyssa)
  2153. YYSTACK_FREE (yyss);
  2154. #endif
  2155. #if YYERROR_VERBOSE
  2156. if (yymsg != yymsgbuf)
  2157. YYSTACK_FREE (yymsg);
  2158. #endif
  2159. /* Make sure YYID is used. */
  2160. return YYID (yyresult);
  2161. }
  2162. #line 775 "./parse.y"
  2163. /* build_eof_action - build the "<<EOF>>" action for the active start
  2164. * conditions
  2165. */
  2166. void build_eof_action()
  2167. {
  2168. int i;
  2169. char action_text[MAXLINE];
  2170. for ( i = 1; i <= scon_stk_ptr; ++i )
  2171. {
  2172. if ( sceof[scon_stk[i]] )
  2173. format_pinpoint_message(
  2174. "multiple <<EOF>> rules for start condition %s",
  2175. scname[scon_stk[i]] );
  2176. else
  2177. {
  2178. sceof[scon_stk[i]] = true;
  2179. sprintf( action_text, "case YY_STATE_EOF(%s):\n",
  2180. scname[scon_stk[i]] );
  2181. add_action( action_text );
  2182. }
  2183. }
  2184. line_directive_out( (FILE *) 0, 1 );
  2185. /* This isn't a normal rule after all - don't count it as
  2186. * such, so we don't have any holes in the rule numbering
  2187. * (which make generating "rule can never match" warnings
  2188. * more difficult.
  2189. */
  2190. --num_rules;
  2191. ++num_eof_rules;
  2192. }
  2193. /* format_synerr - write out formatted syntax error */
  2194. void format_synerr( msg, arg )
  2195. char msg[], arg[];
  2196. {
  2197. char errmsg[MAXLINE];
  2198. (void) sprintf( errmsg, msg, arg );
  2199. synerr( errmsg );
  2200. }
  2201. /* synerr - report a syntax error */
  2202. void synerr( str )
  2203. char str[];
  2204. {
  2205. syntaxerror = true;
  2206. pinpoint_message( str );
  2207. }
  2208. /* format_warn - write out formatted warning */
  2209. void format_warn( msg, arg )
  2210. char msg[], arg[];
  2211. {
  2212. char warn_msg[MAXLINE];
  2213. (void) sprintf( warn_msg, msg, arg );
  2214. warn( warn_msg );
  2215. }
  2216. /* warn - report a warning, unless -w was given */
  2217. void warn( str )
  2218. char str[];
  2219. {
  2220. line_warning( str, linenum );
  2221. }
  2222. /* format_pinpoint_message - write out a message formatted with one string,
  2223. * pinpointing its location
  2224. */
  2225. void format_pinpoint_message( msg, arg )
  2226. char msg[], arg[];
  2227. {
  2228. char errmsg[MAXLINE];
  2229. (void) sprintf( errmsg, msg, arg );
  2230. pinpoint_message( errmsg );
  2231. }
  2232. /* pinpoint_message - write out a message, pinpointing its location */
  2233. void pinpoint_message( str )
  2234. char str[];
  2235. {
  2236. line_pinpoint( str, linenum );
  2237. }
  2238. /* line_warning - report a warning at a given line, unless -w was given */
  2239. void line_warning( str, line )
  2240. char str[];
  2241. int line;
  2242. {
  2243. char warning[MAXLINE];
  2244. if ( ! nowarn )
  2245. {
  2246. sprintf( warning, "warning, %s", str );
  2247. line_pinpoint( warning, line );
  2248. }
  2249. }
  2250. /* line_pinpoint - write out a message, pinpointing it at the given line */
  2251. void line_pinpoint( str, line )
  2252. char str[];
  2253. int line;
  2254. {
  2255. fprintf( stderr, "\"%s\", line %d: %s\n", infilename, line, str );
  2256. }
  2257. /* yyerror - eat up an error message from the parser;
  2258. * currently, messages are ignore
  2259. */
  2260. void yyerror( msg )
  2261. char msg[];
  2262. {
  2263. }