pmu-bison.c 43 KB

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