xParser.cxx.prebuilt 59 KB

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