parse-events-bison.c 54 KB

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