tars.tab.cpp 93 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124
  1. /* A Bison parser, made by GNU Bison 2.3. */
  2. /* Skeleton implementation for Bison's Yacc-like parsers in C
  3. Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
  4. Free Software Foundation, Inc.
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2, or (at your option)
  8. any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 51 Franklin Street, Fifth Floor,
  16. Boston, MA 02110-1301, USA. */
  17. /* As a special exception, you may create a larger work that contains
  18. part or all of the Bison parser skeleton and distribute that work
  19. under terms of your choice, so long as that work isn't itself a
  20. parser generator using the skeleton or a modified version thereof
  21. as a parser skeleton. Alternatively, if you modify or redistribute
  22. the parser skeleton itself, you may (at your option) remove this
  23. special exception, which will cause the skeleton and the resulting
  24. Bison output files to be licensed under the GNU General Public
  25. License without this special exception.
  26. This special exception was added by the Free Software Foundation in
  27. version 2.2 of Bison. */
  28. /* C LALR(1) parser skeleton written by Richard Stallman, by
  29. simplifying the original so-called "semantic" parser. */
  30. /* All symbols defined below should begin with yy or YY, to avoid
  31. infringing on user name space. This should be done even for local
  32. variables, as they might otherwise be expanded by user macros.
  33. There are some unavoidable exceptions within include files to
  34. define necessary library symbols; they are noted "INFRINGES ON
  35. USER NAME SPACE" below. */
  36. /* Identify Bison output. */
  37. #define YYBISON 1
  38. /* Bison version. */
  39. #define YYBISON_VERSION "2.3"
  40. /* Skeleton name. */
  41. #define YYSKELETON_NAME "yacc.c"
  42. /* Pure parsers. */
  43. #define YYPURE 0
  44. /* Using locations. */
  45. #define YYLSP_NEEDED 0
  46. /* Tokens. */
  47. #ifndef YYTOKENTYPE
  48. # define YYTOKENTYPE
  49. /* Put the tokens into the symbol table, so that GDB and other debuggers
  50. know about them. */
  51. enum yytokentype {
  52. TARS_VOID = 258,
  53. TARS_STRUCT = 259,
  54. TARS_BOOL = 260,
  55. TARS_BYTE = 261,
  56. TARS_SHORT = 262,
  57. TARS_INT = 263,
  58. TARS_DOUBLE = 264,
  59. TARS_FLOAT = 265,
  60. TARS_LONG = 266,
  61. TARS_STRING = 267,
  62. TARS_VECTOR = 268,
  63. TARS_MAP = 269,
  64. TARS_NAMESPACE = 270,
  65. TARS_INTERFACE = 271,
  66. TARS_IDENTIFIER = 272,
  67. TARS_OUT = 273,
  68. TARS_OP = 274,
  69. TARS_KEY = 275,
  70. TARS_ROUTE_KEY = 276,
  71. TARS_REQUIRE = 277,
  72. TARS_OPTIONAL = 278,
  73. TARS_CONST_INTEGER = 279,
  74. TARS_CONST_FLOAT = 280,
  75. TARS_FALSE = 281,
  76. TARS_TRUE = 282,
  77. TARS_STRING_LITERAL = 283,
  78. TARS_SCOPE_DELIMITER = 284,
  79. TARS_CONST = 285,
  80. TARS_ENUM = 286,
  81. TARS_UNSIGNED = 287,
  82. BAD_CHAR = 288
  83. };
  84. #endif
  85. /* Tokens. */
  86. #define TARS_VOID 258
  87. #define TARS_STRUCT 259
  88. #define TARS_BOOL 260
  89. #define TARS_BYTE 261
  90. #define TARS_SHORT 262
  91. #define TARS_INT 263
  92. #define TARS_DOUBLE 264
  93. #define TARS_FLOAT 265
  94. #define TARS_LONG 266
  95. #define TARS_STRING 267
  96. #define TARS_VECTOR 268
  97. #define TARS_MAP 269
  98. #define TARS_NAMESPACE 270
  99. #define TARS_INTERFACE 271
  100. #define TARS_IDENTIFIER 272
  101. #define TARS_OUT 273
  102. #define TARS_OP 274
  103. #define TARS_KEY 275
  104. #define TARS_ROUTE_KEY 276
  105. #define TARS_REQUIRE 277
  106. #define TARS_OPTIONAL 278
  107. #define TARS_CONST_INTEGER 279
  108. #define TARS_CONST_FLOAT 280
  109. #define TARS_FALSE 281
  110. #define TARS_TRUE 282
  111. #define TARS_STRING_LITERAL 283
  112. #define TARS_SCOPE_DELIMITER 284
  113. #define TARS_CONST 285
  114. #define TARS_ENUM 286
  115. #define TARS_UNSIGNED 287
  116. #define BAD_CHAR 288
  117. /* Copy the first part of user declarations. */
  118. #line 17 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  119. #include <iostream>
  120. #include <memory>
  121. #include <cassert>
  122. using namespace std;
  123. #define YYSTYPE GrammarBasePtr
  124. #include "parse.h"
  125. #define YYDEBUG 1
  126. #define YYINITDEPTH 10000
  127. /* Enabling traces. */
  128. #ifndef YYDEBUG
  129. # define YYDEBUG 1
  130. #endif
  131. /* Enabling verbose error messages. */
  132. #ifdef YYERROR_VERBOSE
  133. # undef YYERROR_VERBOSE
  134. # define YYERROR_VERBOSE 1
  135. #else
  136. # define YYERROR_VERBOSE 0
  137. #endif
  138. /* Enabling the token table. */
  139. #ifndef YYTOKEN_TABLE
  140. # define YYTOKEN_TABLE 0
  141. #endif
  142. #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
  143. typedef int YYSTYPE;
  144. # define yystype YYSTYPE /* obsolescent; will be withdrawn */
  145. # define YYSTYPE_IS_DECLARED 1
  146. # define YYSTYPE_IS_TRIVIAL 1
  147. #endif
  148. /* Copy the second part of user declarations. */
  149. /* Line 216 of yacc.c. */
  150. #line 186 "tars.tab.cpp"
  151. #ifdef short
  152. # undef short
  153. #endif
  154. #ifdef YYTYPE_UINT8
  155. typedef YYTYPE_UINT8 yytype_uint8;
  156. #else
  157. typedef unsigned char yytype_uint8;
  158. #endif
  159. #ifdef YYTYPE_INT8
  160. typedef YYTYPE_INT8 yytype_int8;
  161. #elif (defined __STDC__ || defined __C99__FUNC__ \
  162. || defined __cplusplus || defined _MSC_VER)
  163. typedef signed char yytype_int8;
  164. #else
  165. typedef short int yytype_int8;
  166. #endif
  167. #ifdef YYTYPE_UINT16
  168. typedef YYTYPE_UINT16 yytype_uint16;
  169. #else
  170. typedef unsigned short int yytype_uint16;
  171. #endif
  172. #ifdef YYTYPE_INT16
  173. typedef YYTYPE_INT16 yytype_int16;
  174. #else
  175. typedef short int yytype_int16;
  176. #endif
  177. #ifndef YYSIZE_T
  178. # ifdef __SIZE_TYPE__
  179. # define YYSIZE_T __SIZE_TYPE__
  180. # elif defined size_t
  181. # define YYSIZE_T size_t
  182. # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
  183. || defined __cplusplus || defined _MSC_VER)
  184. # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
  185. # define YYSIZE_T size_t
  186. # else
  187. # define YYSIZE_T unsigned int
  188. # endif
  189. #endif
  190. #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
  191. #ifndef YY_
  192. # if defined YYENABLE_NLS && YYENABLE_NLS
  193. # if ENABLE_NLS
  194. # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
  195. # define YY_(msgid) dgettext ("bison-runtime", msgid)
  196. # endif
  197. # endif
  198. # ifndef YY_
  199. # define YY_(msgid) msgid
  200. # endif
  201. #endif
  202. /* Suppress unused-variable warnings by "using" E. */
  203. #if ! defined lint || defined __GNUC__
  204. # define YYUSE(e) ((void) (e))
  205. #else
  206. # define YYUSE(e) /* empty */
  207. #endif
  208. /* Identity function, used to suppress warnings about constant conditions. */
  209. #ifndef lint
  210. # define YYID(n) (n)
  211. #else
  212. #if (defined __STDC__ || defined __C99__FUNC__ \
  213. || defined __cplusplus || defined _MSC_VER)
  214. static int
  215. YYID (int i)
  216. #else
  217. static int
  218. YYID (i)
  219. int i;
  220. #endif
  221. {
  222. return i;
  223. }
  224. #endif
  225. #if ! defined yyoverflow || YYERROR_VERBOSE
  226. /* The parser invokes alloca or malloc; define the necessary symbols. */
  227. # ifdef YYSTACK_USE_ALLOCA
  228. # if YYSTACK_USE_ALLOCA
  229. # ifdef __GNUC__
  230. # define YYSTACK_ALLOC __builtin_alloca
  231. # elif defined __BUILTIN_VA_ARG_INCR
  232. # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
  233. # elif defined _AIX
  234. # define YYSTACK_ALLOC __alloca
  235. # elif defined _MSC_VER
  236. # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
  237. # define alloca _alloca
  238. # else
  239. # define YYSTACK_ALLOC alloca
  240. # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
  241. || defined __cplusplus || defined _MSC_VER)
  242. # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
  243. # ifndef _STDLIB_H
  244. # define _STDLIB_H 1
  245. # endif
  246. # endif
  247. # endif
  248. # endif
  249. # endif
  250. # ifdef YYSTACK_ALLOC
  251. /* Pacify GCC's `empty if-body' warning. */
  252. # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
  253. # ifndef YYSTACK_ALLOC_MAXIMUM
  254. /* The OS might guarantee only one guard page at the bottom of the stack,
  255. and a page size can be as small as 4096 bytes. So we cannot safely
  256. invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
  257. to allow for a few compiler-allocated temporary stack slots. */
  258. # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
  259. # endif
  260. # else
  261. # define YYSTACK_ALLOC YYMALLOC
  262. # define YYSTACK_FREE YYFREE
  263. # ifndef YYSTACK_ALLOC_MAXIMUM
  264. # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
  265. # endif
  266. # if (defined __cplusplus && ! defined _STDLIB_H \
  267. && ! ((defined YYMALLOC || defined malloc) \
  268. && (defined YYFREE || defined free)))
  269. # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
  270. # ifndef _STDLIB_H
  271. # define _STDLIB_H 1
  272. # endif
  273. # endif
  274. # ifndef YYMALLOC
  275. # define YYMALLOC malloc
  276. # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
  277. || defined __cplusplus || defined _MSC_VER)
  278. void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
  279. # endif
  280. # endif
  281. # ifndef YYFREE
  282. # define YYFREE free
  283. # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
  284. || defined __cplusplus || defined _MSC_VER)
  285. void free (void *); /* INFRINGES ON USER NAME SPACE */
  286. # endif
  287. # endif
  288. # endif
  289. #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
  290. #if (! defined yyoverflow \
  291. && (! defined __cplusplus \
  292. || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
  293. /* A type that is properly aligned for any stack member. */
  294. union yyalloc
  295. {
  296. yytype_int16 yyss;
  297. YYSTYPE yyvs;
  298. };
  299. /* The size of the maximum gap between one aligned stack and the next. */
  300. # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
  301. /* The size of an array large to enough to hold all stacks, each with
  302. N elements. */
  303. # define YYSTACK_BYTES(N) \
  304. ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
  305. + YYSTACK_GAP_MAXIMUM)
  306. /* Copy COUNT objects from FROM to TO. The source and destination do
  307. not overlap. */
  308. # ifndef YYCOPY
  309. # if defined __GNUC__ && 1 < __GNUC__
  310. # define YYCOPY(To, From, Count) \
  311. __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
  312. # else
  313. # define YYCOPY(To, From, Count) \
  314. do \
  315. { \
  316. YYSIZE_T yyi; \
  317. for (yyi = 0; yyi < (Count); yyi++) \
  318. (To)[yyi] = (From)[yyi]; \
  319. } \
  320. while (YYID (0))
  321. # endif
  322. # endif
  323. /* Relocate STACK from its old location to the new one. The
  324. local variables YYSIZE and YYSTACKSIZE give the old and new number of
  325. elements in the stack, and YYPTR gives the new location of the
  326. stack. Advance YYPTR to a properly aligned location for the next
  327. stack. */
  328. # define YYSTACK_RELOCATE(Stack) \
  329. do \
  330. { \
  331. YYSIZE_T yynewbytes; \
  332. YYCOPY (&yyptr->Stack, Stack, yysize); \
  333. Stack = &yyptr->Stack; \
  334. yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
  335. yyptr += yynewbytes / sizeof (*yyptr); \
  336. } \
  337. while (YYID (0))
  338. #endif
  339. /* YYFINAL -- State number of the termination state. */
  340. #define YYFINAL 75
  341. /* YYLAST -- Last index in YYTABLE. */
  342. #define YYLAST 565
  343. /* YYNTOKENS -- Number of terminals. */
  344. #define YYNTOKENS 46
  345. /* YYNNTS -- Number of nonterminals. */
  346. #define YYNNTS 42
  347. /* YYNRULES -- Number of rules. */
  348. #define YYNRULES 137
  349. /* YYNRULES -- Number of states. */
  350. #define YYNSTATES 199
  351. /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
  352. #define YYUNDEFTOK 2
  353. #define YYMAXUTOK 288
  354. #define YYTRANSLATE(YYX) \
  355. ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
  356. /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
  357. static const yytype_uint8 yytranslate[] =
  358. {
  359. 0, 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, 2, 2, 2, 2,
  363. 2, 41, 42, 2, 37, 2, 2, 2, 2, 2,
  364. 2, 2, 2, 2, 2, 2, 2, 2, 43, 34,
  365. 44, 38, 45, 2, 2, 2, 2, 2, 2, 2,
  366. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  367. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  368. 2, 39, 2, 40, 2, 2, 2, 2, 2, 2,
  369. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  370. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  371. 2, 2, 2, 35, 2, 36, 2, 2, 2, 2,
  372. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  373. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  374. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  375. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  376. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  377. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  378. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  379. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  380. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  381. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  382. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  383. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  384. 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
  385. 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
  386. 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
  387. 25, 26, 27, 28, 29, 30, 31, 32, 33
  388. };
  389. #if YYDEBUG
  390. /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
  391. YYRHS. */
  392. static const yytype_uint16 yyprhs[] =
  393. {
  394. 0, 0, 3, 5, 6, 11, 12, 17, 19, 20,
  395. 22, 24, 26, 28, 30, 32, 33, 39, 42, 45,
  396. 49, 51, 53, 55, 59, 60, 61, 68, 69, 77,
  397. 79, 83, 84, 90, 93, 96, 100, 104, 106, 107,
  398. 109, 113, 116, 118, 120, 121, 123, 127, 130, 135,
  399. 138, 143, 145, 147, 149, 151, 152, 158, 161, 164,
  400. 167, 171, 173, 174, 176, 180, 186, 192, 196, 199,
  401. 202, 205, 207, 209, 211, 213, 215, 217, 219, 223,
  402. 228, 231, 237, 241, 246, 249, 251, 253, 257, 259,
  403. 263, 265, 267, 270, 272, 275, 277, 280, 282, 284,
  404. 286, 288, 290, 292, 294, 299, 303, 308, 311, 318,
  405. 322, 324, 327, 331, 333, 335, 337, 339, 341, 343,
  406. 345, 347, 349, 351, 353, 355, 357, 359, 361, 363,
  407. 365, 367, 369, 371, 373, 375, 377, 379
  408. };
  409. /* YYRHS -- A `-1'-separated list of the rules' RHS. */
  410. static const yytype_int8 yyrhs[] =
  411. {
  412. 47, 0, -1, 48, -1, -1, 51, 49, 34, 48,
  413. -1, -1, 1, 34, 50, 48, -1, 51, -1, -1,
  414. 57, -1, 62, -1, 73, -1, 59, -1, 52, -1,
  415. 80, -1, -1, 54, 53, 35, 55, 36, -1, 31,
  416. 17, -1, 31, 87, -1, 56, 37, 55, -1, 56,
  417. -1, 17, -1, 87, -1, 17, 38, 79, -1, -1,
  418. -1, 15, 17, 58, 35, 48, 36, -1, -1, 20,
  419. 39, 86, 37, 60, 61, 40, -1, 17, -1, 61,
  420. 37, 17, -1, -1, 64, 63, 35, 65, 36, -1,
  421. 16, 17, -1, 16, 87, -1, 66, 34, 65, -1,
  422. 1, 34, 65, -1, 66, -1, -1, 67, -1, 68,
  423. 70, 41, -1, 69, 19, -1, 82, -1, 3, -1,
  424. -1, 81, -1, 70, 37, 81, -1, 72, 81, -1,
  425. 70, 37, 72, 81, -1, 71, 81, -1, 70, 37,
  426. 71, 81, -1, 72, -1, 71, -1, 21, -1, 18,
  427. -1, -1, 75, 74, 35, 76, 36, -1, 4, 17,
  428. -1, 4, 87, -1, 4, 1, -1, 77, 34, 76,
  429. -1, 77, -1, -1, 78, -1, 24, 22, 81, -1,
  430. 24, 22, 81, 38, 79, -1, 24, 23, 81, 38,
  431. 79, -1, 24, 23, 81, -1, 22, 81, -1, 23,
  432. 81, -1, 24, 81, -1, 81, -1, 24, -1, 25,
  433. -1, 28, -1, 26, -1, 27, -1, 17, -1, 86,
  434. 29, 17, -1, 30, 81, 38, 79, -1, 82, 17,
  435. -1, 82, 17, 39, 24, 40, -1, 82, 42, 17,
  436. -1, 82, 17, 43, 24, -1, 82, 87, -1, 82,
  437. -1, 1, -1, 83, 43, 24, -1, 83, -1, 83,
  438. 43, 1, -1, 5, -1, 6, -1, 32, 6, -1,
  439. 7, -1, 32, 7, -1, 8, -1, 32, 8, -1,
  440. 11, -1, 10, -1, 9, -1, 12, -1, 84, -1,
  441. 85, -1, 86, -1, 13, 44, 82, 45, -1, 13,
  442. 44, 1, -1, 13, 44, 82, 1, -1, 13, 1,
  443. -1, 14, 44, 82, 37, 82, 45, -1, 14, 44,
  444. 1, -1, 17, -1, 29, 17, -1, 86, 29, 17,
  445. -1, 4, -1, 3, -1, 5, -1, 6, -1, 7,
  446. -1, 8, -1, 10, -1, 9, -1, 12, -1, 13,
  447. -1, 20, -1, 14, -1, 15, -1, 16, -1, 18,
  448. -1, 22, -1, 23, -1, 24, -1, 25, -1, 26,
  449. -1, 27, -1, 28, -1, 30, -1, 31, -1, 32,
  450. -1
  451. };
  452. /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
  453. static const yytype_uint16 yyrline[] =
  454. {
  455. 0, 68, 68, 75, 74, 79, 78, 83, 88, 95,
  456. 99, 103, 107, 110, 114, 124, 123, 146, 159, 170,
  457. 174, 182, 193, 198, 212, 220, 219, 253, 252, 271,
  458. 284, 304, 303, 337, 341, 352, 355, 358, 363, 370,
  459. 376, 393, 422, 423, 434, 436, 447, 458, 470, 482,
  460. 494, 506, 510, 519, 530, 542, 541, 583, 587, 593,
  461. 602, 606, 611, 620, 629, 647, 669, 691, 708, 712,
  462. 716, 720, 729, 739, 749, 757, 765, 773, 786, 806,
  463. 824, 833, 843, 853, 862, 867, 871, 880, 889, 893,
  464. 902, 906, 910, 914, 918, 922, 926, 930, 934, 938,
  465. 942, 946, 950, 954, 972, 976, 980, 984, 993, 997,
  466. 1006, 1009, 1015, 1028, 1031, 1034, 1037, 1040, 1043, 1046,
  467. 1049, 1052, 1055, 1058, 1061, 1064, 1067, 1070, 1073, 1076,
  468. 1079, 1082, 1085, 1088, 1091, 1094, 1097, 1100
  469. };
  470. #endif
  471. #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
  472. /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
  473. First, the terminals, then, starting at YYNTOKENS, nonterminals. */
  474. static const char *const yytname[] =
  475. {
  476. "$end", "error", "$undefined", "TARS_VOID", "TARS_STRUCT", "TARS_BOOL",
  477. "TARS_BYTE", "TARS_SHORT", "TARS_INT", "TARS_DOUBLE", "TARS_FLOAT",
  478. "TARS_LONG", "TARS_STRING", "TARS_VECTOR", "TARS_MAP", "TARS_NAMESPACE",
  479. "TARS_INTERFACE", "TARS_IDENTIFIER", "TARS_OUT", "TARS_OP", "TARS_KEY",
  480. "TARS_ROUTE_KEY", "TARS_REQUIRE", "TARS_OPTIONAL", "TARS_CONST_INTEGER",
  481. "TARS_CONST_FLOAT", "TARS_FALSE", "TARS_TRUE", "TARS_STRING_LITERAL",
  482. "TARS_SCOPE_DELIMITER", "TARS_CONST", "TARS_ENUM", "TARS_UNSIGNED",
  483. "BAD_CHAR", "';'", "'{'", "'}'", "','", "'='", "'['", "']'", "')'",
  484. "'*'", "':'", "'<'", "'>'", "$accept", "start", "definitions", "@1",
  485. "@2", "definition", "enum_def", "@3", "enum_id", "enumerator_list",
  486. "enumerator", "namespace_def", "@4", "key_def", "@5", "key_members",
  487. "interface_def", "@6", "interface_id", "interface_exports",
  488. "interface_export", "operation", "operation_preamble", "return_type",
  489. "parameters", "routekey_qualifier", "out_qualifier", "struct_def", "@7",
  490. "struct_id", "struct_exports", "data_member", "struct_type_id",
  491. "const_initializer", "const_def", "type_id", "type", "type_no", "vector",
  492. "map", "scoped_name", "keyword", 0
  493. };
  494. #endif
  495. # ifdef YYPRINT
  496. /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
  497. token YYLEX-NUM. */
  498. static const yytype_uint16 yytoknum[] =
  499. {
  500. 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
  501. 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
  502. 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
  503. 285, 286, 287, 288, 59, 123, 125, 44, 61, 91,
  504. 93, 41, 42, 58, 60, 62
  505. };
  506. # endif
  507. /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
  508. static const yytype_uint8 yyr1[] =
  509. {
  510. 0, 46, 47, 49, 48, 50, 48, 48, 48, 51,
  511. 51, 51, 51, 51, 51, 53, 52, 54, 54, 55,
  512. 55, 56, 56, 56, 56, 58, 57, 60, 59, 61,
  513. 61, 63, 62, 64, 64, 65, 65, 65, 65, 66,
  514. 67, 68, 69, 69, 70, 70, 70, 70, 70, 70,
  515. 70, 70, 70, 71, 72, 74, 73, 75, 75, 75,
  516. 76, 76, 76, 77, 78, 78, 78, 78, 78, 78,
  517. 78, 78, 79, 79, 79, 79, 79, 79, 79, 80,
  518. 81, 81, 81, 81, 81, 81, 81, 82, 82, 82,
  519. 83, 83, 83, 83, 83, 83, 83, 83, 83, 83,
  520. 83, 83, 83, 83, 84, 84, 84, 84, 85, 85,
  521. 86, 86, 86, 87, 87, 87, 87, 87, 87, 87,
  522. 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
  523. 87, 87, 87, 87, 87, 87, 87, 87
  524. };
  525. /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
  526. static const yytype_uint8 yyr2[] =
  527. {
  528. 0, 2, 1, 0, 4, 0, 4, 1, 0, 1,
  529. 1, 1, 1, 1, 1, 0, 5, 2, 2, 3,
  530. 1, 1, 1, 3, 0, 0, 6, 0, 7, 1,
  531. 3, 0, 5, 2, 2, 3, 3, 1, 0, 1,
  532. 3, 2, 1, 1, 0, 1, 3, 2, 4, 2,
  533. 4, 1, 1, 1, 1, 0, 5, 2, 2, 2,
  534. 3, 1, 0, 1, 3, 5, 5, 3, 2, 2,
  535. 2, 1, 1, 1, 1, 1, 1, 1, 3, 4,
  536. 2, 5, 3, 4, 2, 1, 1, 3, 1, 3,
  537. 1, 1, 2, 1, 2, 1, 2, 1, 1, 1,
  538. 1, 1, 1, 1, 4, 3, 4, 2, 6, 3,
  539. 1, 2, 3, 1, 1, 1, 1, 1, 1, 1,
  540. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  541. 1, 1, 1, 1, 1, 1, 1, 1
  542. };
  543. /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
  544. STATE-NUM when YYTABLE doesn't specify something else to do. Zero
  545. means the default is an error. */
  546. static const yytype_uint8 yydefact[] =
  547. {
  548. 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
  549. 7, 13, 15, 9, 12, 10, 31, 11, 55, 14,
  550. 5, 59, 114, 113, 115, 116, 117, 118, 120, 119,
  551. 121, 122, 124, 125, 126, 57, 127, 123, 128, 129,
  552. 130, 131, 132, 133, 134, 135, 136, 137, 58, 25,
  553. 33, 34, 0, 86, 90, 91, 93, 95, 99, 98,
  554. 97, 100, 0, 0, 110, 0, 0, 0, 85, 88,
  555. 101, 102, 103, 17, 18, 1, 0, 0, 0, 0,
  556. 0, 0, 0, 107, 0, 0, 111, 92, 94, 96,
  557. 0, 80, 0, 84, 0, 0, 0, 24, 0, 0,
  558. 6, 0, 27, 105, 0, 109, 0, 77, 72, 73,
  559. 75, 76, 74, 79, 0, 0, 0, 82, 89, 87,
  560. 112, 4, 21, 0, 20, 22, 0, 43, 0, 37,
  561. 39, 0, 0, 42, 0, 0, 0, 0, 61, 63,
  562. 71, 0, 0, 106, 104, 0, 0, 0, 83, 0,
  563. 16, 24, 0, 32, 0, 54, 53, 0, 0, 0,
  564. 45, 41, 68, 69, 0, 0, 70, 56, 0, 26,
  565. 29, 0, 0, 78, 81, 23, 19, 36, 35, 0,
  566. 40, 49, 47, 64, 67, 60, 0, 28, 108, 0,
  567. 0, 46, 0, 0, 30, 50, 48, 65, 66
  568. };
  569. /* YYDEFGOTO[NTERM-NUM]. */
  570. static const yytype_int16 yydefgoto[] =
  571. {
  572. -1, 8, 9, 76, 80, 10, 11, 77, 12, 123,
  573. 124, 13, 81, 14, 142, 171, 15, 78, 16, 128,
  574. 129, 130, 131, 132, 157, 158, 159, 17, 79, 18,
  575. 137, 138, 139, 113, 19, 140, 68, 69, 70, 71,
  576. 72, 125
  577. };
  578. /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
  579. STATE-NUM. */
  580. #define YYPACT_NINF -146
  581. static const yytype_int16 yypact[] =
  582. {
  583. 145, -22, 286, 20, 445, 16, 372, 475, 42, -146,
  584. 26, -146, -146, -146, -146, -146, -146, -146, -146, -146,
  585. -146, -146, -146, -146, -146, -146, -146, -146, -146, -146,
  586. -146, -146, -146, -146, -146, -146, -146, -146, -146, -146,
  587. -146, -146, -146, -146, -146, -146, -146, -146, -146, -146,
  588. -146, -146, 11, -146, -146, -146, -146, -146, -146, -146,
  589. -146, -146, 7, 2, -146, 37, 51, 23, 182, 19,
  590. -146, -146, 35, -146, -146, -146, 31, 32, 33, 49,
  591. 102, 66, -2, -146, 386, 415, -146, -146, -146, -146,
  592. 153, -5, 69, -146, 8, 87, 102, 505, 252, 220,
  593. -146, 120, -146, -146, 5, -146, 29, 78, -146, -146,
  594. -146, -146, -146, -146, 79, 86, 88, -146, -146, -146,
  595. -146, -146, 75, 80, 83, -146, 81, -146, 90, 93,
  596. -146, 12, 112, -146, 372, 372, 314, 98, 103, -146,
  597. -146, 107, 122, -146, -146, 533, 127, 108, -146, 153,
  598. -146, 505, 252, -146, 252, -146, -146, 15, 68, 82,
  599. -146, -146, -146, -146, 372, 372, -146, -146, 220, -146,
  600. -146, -26, 109, 118, -146, -146, -146, -146, -146, 343,
  601. -146, -146, -146, 117, 119, -146, 146, -146, -146, 372,
  602. 372, -146, 153, 153, -146, -146, -146, -146, -146
  603. };
  604. /* YYPGOTO[NTERM-NUM]. */
  605. static const yytype_int16 yypgoto[] =
  606. {
  607. -146, -146, -65, -146, -146, -146, -146, -146, -146, 13,
  608. -146, -146, -146, -146, -146, -146, -146, -146, -146, -109,
  609. -146, -146, -146, -146, -146, -17, -13, -146, -146, -146,
  610. -1, -146, -146, -145, -146, -6, -82, -146, -146, -146,
  611. -51, 3
  612. };
  613. /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
  614. positive, shift that token. If negative, reduce the rule which
  615. number is the opposite. If zero, do what YYDEFACT says.
  616. If YYTABLE_NINF, syntax error. */
  617. #define YYTABLE_NINF -113
  618. static const yytype_int16 yytable[] =
  619. {
  620. 67, 82, 104, 106, 175, 48, 143, 51, 83, 118,
  621. 74, 186, 20, 53, 187, 100, 133, 54, 55, 56,
  622. 57, 58, 59, 60, 61, 62, 63, 95, 64, 64,
  623. 155, 121, 119, 156, 115, 102, 141, 49, 116, 114,
  624. 65, 65, 75, 177, 66, 178, 85, 197, 198, -44,
  625. 144, 84, 179, -44, 86, 52, 180, 87, 88, 89,
  626. -3, 90, 94, 172, 95, 96, 145, 97, 98, 53,
  627. 133, 93, 133, 54, 55, 56, 57, 58, 59, 60,
  628. 61, 62, 63, 53, 99, 64, 117, 54, 55, 56,
  629. 57, 58, 59, 60, 61, 62, 63, 65, 114, 64,
  630. 66, 101, -8, 1, 120, -52, 2, -110, 146, -52,
  631. 147, 65, 148, 149, 66, 152, 150, 3, 4, -51,
  632. 151, 1, 5, -51, 2, 160, 153, 154, 162, 163,
  633. 166, 161, 6, 7, 167, 3, 4, 168, -8, 170,
  634. 5, 114, 114, 169, 173, -8, 1, -112, 174, 2,
  635. 6, 7, 181, 182, 188, 192, -8, 193, 183, 184,
  636. 3, 4, 189, 194, 176, 5, 190, 185, 0, 0,
  637. 107, 0, 0, 191, 0, 6, 7, 108, 109, 110,
  638. 111, 112, 65, 195, 196, 22, 23, 24, 25, 26,
  639. 27, 28, 29, 0, 30, 31, 32, 33, 34, 91,
  640. 36, 0, 37, 0, 38, 39, 40, 41, 42, 43,
  641. 44, 0, 45, 46, 47, 0, 0, 0, 0, 0,
  642. 0, 53, 0, 0, 92, 54, 55, 56, 57, 58,
  643. 59, 60, 61, 62, 63, 0, 0, 64, 0, 0,
  644. 0, 0, 134, 135, 136, 0, 0, 0, 0, 65,
  645. 0, 0, 66, 126, 0, 127, -62, 54, 55, 56,
  646. 57, 58, 59, 60, 61, 62, 63, 0, 0, 64,
  647. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  648. 0, 65, 0, 0, 66, 0, 0, 21, -38, 22,
  649. 23, 24, 25, 26, 27, 28, 29, 0, 30, 31,
  650. 32, 33, 34, 35, 36, 0, 37, 0, 38, 39,
  651. 40, 41, 42, 43, 44, 53, 45, 46, 47, 54,
  652. 55, 56, 57, 58, 59, 60, 61, 62, 63, 0,
  653. 0, 64, 0, 0, 0, 0, 164, 165, 0, 0,
  654. 0, 0, 0, 65, 53, 0, 66, 0, 54, 55,
  655. 56, 57, 58, 59, 60, 61, 62, 63, 0, 0,
  656. 64, 155, 0, 0, 156, 0, 0, 0, 0, 0,
  657. 0, 0, 65, 53, 0, 66, 0, 54, 55, 56,
  658. 57, 58, 59, 60, 61, 62, 63, 103, 0, 64,
  659. 0, 54, 55, 56, 57, 58, 59, 60, 61, 62,
  660. 63, 65, 0, 64, 66, 0, 0, 0, 0, 0,
  661. 0, 0, 0, 0, 0, 65, 105, 0, 66, 0,
  662. 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
  663. 0, 0, 64, 0, 0, 0, 0, 0, 0, 0,
  664. 0, 0, 0, 0, 65, 0, 0, 66, 22, 23,
  665. 24, 25, 26, 27, 28, 29, 0, 30, 31, 32,
  666. 33, 34, 50, 36, 0, 37, 0, 38, 39, 40,
  667. 41, 42, 43, 44, 0, 45, 46, 47, 22, 23,
  668. 24, 25, 26, 27, 28, 29, 0, 30, 31, 32,
  669. 33, 34, 73, 36, 0, 37, 0, 38, 39, 40,
  670. 41, 42, 43, 44, 0, 45, 46, 47, 22, 23,
  671. 24, 25, 26, 27, 28, 29, 0, 30, 31, 32,
  672. 33, 34, 122, 36, 0, 37, 0, 38, 39, 40,
  673. 41, 42, 43, 44, 0, 45, 46, 47, 54, 55,
  674. 56, 57, 58, 59, 60, 61, 62, 63, 0, 0,
  675. 64, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  676. 0, 0, 65, 0, 0, 66
  677. };
  678. static const yytype_int16 yycheck[] =
  679. {
  680. 6, 52, 84, 85, 149, 2, 1, 4, 1, 1,
  681. 7, 37, 34, 1, 40, 80, 98, 5, 6, 7,
  682. 8, 9, 10, 11, 12, 13, 14, 29, 17, 17,
  683. 18, 96, 24, 21, 39, 37, 101, 17, 43, 90,
  684. 29, 29, 0, 152, 32, 154, 44, 192, 193, 37,
  685. 45, 44, 37, 41, 17, 39, 41, 6, 7, 8,
  686. 34, 38, 43, 145, 29, 34, 37, 35, 35, 1,
  687. 152, 68, 154, 5, 6, 7, 8, 9, 10, 11,
  688. 12, 13, 14, 1, 35, 17, 17, 5, 6, 7,
  689. 8, 9, 10, 11, 12, 13, 14, 29, 149, 17,
  690. 32, 35, 0, 1, 17, 37, 4, 29, 29, 41,
  691. 24, 29, 24, 38, 32, 34, 36, 15, 16, 37,
  692. 37, 1, 20, 41, 4, 131, 36, 34, 134, 135,
  693. 136, 19, 30, 31, 36, 15, 16, 34, 36, 17,
  694. 20, 192, 193, 36, 17, 0, 1, 29, 40, 4,
  695. 30, 31, 158, 159, 45, 38, 36, 38, 164, 165,
  696. 15, 16, 179, 17, 151, 20, 179, 168, -1, -1,
  697. 17, -1, -1, 179, -1, 30, 31, 24, 25, 26,
  698. 27, 28, 29, 189, 190, 3, 4, 5, 6, 7,
  699. 8, 9, 10, -1, 12, 13, 14, 15, 16, 17,
  700. 18, -1, 20, -1, 22, 23, 24, 25, 26, 27,
  701. 28, -1, 30, 31, 32, -1, -1, -1, -1, -1,
  702. -1, 1, -1, -1, 42, 5, 6, 7, 8, 9,
  703. 10, 11, 12, 13, 14, -1, -1, 17, -1, -1,
  704. -1, -1, 22, 23, 24, -1, -1, -1, -1, 29,
  705. -1, -1, 32, 1, -1, 3, 36, 5, 6, 7,
  706. 8, 9, 10, 11, 12, 13, 14, -1, -1, 17,
  707. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  708. -1, 29, -1, -1, 32, -1, -1, 1, 36, 3,
  709. 4, 5, 6, 7, 8, 9, 10, -1, 12, 13,
  710. 14, 15, 16, 17, 18, -1, 20, -1, 22, 23,
  711. 24, 25, 26, 27, 28, 1, 30, 31, 32, 5,
  712. 6, 7, 8, 9, 10, 11, 12, 13, 14, -1,
  713. -1, 17, -1, -1, -1, -1, 22, 23, -1, -1,
  714. -1, -1, -1, 29, 1, -1, 32, -1, 5, 6,
  715. 7, 8, 9, 10, 11, 12, 13, 14, -1, -1,
  716. 17, 18, -1, -1, 21, -1, -1, -1, -1, -1,
  717. -1, -1, 29, 1, -1, 32, -1, 5, 6, 7,
  718. 8, 9, 10, 11, 12, 13, 14, 1, -1, 17,
  719. -1, 5, 6, 7, 8, 9, 10, 11, 12, 13,
  720. 14, 29, -1, 17, 32, -1, -1, -1, -1, -1,
  721. -1, -1, -1, -1, -1, 29, 1, -1, 32, -1,
  722. 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
  723. -1, -1, 17, -1, -1, -1, -1, -1, -1, -1,
  724. -1, -1, -1, -1, 29, -1, -1, 32, 3, 4,
  725. 5, 6, 7, 8, 9, 10, -1, 12, 13, 14,
  726. 15, 16, 17, 18, -1, 20, -1, 22, 23, 24,
  727. 25, 26, 27, 28, -1, 30, 31, 32, 3, 4,
  728. 5, 6, 7, 8, 9, 10, -1, 12, 13, 14,
  729. 15, 16, 17, 18, -1, 20, -1, 22, 23, 24,
  730. 25, 26, 27, 28, -1, 30, 31, 32, 3, 4,
  731. 5, 6, 7, 8, 9, 10, -1, 12, 13, 14,
  732. 15, 16, 17, 18, -1, 20, -1, 22, 23, 24,
  733. 25, 26, 27, 28, -1, 30, 31, 32, 5, 6,
  734. 7, 8, 9, 10, 11, 12, 13, 14, -1, -1,
  735. 17, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  736. -1, -1, 29, -1, -1, 32
  737. };
  738. /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
  739. symbol of state STATE-NUM. */
  740. static const yytype_uint8 yystos[] =
  741. {
  742. 0, 1, 4, 15, 16, 20, 30, 31, 47, 48,
  743. 51, 52, 54, 57, 59, 62, 64, 73, 75, 80,
  744. 34, 1, 3, 4, 5, 6, 7, 8, 9, 10,
  745. 12, 13, 14, 15, 16, 17, 18, 20, 22, 23,
  746. 24, 25, 26, 27, 28, 30, 31, 32, 87, 17,
  747. 17, 87, 39, 1, 5, 6, 7, 8, 9, 10,
  748. 11, 12, 13, 14, 17, 29, 32, 81, 82, 83,
  749. 84, 85, 86, 17, 87, 0, 49, 53, 63, 74,
  750. 50, 58, 86, 1, 44, 44, 17, 6, 7, 8,
  751. 38, 17, 42, 87, 43, 29, 34, 35, 35, 35,
  752. 48, 35, 37, 1, 82, 1, 82, 17, 24, 25,
  753. 26, 27, 28, 79, 86, 39, 43, 17, 1, 24,
  754. 17, 48, 17, 55, 56, 87, 1, 3, 65, 66,
  755. 67, 68, 69, 82, 22, 23, 24, 76, 77, 78,
  756. 81, 48, 60, 1, 45, 37, 29, 24, 24, 38,
  757. 36, 37, 34, 36, 34, 18, 21, 70, 71, 72,
  758. 81, 19, 81, 81, 22, 23, 81, 36, 34, 36,
  759. 17, 61, 82, 17, 40, 79, 55, 65, 65, 37,
  760. 41, 81, 81, 81, 81, 76, 37, 40, 45, 71,
  761. 72, 81, 38, 38, 17, 81, 81, 79, 79
  762. };
  763. #define yyerrok (yyerrstatus = 0)
  764. #define yyclearin (yychar = YYEMPTY)
  765. #define YYEMPTY (-2)
  766. #define YYEOF 0
  767. #define YYACCEPT goto yyacceptlab
  768. #define YYABORT goto yyabortlab
  769. #define YYERROR goto yyerrorlab
  770. /* Like YYERROR except do call yyerror. This remains here temporarily
  771. to ease the transition to the new meaning of YYERROR, for GCC.
  772. Once GCC version 2 has supplanted version 1, this can go. */
  773. #define YYFAIL goto yyerrlab
  774. #define YYRECOVERING() (!!yyerrstatus)
  775. #define YYBACKUP(Token, Value) \
  776. do \
  777. if (yychar == YYEMPTY && yylen == 1) \
  778. { \
  779. yychar = (Token); \
  780. yylval = (Value); \
  781. yytoken = YYTRANSLATE (yychar); \
  782. YYPOPSTACK (1); \
  783. goto yybackup; \
  784. } \
  785. else \
  786. { \
  787. yyerror (YY_("syntax error: cannot back up")); \
  788. YYERROR; \
  789. } \
  790. while (YYID (0))
  791. #define YYTERROR 1
  792. #define YYERRCODE 256
  793. /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
  794. If N is 0, then set CURRENT to the empty location which ends
  795. the previous symbol: RHS[0] (always defined). */
  796. #define YYRHSLOC(Rhs, K) ((Rhs)[K])
  797. #ifndef YYLLOC_DEFAULT
  798. # define YYLLOC_DEFAULT(Current, Rhs, N) \
  799. do \
  800. if (YYID (N)) \
  801. { \
  802. (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
  803. (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
  804. (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
  805. (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
  806. } \
  807. else \
  808. { \
  809. (Current).first_line = (Current).last_line = \
  810. YYRHSLOC (Rhs, 0).last_line; \
  811. (Current).first_column = (Current).last_column = \
  812. YYRHSLOC (Rhs, 0).last_column; \
  813. } \
  814. while (YYID (0))
  815. #endif
  816. /* YY_LOCATION_PRINT -- Print the location on the stream.
  817. This macro was not mandated originally: define only if we know
  818. we won't break user code: when these are the locations we know. */
  819. #ifndef YY_LOCATION_PRINT
  820. # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
  821. # define YY_LOCATION_PRINT(File, Loc) \
  822. fprintf (File, "%d.%d-%d.%d", \
  823. (Loc).first_line, (Loc).first_column, \
  824. (Loc).last_line, (Loc).last_column)
  825. # else
  826. # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
  827. # endif
  828. #endif
  829. /* YYLEX -- calling `yylex' with the right arguments. */
  830. #ifdef YYLEX_PARAM
  831. # define YYLEX yylex (YYLEX_PARAM)
  832. #else
  833. # define YYLEX yylex ()
  834. #endif
  835. /* Enable debugging if requested. */
  836. #if YYDEBUG
  837. # ifndef YYFPRINTF
  838. # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
  839. # define YYFPRINTF fprintf
  840. # endif
  841. # define YYDPRINTF(Args) \
  842. do { \
  843. if (yydebug) \
  844. YYFPRINTF Args; \
  845. } while (YYID (0))
  846. # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
  847. do { \
  848. if (yydebug) \
  849. { \
  850. YYFPRINTF (stderr, "%s ", Title); \
  851. yy_symbol_print (stderr, \
  852. Type, Value); \
  853. YYFPRINTF (stderr, "\n"); \
  854. } \
  855. } while (YYID (0))
  856. /*--------------------------------.
  857. | Print this symbol on YYOUTPUT. |
  858. `--------------------------------*/
  859. /*ARGSUSED*/
  860. #if (defined __STDC__ || defined __C99__FUNC__ \
  861. || defined __cplusplus || defined _MSC_VER)
  862. static void
  863. yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
  864. #else
  865. static void
  866. yy_symbol_value_print (yyoutput, yytype, yyvaluep)
  867. FILE *yyoutput;
  868. int yytype;
  869. YYSTYPE const * const yyvaluep;
  870. #endif
  871. {
  872. if (!yyvaluep)
  873. return;
  874. # ifdef YYPRINT
  875. if (yytype < YYNTOKENS)
  876. YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
  877. # else
  878. YYUSE (yyoutput);
  879. # endif
  880. switch (yytype)
  881. {
  882. default:
  883. break;
  884. }
  885. }
  886. /*--------------------------------.
  887. | Print this symbol on YYOUTPUT. |
  888. `--------------------------------*/
  889. #if (defined __STDC__ || defined __C99__FUNC__ \
  890. || defined __cplusplus || defined _MSC_VER)
  891. static void
  892. yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
  893. #else
  894. static void
  895. yy_symbol_print (yyoutput, yytype, yyvaluep)
  896. FILE *yyoutput;
  897. int yytype;
  898. YYSTYPE const * const yyvaluep;
  899. #endif
  900. {
  901. if (yytype < YYNTOKENS)
  902. YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
  903. else
  904. YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
  905. yy_symbol_value_print (yyoutput, yytype, yyvaluep);
  906. YYFPRINTF (yyoutput, ")");
  907. }
  908. /*------------------------------------------------------------------.
  909. | yy_stack_print -- Print the state stack from its BOTTOM up to its |
  910. | TOP (included). |
  911. `------------------------------------------------------------------*/
  912. #if (defined __STDC__ || defined __C99__FUNC__ \
  913. || defined __cplusplus || defined _MSC_VER)
  914. static void
  915. yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
  916. #else
  917. static void
  918. yy_stack_print (bottom, top)
  919. yytype_int16 *bottom;
  920. yytype_int16 *top;
  921. #endif
  922. {
  923. YYFPRINTF (stderr, "Stack now");
  924. for (; bottom <= top; ++bottom)
  925. YYFPRINTF (stderr, " %d", *bottom);
  926. YYFPRINTF (stderr, "\n");
  927. }
  928. # define YY_STACK_PRINT(Bottom, Top) \
  929. do { \
  930. if (yydebug) \
  931. yy_stack_print ((Bottom), (Top)); \
  932. } while (YYID (0))
  933. /*------------------------------------------------.
  934. | Report that the YYRULE is going to be reduced. |
  935. `------------------------------------------------*/
  936. #if (defined __STDC__ || defined __C99__FUNC__ \
  937. || defined __cplusplus || defined _MSC_VER)
  938. static void
  939. yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
  940. #else
  941. static void
  942. yy_reduce_print (yyvsp, yyrule)
  943. YYSTYPE *yyvsp;
  944. int yyrule;
  945. #endif
  946. {
  947. int yynrhs = yyr2[yyrule];
  948. int yyi;
  949. unsigned long int yylno = yyrline[yyrule];
  950. YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
  951. yyrule - 1, yylno);
  952. /* The symbols being reduced. */
  953. for (yyi = 0; yyi < yynrhs; yyi++)
  954. {
  955. fprintf (stderr, " $%d = ", yyi + 1);
  956. yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
  957. &(yyvsp[(yyi + 1) - (yynrhs)])
  958. );
  959. fprintf (stderr, "\n");
  960. }
  961. }
  962. # define YY_REDUCE_PRINT(Rule) \
  963. do { \
  964. if (yydebug) \
  965. yy_reduce_print (yyvsp, Rule); \
  966. } while (YYID (0))
  967. /* Nonzero means print parse trace. It is left uninitialized so that
  968. multiple parsers can coexist. */
  969. int yydebug;
  970. #else /* !YYDEBUG */
  971. # define YYDPRINTF(Args)
  972. # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
  973. # define YY_STACK_PRINT(Bottom, Top)
  974. # define YY_REDUCE_PRINT(Rule)
  975. #endif /* !YYDEBUG */
  976. /* YYINITDEPTH -- initial size of the parser's stacks. */
  977. #ifndef YYINITDEPTH
  978. # define YYINITDEPTH 200
  979. #endif
  980. /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
  981. if the built-in stack extension method is used).
  982. Do not make this value too large; the results are undefined if
  983. YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
  984. evaluated with infinite-precision integer arithmetic. */
  985. #ifndef YYMAXDEPTH
  986. # define YYMAXDEPTH 10000
  987. #endif
  988. #if YYERROR_VERBOSE
  989. # ifndef yystrlen
  990. # if defined __GLIBC__ && defined _STRING_H
  991. # define yystrlen strlen
  992. # else
  993. /* Return the length of YYSTR. */
  994. #if (defined __STDC__ || defined __C99__FUNC__ \
  995. || defined __cplusplus || defined _MSC_VER)
  996. static YYSIZE_T
  997. yystrlen (const char *yystr)
  998. #else
  999. static YYSIZE_T
  1000. yystrlen (yystr)
  1001. const char *yystr;
  1002. #endif
  1003. {
  1004. YYSIZE_T yylen;
  1005. for (yylen = 0; yystr[yylen]; yylen++)
  1006. continue;
  1007. return yylen;
  1008. }
  1009. # endif
  1010. # endif
  1011. # ifndef yystpcpy
  1012. # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
  1013. # define yystpcpy stpcpy
  1014. # else
  1015. /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
  1016. YYDEST. */
  1017. #if (defined __STDC__ || defined __C99__FUNC__ \
  1018. || defined __cplusplus || defined _MSC_VER)
  1019. static char *
  1020. yystpcpy (char *yydest, const char *yysrc)
  1021. #else
  1022. static char *
  1023. yystpcpy (yydest, yysrc)
  1024. char *yydest;
  1025. const char *yysrc;
  1026. #endif
  1027. {
  1028. char *yyd = yydest;
  1029. const char *yys = yysrc;
  1030. while ((*yyd++ = *yys++) != '\0')
  1031. continue;
  1032. return yyd - 1;
  1033. }
  1034. # endif
  1035. # endif
  1036. # ifndef yytnamerr
  1037. /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
  1038. quotes and backslashes, so that it's suitable for yyerror. The
  1039. heuristic is that double-quoting is unnecessary unless the string
  1040. contains an apostrophe, a comma, or backslash (other than
  1041. backslash-backslash). YYSTR is taken from yytname. If YYRES is
  1042. null, do not copy; instead, return the length of what the result
  1043. would have been. */
  1044. static YYSIZE_T
  1045. yytnamerr (char *yyres, const char *yystr)
  1046. {
  1047. if (*yystr == '"')
  1048. {
  1049. YYSIZE_T yyn = 0;
  1050. char const *yyp = yystr;
  1051. for (;;)
  1052. switch (*++yyp)
  1053. {
  1054. case '\'':
  1055. case ',':
  1056. goto do_not_strip_quotes;
  1057. case '\\':
  1058. if (*++yyp != '\\')
  1059. goto do_not_strip_quotes;
  1060. /* Fall through. */
  1061. default:
  1062. if (yyres)
  1063. yyres[yyn] = *yyp;
  1064. yyn++;
  1065. break;
  1066. case '"':
  1067. if (yyres)
  1068. yyres[yyn] = '\0';
  1069. return yyn;
  1070. }
  1071. do_not_strip_quotes: ;
  1072. }
  1073. if (! yyres)
  1074. return yystrlen (yystr);
  1075. return yystpcpy (yyres, yystr) - yyres;
  1076. }
  1077. # endif
  1078. /* Copy into YYRESULT an error message about the unexpected token
  1079. YYCHAR while in state YYSTATE. Return the number of bytes copied,
  1080. including the terminating null byte. If YYRESULT is null, do not
  1081. copy anything; just return the number of bytes that would be
  1082. copied. As a special case, return 0 if an ordinary "syntax error"
  1083. message will do. Return YYSIZE_MAXIMUM if overflow occurs during
  1084. size calculation. */
  1085. static YYSIZE_T
  1086. yysyntax_error (char *yyresult, int yystate, int yychar)
  1087. {
  1088. int yyn = yypact[yystate];
  1089. if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
  1090. return 0;
  1091. else
  1092. {
  1093. int yytype = YYTRANSLATE (yychar);
  1094. YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
  1095. YYSIZE_T yysize = yysize0;
  1096. YYSIZE_T yysize1;
  1097. int yysize_overflow = 0;
  1098. enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
  1099. char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
  1100. int yyx;
  1101. # if 0
  1102. /* This is so xgettext sees the translatable formats that are
  1103. constructed on the fly. */
  1104. YY_("syntax error, unexpected %s");
  1105. YY_("syntax error, unexpected %s, expecting %s");
  1106. YY_("syntax error, unexpected %s, expecting %s or %s");
  1107. YY_("syntax error, unexpected %s, expecting %s or %s or %s");
  1108. YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
  1109. # endif
  1110. char *yyfmt;
  1111. char const *yyf;
  1112. static char const yyunexpected[] = "syntax error, unexpected %s";
  1113. static char const yyexpecting[] = ", expecting %s";
  1114. static char const yyor[] = " or %s";
  1115. char yyformat[sizeof yyunexpected
  1116. + sizeof yyexpecting - 1
  1117. + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
  1118. * (sizeof yyor - 1))];
  1119. char const *yyprefix = yyexpecting;
  1120. /* Start YYX at -YYN if negative to avoid negative indexes in
  1121. YYCHECK. */
  1122. int yyxbegin = yyn < 0 ? -yyn : 0;
  1123. /* Stay within bounds of both yycheck and yytname. */
  1124. int yychecklim = YYLAST - yyn + 1;
  1125. int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
  1126. int yycount = 1;
  1127. yyarg[0] = yytname[yytype];
  1128. yyfmt = yystpcpy (yyformat, yyunexpected);
  1129. for (yyx = yyxbegin; yyx < yyxend; ++yyx)
  1130. if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
  1131. {
  1132. if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
  1133. {
  1134. yycount = 1;
  1135. yysize = yysize0;
  1136. yyformat[sizeof yyunexpected - 1] = '\0';
  1137. break;
  1138. }
  1139. yyarg[yycount++] = yytname[yyx];
  1140. yysize1 = yysize + yytnamerr (0, yytname[yyx]);
  1141. yysize_overflow |= (yysize1 < yysize);
  1142. yysize = yysize1;
  1143. yyfmt = yystpcpy (yyfmt, yyprefix);
  1144. yyprefix = yyor;
  1145. }
  1146. yyf = YY_(yyformat);
  1147. yysize1 = yysize + yystrlen (yyf);
  1148. yysize_overflow |= (yysize1 < yysize);
  1149. yysize = yysize1;
  1150. if (yysize_overflow)
  1151. return YYSIZE_MAXIMUM;
  1152. if (yyresult)
  1153. {
  1154. /* Avoid sprintf, as that infringes on the user's name space.
  1155. Don't have undefined behavior even if the translation
  1156. produced a string with the wrong number of "%s"s. */
  1157. char *yyp = yyresult;
  1158. int yyi = 0;
  1159. while ((*yyp = *yyf) != '\0')
  1160. {
  1161. if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
  1162. {
  1163. yyp += yytnamerr (yyp, yyarg[yyi++]);
  1164. yyf += 2;
  1165. }
  1166. else
  1167. {
  1168. yyp++;
  1169. yyf++;
  1170. }
  1171. }
  1172. }
  1173. return yysize;
  1174. }
  1175. }
  1176. #endif /* YYERROR_VERBOSE */
  1177. /*-----------------------------------------------.
  1178. | Release the memory associated to this symbol. |
  1179. `-----------------------------------------------*/
  1180. /*ARGSUSED*/
  1181. #if (defined __STDC__ || defined __C99__FUNC__ \
  1182. || defined __cplusplus || defined _MSC_VER)
  1183. static void
  1184. yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
  1185. #else
  1186. static void
  1187. yydestruct (yymsg, yytype, yyvaluep)
  1188. const char *yymsg;
  1189. int yytype;
  1190. YYSTYPE *yyvaluep;
  1191. #endif
  1192. {
  1193. YYUSE (yyvaluep);
  1194. if (!yymsg)
  1195. yymsg = "Deleting";
  1196. YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
  1197. switch (yytype)
  1198. {
  1199. default:
  1200. break;
  1201. }
  1202. }
  1203. /* Prevent warnings from -Wmissing-prototypes. */
  1204. #ifdef YYPARSE_PARAM
  1205. #if defined __STDC__ || defined __cplusplus
  1206. int yyparse (void *YYPARSE_PARAM);
  1207. #else
  1208. int yyparse ();
  1209. #endif
  1210. #else /* ! YYPARSE_PARAM */
  1211. #if defined __STDC__ || defined __cplusplus
  1212. int yyparse (void);
  1213. #else
  1214. int yyparse ();
  1215. #endif
  1216. #endif /* ! YYPARSE_PARAM */
  1217. /* The look-ahead symbol. */
  1218. int yychar;
  1219. /* The semantic value of the look-ahead symbol. */
  1220. YYSTYPE yylval;
  1221. /* Number of syntax errors so far. */
  1222. int yynerrs;
  1223. /*----------.
  1224. | yyparse. |
  1225. `----------*/
  1226. #ifdef YYPARSE_PARAM
  1227. #if (defined __STDC__ || defined __C99__FUNC__ \
  1228. || defined __cplusplus || defined _MSC_VER)
  1229. int
  1230. yyparse (void *YYPARSE_PARAM)
  1231. #else
  1232. int
  1233. yyparse (YYPARSE_PARAM)
  1234. void *YYPARSE_PARAM;
  1235. #endif
  1236. #else /* ! YYPARSE_PARAM */
  1237. #if (defined __STDC__ || defined __C99__FUNC__ \
  1238. || defined __cplusplus || defined _MSC_VER)
  1239. int
  1240. yyparse (void)
  1241. #else
  1242. int
  1243. yyparse ()
  1244. #endif
  1245. #endif
  1246. {
  1247. int yystate;
  1248. int yyn;
  1249. int yyresult;
  1250. /* Number of tokens to shift before error messages enabled. */
  1251. int yyerrstatus;
  1252. /* Look-ahead token as an internal (translated) token number. */
  1253. int yytoken = 0;
  1254. #if YYERROR_VERBOSE
  1255. /* Buffer for error messages, and its allocated size. */
  1256. char yymsgbuf[128];
  1257. char *yymsg = yymsgbuf;
  1258. YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
  1259. #endif
  1260. /* Three stacks and their tools:
  1261. `yyss': related to states,
  1262. `yyvs': related to semantic values,
  1263. `yyls': related to locations.
  1264. Refer to the stacks thru separate pointers, to allow yyoverflow
  1265. to reallocate them elsewhere. */
  1266. /* The state stack. */
  1267. yytype_int16 yyssa[YYINITDEPTH];
  1268. yytype_int16 *yyss = yyssa;
  1269. yytype_int16 *yyssp;
  1270. /* The semantic value stack. */
  1271. YYSTYPE yyvsa[YYINITDEPTH];
  1272. YYSTYPE *yyvs = yyvsa;
  1273. YYSTYPE *yyvsp;
  1274. #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
  1275. YYSIZE_T yystacksize = YYINITDEPTH;
  1276. /* The variables used to return semantic value and location from the
  1277. action routines. */
  1278. YYSTYPE yyval;
  1279. /* The number of symbols on the RHS of the reduced rule.
  1280. Keep to zero when no symbol should be popped. */
  1281. int yylen = 0;
  1282. YYDPRINTF ((stderr, "Starting parse\n"));
  1283. yystate = 0;
  1284. yyerrstatus = 0;
  1285. yynerrs = 0;
  1286. yychar = YYEMPTY; /* Cause a token to be read. */
  1287. /* Initialize stack pointers.
  1288. Waste one element of value and location stack
  1289. so that they stay on the same level as the state stack.
  1290. The wasted elements are never initialized. */
  1291. yyssp = yyss;
  1292. yyvsp = yyvs;
  1293. goto yysetstate;
  1294. /*------------------------------------------------------------.
  1295. | yynewstate -- Push a new state, which is found in yystate. |
  1296. `------------------------------------------------------------*/
  1297. yynewstate:
  1298. /* In all cases, when you get here, the value and location stacks
  1299. have just been pushed. So pushing a state here evens the stacks. */
  1300. yyssp++;
  1301. yysetstate:
  1302. *yyssp = yystate;
  1303. if (yyss + yystacksize - 1 <= yyssp)
  1304. {
  1305. /* Get the current used size of the three stacks, in elements. */
  1306. YYSIZE_T yysize = yyssp - yyss + 1;
  1307. #ifdef yyoverflow
  1308. {
  1309. /* Give user a chance to reallocate the stack. Use copies of
  1310. these so that the &'s don't force the real ones into
  1311. memory. */
  1312. YYSTYPE *yyvs1 = yyvs;
  1313. yytype_int16 *yyss1 = yyss;
  1314. /* Each stack pointer address is followed by the size of the
  1315. data in use in that stack, in bytes. This used to be a
  1316. conditional around just the two extra args, but that might
  1317. be undefined if yyoverflow is a macro. */
  1318. yyoverflow (YY_("memory exhausted"),
  1319. &yyss1, yysize * sizeof (*yyssp),
  1320. &yyvs1, yysize * sizeof (*yyvsp),
  1321. &yystacksize);
  1322. yyss = yyss1;
  1323. yyvs = yyvs1;
  1324. }
  1325. #else /* no yyoverflow */
  1326. # ifndef YYSTACK_RELOCATE
  1327. goto yyexhaustedlab;
  1328. # else
  1329. /* Extend the stack our own way. */
  1330. if (YYMAXDEPTH <= yystacksize)
  1331. goto yyexhaustedlab;
  1332. yystacksize *= 2;
  1333. if (YYMAXDEPTH < yystacksize)
  1334. yystacksize = YYMAXDEPTH;
  1335. {
  1336. yytype_int16 *yyss1 = yyss;
  1337. union yyalloc *yyptr =
  1338. (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
  1339. if (! yyptr)
  1340. goto yyexhaustedlab;
  1341. YYSTACK_RELOCATE (yyss);
  1342. YYSTACK_RELOCATE (yyvs);
  1343. # undef YYSTACK_RELOCATE
  1344. if (yyss1 != yyssa)
  1345. YYSTACK_FREE (yyss1);
  1346. }
  1347. # endif
  1348. #endif /* no yyoverflow */
  1349. yyssp = yyss + yysize - 1;
  1350. yyvsp = yyvs + yysize - 1;
  1351. YYDPRINTF ((stderr, "Stack size increased to %lu\n",
  1352. (unsigned long int) yystacksize));
  1353. if (yyss + yystacksize - 1 <= yyssp)
  1354. YYABORT;
  1355. }
  1356. YYDPRINTF ((stderr, "Entering state %d\n", yystate));
  1357. goto yybackup;
  1358. /*-----------.
  1359. | yybackup. |
  1360. `-----------*/
  1361. yybackup:
  1362. /* Do appropriate processing given the current state. Read a
  1363. look-ahead token if we need one and don't already have one. */
  1364. /* First try to decide what to do without reference to look-ahead token. */
  1365. yyn = yypact[yystate];
  1366. if (yyn == YYPACT_NINF)
  1367. goto yydefault;
  1368. /* Not known => get a look-ahead token if don't already have one. */
  1369. /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
  1370. if (yychar == YYEMPTY)
  1371. {
  1372. YYDPRINTF ((stderr, "Reading a token: "));
  1373. yychar = YYLEX;
  1374. }
  1375. if (yychar <= YYEOF)
  1376. {
  1377. yychar = yytoken = YYEOF;
  1378. YYDPRINTF ((stderr, "Now at end of input.\n"));
  1379. }
  1380. else
  1381. {
  1382. yytoken = YYTRANSLATE (yychar);
  1383. YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
  1384. }
  1385. /* If the proper action on seeing token YYTOKEN is to reduce or to
  1386. detect an error, take that action. */
  1387. yyn += yytoken;
  1388. if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
  1389. goto yydefault;
  1390. yyn = yytable[yyn];
  1391. if (yyn <= 0)
  1392. {
  1393. if (yyn == 0 || yyn == YYTABLE_NINF)
  1394. goto yyerrlab;
  1395. yyn = -yyn;
  1396. goto yyreduce;
  1397. }
  1398. if (yyn == YYFINAL)
  1399. YYACCEPT;
  1400. /* Count tokens shifted since error; after three, turn off error
  1401. status. */
  1402. if (yyerrstatus)
  1403. yyerrstatus--;
  1404. /* Shift the look-ahead token. */
  1405. YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
  1406. /* Discard the shifted token unless it is eof. */
  1407. if (yychar != YYEOF)
  1408. yychar = YYEMPTY;
  1409. yystate = yyn;
  1410. *++yyvsp = yylval;
  1411. goto yynewstate;
  1412. /*-----------------------------------------------------------.
  1413. | yydefault -- do the default action for the current state. |
  1414. `-----------------------------------------------------------*/
  1415. yydefault:
  1416. yyn = yydefact[yystate];
  1417. if (yyn == 0)
  1418. goto yyerrlab;
  1419. goto yyreduce;
  1420. /*-----------------------------.
  1421. | yyreduce -- Do a reduction. |
  1422. `-----------------------------*/
  1423. yyreduce:
  1424. /* yyn is the number of a rule to reduce with. */
  1425. yylen = yyr2[yyn];
  1426. /* If YYLEN is nonzero, implement the default value of the action:
  1427. `$$ = $1'.
  1428. Otherwise, the following line sets YYVAL to garbage.
  1429. This behavior is undocumented and Bison
  1430. users should not rely upon it. Assigning to YYVAL
  1431. unconditionally makes the parser a bit smaller, and it avoids a
  1432. GCC warning that YYVAL may be used uninitialized. */
  1433. yyval = yyvsp[1-yylen];
  1434. YY_REDUCE_PRINT (yyn);
  1435. switch (yyn)
  1436. {
  1437. case 3:
  1438. #line 75 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1439. {
  1440. ;}
  1441. break;
  1442. case 5:
  1443. #line 79 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1444. {
  1445. yyerrok;
  1446. ;}
  1447. break;
  1448. case 7:
  1449. #line 84 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1450. {
  1451. g_parse->error("`;' missing after definition");
  1452. ;}
  1453. break;
  1454. case 8:
  1455. #line 88 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1456. {
  1457. ;}
  1458. break;
  1459. case 9:
  1460. #line 96 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1461. {
  1462. assert((yyvsp[(1) - (1)]) == 0 || NamespacePtr::dynamicCast((yyvsp[(1) - (1)])));
  1463. ;}
  1464. break;
  1465. case 10:
  1466. #line 100 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1467. {
  1468. assert((yyvsp[(1) - (1)]) == 0 || InterfacePtr::dynamicCast((yyvsp[(1) - (1)])));
  1469. ;}
  1470. break;
  1471. case 11:
  1472. #line 104 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1473. {
  1474. assert((yyvsp[(1) - (1)]) == 0 || StructPtr::dynamicCast((yyvsp[(1) - (1)])));
  1475. ;}
  1476. break;
  1477. case 12:
  1478. #line 108 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1479. {
  1480. ;}
  1481. break;
  1482. case 13:
  1483. #line 111 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1484. {
  1485. assert((yyvsp[(1) - (1)]) == 0 || EnumPtr::dynamicCast((yyvsp[(1) - (1)])));
  1486. ;}
  1487. break;
  1488. case 14:
  1489. #line 115 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1490. {
  1491. assert((yyvsp[(1) - (1)]) == 0 || ConstPtr::dynamicCast((yyvsp[(1) - (1)])));
  1492. ;}
  1493. break;
  1494. case 15:
  1495. #line 124 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1496. {
  1497. (yyval) = (yyvsp[(1) - (1)]);
  1498. ;}
  1499. break;
  1500. case 16:
  1501. #line 128 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1502. {
  1503. if((yyvsp[(3) - (5)]))
  1504. {
  1505. g_parse->popContainer();
  1506. (yyval) = (yyvsp[(3) - (5)]);
  1507. }
  1508. else
  1509. {
  1510. (yyval) = 0;
  1511. }
  1512. (yyval) = (yyvsp[(2) - (5)]);
  1513. ;}
  1514. break;
  1515. case 17:
  1516. #line 147 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1517. {
  1518. NamespacePtr c = NamespacePtr::dynamicCast(g_parse->currentContainer());
  1519. if(!c)
  1520. {
  1521. g_parse->error("enum must define in namespace");
  1522. }
  1523. StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(2) - (2)]));
  1524. EnumPtr e = c->createEnum(ident->v);
  1525. g_parse->pushContainer(e);
  1526. (yyval) = e;
  1527. ;}
  1528. break;
  1529. case 18:
  1530. #line 160 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1531. {
  1532. StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(2) - (2)]));
  1533. g_parse->error("keyword `" + ident->v + "' cannot be used as enumeration name");
  1534. (yyval) = (yyvsp[(2) - (2)]);
  1535. ;}
  1536. break;
  1537. case 19:
  1538. #line 171 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1539. {
  1540. (yyval) = (yyvsp[(2) - (3)]);
  1541. ;}
  1542. break;
  1543. case 20:
  1544. #line 175 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1545. {
  1546. ;}
  1547. break;
  1548. case 21:
  1549. #line 183 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1550. {
  1551. TypePtr type = TypePtr::dynamicCast(g_parse->createBuiltin(Builtin::KindLong));
  1552. StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(1) - (1)]));
  1553. TypeIdPtr tPtr = new TypeId(type, ident->v);
  1554. tPtr->disableDefault();
  1555. EnumPtr e = EnumPtr::dynamicCast(g_parse->currentContainer());
  1556. assert(e);
  1557. e->addMember(tPtr);
  1558. (yyval) = e;
  1559. ;}
  1560. break;
  1561. case 22:
  1562. #line 194 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1563. {
  1564. StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(1) - (1)]));
  1565. g_parse->error("keyword `" + ident->v + "' cannot be used as enumerator");
  1566. ;}
  1567. break;
  1568. case 23:
  1569. #line 199 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1570. {
  1571. TypePtr type = TypePtr::dynamicCast(g_parse->createBuiltin(Builtin::KindLong));
  1572. StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(1) - (3)]));
  1573. TypeIdPtr tPtr = new TypeId(type, ident->v);
  1574. ConstGrammarPtr sPtr = ConstGrammarPtr::dynamicCast((yyvsp[(3) - (3)]));
  1575. g_parse->checkConstValue(tPtr, sPtr->t);
  1576. tPtr->setDefault(sPtr->v);
  1577. EnumPtr e = EnumPtr::dynamicCast(g_parse->currentContainer());
  1578. assert(e);
  1579. e->addMember(tPtr);
  1580. (yyval) = e;
  1581. ;}
  1582. break;
  1583. case 24:
  1584. #line 212 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1585. {
  1586. ;}
  1587. break;
  1588. case 25:
  1589. #line 220 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1590. {
  1591. StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(2) - (2)]));
  1592. ContainerPtr c = g_parse->currentContainer();
  1593. NamespacePtr n = c->createNamespace(ident->v);
  1594. if(n)
  1595. {
  1596. g_parse->pushContainer(n);
  1597. (yyval) = GrammarBasePtr::dynamicCast(n);
  1598. }
  1599. else
  1600. {
  1601. (yyval) = 0;
  1602. }
  1603. ;}
  1604. break;
  1605. case 26:
  1606. #line 235 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1607. {
  1608. if((yyvsp[(3) - (6)]))
  1609. {
  1610. g_parse->popContainer();
  1611. (yyval) = (yyvsp[(3) - (6)]);
  1612. }
  1613. else
  1614. {
  1615. (yyval) = 0;
  1616. }
  1617. ;}
  1618. break;
  1619. case 27:
  1620. #line 253 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1621. {
  1622. StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(3) - (4)]));
  1623. StructPtr sp = StructPtr::dynamicCast(g_parse->findUserType(ident->v));
  1624. if(!sp)
  1625. {
  1626. g_parse->error("struct '" + ident->v + "' undefined!");
  1627. }
  1628. g_parse->setKeyStruct(sp);
  1629. ;}
  1630. break;
  1631. case 28:
  1632. #line 264 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1633. {
  1634. ;}
  1635. break;
  1636. case 29:
  1637. #line 272 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1638. {
  1639. StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(1) - (1)]));
  1640. StructPtr np = g_parse->getKeyStruct();
  1641. if(np)
  1642. {
  1643. np->addKey(ident->v);
  1644. }
  1645. else
  1646. {
  1647. (yyval) = 0;
  1648. }
  1649. ;}
  1650. break;
  1651. case 30:
  1652. #line 285 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1653. {
  1654. StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(3) - (3)]));
  1655. StructPtr np = g_parse->getKeyStruct();
  1656. if(np)
  1657. {
  1658. np->addKey(ident->v);
  1659. }
  1660. else
  1661. {
  1662. (yyval) = 0;
  1663. }
  1664. ;}
  1665. break;
  1666. case 31:
  1667. #line 304 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1668. {
  1669. StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(1) - (1)]));
  1670. NamespacePtr c = NamespacePtr::dynamicCast(g_parse->currentContainer());
  1671. InterfacePtr cl = c->createInterface(ident->v);
  1672. if(cl)
  1673. {
  1674. g_parse->pushContainer(cl);
  1675. (yyval) = GrammarBasePtr::dynamicCast(cl);
  1676. }
  1677. else
  1678. {
  1679. (yyval) = 0;
  1680. }
  1681. ;}
  1682. break;
  1683. case 32:
  1684. #line 321 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1685. {
  1686. if((yyvsp[(2) - (5)]))
  1687. {
  1688. g_parse->popContainer();
  1689. (yyval) = GrammarBasePtr::dynamicCast((yyvsp[(2) - (5)]));
  1690. }
  1691. else
  1692. {
  1693. (yyval) = 0;
  1694. }
  1695. ;}
  1696. break;
  1697. case 33:
  1698. #line 338 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1699. {
  1700. (yyval) = (yyvsp[(2) - (2)]);
  1701. ;}
  1702. break;
  1703. case 34:
  1704. #line 342 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1705. {
  1706. StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(2) - (2)]));
  1707. g_parse->error("keyword `" + ident->v + "' cannot be used as interface name");
  1708. (yyval) = (yyvsp[(2) - (2)]);
  1709. ;}
  1710. break;
  1711. case 35:
  1712. #line 353 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1713. {
  1714. ;}
  1715. break;
  1716. case 36:
  1717. #line 356 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1718. {
  1719. ;}
  1720. break;
  1721. case 37:
  1722. #line 359 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1723. {
  1724. g_parse->error("`;' missing after definition");
  1725. ;}
  1726. break;
  1727. case 38:
  1728. #line 363 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1729. {
  1730. ;}
  1731. break;
  1732. case 40:
  1733. #line 377 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1734. {
  1735. if((yyvsp[(1) - (3)]))
  1736. {
  1737. g_parse->popContainer();
  1738. (yyval) = GrammarBasePtr::dynamicCast((yyvsp[(1) - (3)]));
  1739. }
  1740. else
  1741. {
  1742. (yyval) = 0;
  1743. }
  1744. ;}
  1745. break;
  1746. case 41:
  1747. #line 394 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1748. {
  1749. TypePtr returnType = TypePtr::dynamicCast((yyvsp[(1) - (2)]));
  1750. StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(2) - (2)]));
  1751. string name = ident->v;
  1752. InterfacePtr cl = InterfacePtr::dynamicCast(g_parse->currentContainer());
  1753. if(cl)
  1754. {
  1755. OperationPtr op = cl->createOperation(name, returnType);
  1756. if(op)
  1757. {
  1758. g_parse->pushContainer(op);
  1759. (yyval) = GrammarBasePtr::dynamicCast(op);
  1760. }
  1761. else
  1762. {
  1763. (yyval) = 0;
  1764. }
  1765. }
  1766. else
  1767. {
  1768. (yyval) = 0;
  1769. }
  1770. ;}
  1771. break;
  1772. case 43:
  1773. #line 424 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1774. {
  1775. (yyval) = 0;
  1776. ;}
  1777. break;
  1778. case 44:
  1779. #line 434 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1780. {
  1781. ;}
  1782. break;
  1783. case 45:
  1784. #line 437 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1785. {
  1786. TypeIdPtr tsp = TypeIdPtr::dynamicCast((yyvsp[(1) - (1)]));
  1787. OperationPtr op = OperationPtr::dynamicCast(g_parse->currentContainer());
  1788. assert(op);
  1789. if(op)
  1790. {
  1791. op->createParamDecl(tsp, false, false);
  1792. }
  1793. ;}
  1794. break;
  1795. case 46:
  1796. #line 448 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1797. {
  1798. TypeIdPtr tsp = TypeIdPtr::dynamicCast((yyvsp[(3) - (3)]));
  1799. OperationPtr op = OperationPtr::dynamicCast(g_parse->currentContainer());
  1800. assert(op);
  1801. if(op)
  1802. {
  1803. op->createParamDecl(tsp, false, false);
  1804. }
  1805. ;}
  1806. break;
  1807. case 47:
  1808. #line 459 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1809. {
  1810. BoolGrammarPtr isOutParam = BoolGrammarPtr::dynamicCast((yyvsp[(1) - (2)]));
  1811. TypeIdPtr tsp = TypeIdPtr::dynamicCast((yyvsp[(2) - (2)]));
  1812. OperationPtr op = OperationPtr::dynamicCast(g_parse->currentContainer());
  1813. assert(op);
  1814. if(op)
  1815. {
  1816. op->createParamDecl(tsp, isOutParam->v, false);
  1817. }
  1818. ;}
  1819. break;
  1820. case 48:
  1821. #line 471 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1822. {
  1823. BoolGrammarPtr isOutParam = BoolGrammarPtr::dynamicCast((yyvsp[(3) - (4)]));
  1824. TypeIdPtr tsp = TypeIdPtr::dynamicCast((yyvsp[(4) - (4)]));
  1825. OperationPtr op = OperationPtr::dynamicCast(g_parse->currentContainer());
  1826. assert(op);
  1827. if(op)
  1828. {
  1829. op->createParamDecl(tsp, isOutParam->v, false);
  1830. }
  1831. ;}
  1832. break;
  1833. case 49:
  1834. #line 483 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1835. {
  1836. BoolGrammarPtr isRouteKeyParam = BoolGrammarPtr::dynamicCast((yyvsp[(1) - (2)]));
  1837. TypeIdPtr tsp = TypeIdPtr::dynamicCast((yyvsp[(2) - (2)]));
  1838. OperationPtr op = OperationPtr::dynamicCast(g_parse->currentContainer());
  1839. assert(op);
  1840. if(op)
  1841. {
  1842. op->createParamDecl(tsp, false, isRouteKeyParam->v);
  1843. }
  1844. ;}
  1845. break;
  1846. case 50:
  1847. #line 495 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1848. {
  1849. BoolGrammarPtr isRouteKeyParam = BoolGrammarPtr::dynamicCast((yyvsp[(3) - (4)]));
  1850. TypeIdPtr tsp = TypeIdPtr::dynamicCast((yyvsp[(4) - (4)]));
  1851. OperationPtr op = OperationPtr::dynamicCast(g_parse->currentContainer());
  1852. assert(op);
  1853. if(op)
  1854. {
  1855. op->createParamDecl(tsp, false, isRouteKeyParam->v);
  1856. }
  1857. ;}
  1858. break;
  1859. case 51:
  1860. #line 507 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1861. {
  1862. g_parse->error("'out' must be defined with a type");
  1863. ;}
  1864. break;
  1865. case 52:
  1866. #line 511 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1867. {
  1868. g_parse->error("'routekey' must be defined with a type");
  1869. ;}
  1870. break;
  1871. case 53:
  1872. #line 520 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1873. {
  1874. BoolGrammarPtr routekey = new BoolGrammar;
  1875. routekey->v = true;
  1876. (yyval) = GrammarBasePtr::dynamicCast(routekey);
  1877. ;}
  1878. break;
  1879. case 54:
  1880. #line 531 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1881. {
  1882. BoolGrammarPtr out = new BoolGrammar;
  1883. out->v = true;
  1884. (yyval) = GrammarBasePtr::dynamicCast(out);
  1885. ;}
  1886. break;
  1887. case 55:
  1888. #line 542 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1889. {
  1890. StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(1) - (1)]));
  1891. NamespacePtr np = NamespacePtr::dynamicCast(g_parse->currentContainer());
  1892. if(np)
  1893. {
  1894. StructPtr sp = np->createStruct(ident->v);
  1895. if(sp)
  1896. {
  1897. g_parse->pushContainer(sp);
  1898. (yyval) = GrammarBasePtr::dynamicCast(sp);
  1899. }
  1900. else
  1901. {
  1902. (yyval) = 0;
  1903. }
  1904. }
  1905. else
  1906. {
  1907. g_parse->error("struct '" + ident->v + "' must definition in namespace");
  1908. }
  1909. ;}
  1910. break;
  1911. case 56:
  1912. #line 564 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1913. {
  1914. if((yyvsp[(2) - (5)]))
  1915. {
  1916. g_parse->popContainer();
  1917. }
  1918. (yyval) = (yyvsp[(2) - (5)]);
  1919. StructPtr st = StructPtr::dynamicCast((yyval));
  1920. assert(st);
  1921. if(st->getAllMemberPtr().size() == 0)
  1922. {
  1923. g_parse->error("struct `" + st->getSid() + "' must have at least one member");
  1924. }
  1925. ;}
  1926. break;
  1927. case 57:
  1928. #line 584 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1929. {
  1930. (yyval) = (yyvsp[(2) - (2)]);
  1931. ;}
  1932. break;
  1933. case 58:
  1934. #line 588 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1935. {
  1936. StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(2) - (2)]));
  1937. g_parse->error("keyword `" + ident->v + "' cannot be used as struct name");
  1938. ;}
  1939. break;
  1940. case 59:
  1941. #line 594 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1942. {
  1943. g_parse->error("abstract declarator '<anonymous struct>' used as declaration");
  1944. ;}
  1945. break;
  1946. case 60:
  1947. #line 603 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1948. {
  1949. ;}
  1950. break;
  1951. case 61:
  1952. #line 607 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1953. {
  1954. g_parse->error("';' missing after definition");
  1955. ;}
  1956. break;
  1957. case 62:
  1958. #line 611 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1959. {
  1960. ;}
  1961. break;
  1962. case 63:
  1963. #line 621 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1964. {
  1965. (yyval) = GrammarBasePtr::dynamicCast((yyvsp[(1) - (1)]));
  1966. ;}
  1967. break;
  1968. case 64:
  1969. #line 630 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1970. {
  1971. StructPtr np = StructPtr::dynamicCast(g_parse->currentContainer());
  1972. if(np)
  1973. {
  1974. IntergerGrammarPtr iPtr = IntergerGrammarPtr::dynamicCast((yyvsp[(1) - (3)]));
  1975. g_parse->checkTag(iPtr->v);
  1976. TypeIdPtr tPtr = TypeIdPtr::dynamicCast((yyvsp[(3) - (3)]));
  1977. tPtr->setRequire(iPtr->v);
  1978. np->addTypeId(tPtr);
  1979. (yyval) = GrammarBasePtr::dynamicCast((yyvsp[(3) - (3)]));
  1980. }
  1981. else
  1982. {
  1983. (yyval) = 0;
  1984. }
  1985. ;}
  1986. break;
  1987. case 65:
  1988. #line 648 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  1989. {
  1990. StructPtr np = StructPtr::dynamicCast(g_parse->currentContainer());
  1991. if(np)
  1992. {
  1993. IntergerGrammarPtr iPtr = IntergerGrammarPtr::dynamicCast((yyvsp[(1) - (5)]));
  1994. g_parse->checkTag(iPtr->v);
  1995. TypeIdPtr tPtr = TypeIdPtr::dynamicCast((yyvsp[(3) - (5)]));
  1996. ConstGrammarPtr sPtr = ConstGrammarPtr::dynamicCast((yyvsp[(5) - (5)]));
  1997. g_parse->checkConstValue(tPtr, sPtr->t);
  1998. tPtr->setRequire(iPtr->v);
  1999. tPtr->setDefault(sPtr->v);
  2000. np->addTypeId(tPtr);
  2001. (yyval) = GrammarBasePtr::dynamicCast((yyvsp[(3) - (5)]));
  2002. }
  2003. else
  2004. {
  2005. (yyval) = 0;
  2006. }
  2007. ;}
  2008. break;
  2009. case 66:
  2010. #line 670 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2011. {
  2012. StructPtr np = StructPtr::dynamicCast(g_parse->currentContainer());
  2013. if(np)
  2014. {
  2015. IntergerGrammarPtr iPtr = IntergerGrammarPtr::dynamicCast((yyvsp[(1) - (5)]));
  2016. g_parse->checkTag(iPtr->v);
  2017. TypeIdPtr tPtr = TypeIdPtr::dynamicCast((yyvsp[(3) - (5)]));
  2018. ConstGrammarPtr sPtr = ConstGrammarPtr::dynamicCast((yyvsp[(5) - (5)]));
  2019. g_parse->checkConstValue(tPtr, sPtr->t);
  2020. tPtr->setOptional(iPtr->v);
  2021. tPtr->setDefault(sPtr->v);
  2022. np->addTypeId(tPtr);
  2023. (yyval) = GrammarBasePtr::dynamicCast((yyvsp[(3) - (5)]));
  2024. }
  2025. else
  2026. {
  2027. (yyval) = 0;
  2028. }
  2029. ;}
  2030. break;
  2031. case 67:
  2032. #line 692 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2033. {
  2034. StructPtr np = StructPtr::dynamicCast(g_parse->currentContainer());
  2035. if(np)
  2036. {
  2037. IntergerGrammarPtr iPtr = IntergerGrammarPtr::dynamicCast((yyvsp[(1) - (3)]));
  2038. g_parse->checkTag(iPtr->v);
  2039. TypeIdPtr tPtr = TypeIdPtr::dynamicCast((yyvsp[(3) - (3)]));
  2040. tPtr->setOptional(iPtr->v);
  2041. np->addTypeId(tPtr);
  2042. (yyval) = GrammarBasePtr::dynamicCast((yyvsp[(3) - (3)]));
  2043. }
  2044. else
  2045. {
  2046. (yyval) = 0;
  2047. }
  2048. ;}
  2049. break;
  2050. case 68:
  2051. #line 709 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2052. {
  2053. g_parse->error("struct member need 'tag'");
  2054. ;}
  2055. break;
  2056. case 69:
  2057. #line 713 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2058. {
  2059. g_parse->error("struct member need 'tag'");
  2060. ;}
  2061. break;
  2062. case 70:
  2063. #line 717 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2064. {
  2065. g_parse->error("struct member need 'require' or 'optional'");
  2066. ;}
  2067. break;
  2068. case 71:
  2069. #line 721 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2070. {
  2071. g_parse->error("struct member need 'tag' or 'require' or 'optional'");
  2072. ;}
  2073. break;
  2074. case 72:
  2075. #line 730 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2076. {
  2077. IntergerGrammarPtr intVal = IntergerGrammarPtr::dynamicCast((yyvsp[(1) - (1)]));
  2078. ostringstream sstr;
  2079. sstr << intVal->v;
  2080. ConstGrammarPtr c = new ConstGrammar();
  2081. c->t = ConstGrammar::VALUE;
  2082. c->v = sstr.str();
  2083. (yyval) = c;
  2084. ;}
  2085. break;
  2086. case 73:
  2087. #line 740 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2088. {
  2089. FloatGrammarPtr floatVal = FloatGrammarPtr::dynamicCast((yyvsp[(1) - (1)]));
  2090. ostringstream sstr;
  2091. sstr << floatVal->v;
  2092. ConstGrammarPtr c = new ConstGrammar();
  2093. c->t = ConstGrammar::VALUE;
  2094. c->v = sstr.str();
  2095. (yyval) = c;
  2096. ;}
  2097. break;
  2098. case 74:
  2099. #line 750 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2100. {
  2101. StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(1) - (1)]));
  2102. ConstGrammarPtr c = new ConstGrammar();
  2103. c->t = ConstGrammar::STRING;
  2104. c->v = ident->v;
  2105. (yyval) = c;
  2106. ;}
  2107. break;
  2108. case 75:
  2109. #line 758 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2110. {
  2111. StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(1) - (1)]));
  2112. ConstGrammarPtr c = new ConstGrammar();
  2113. c->t = ConstGrammar::BOOL;
  2114. c->v = ident->v;
  2115. (yyval) = c;
  2116. ;}
  2117. break;
  2118. case 76:
  2119. #line 766 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2120. {
  2121. StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(1) - (1)]));
  2122. ConstGrammarPtr c = new ConstGrammar();
  2123. c->t = ConstGrammar::BOOL;
  2124. c->v = ident->v;
  2125. (yyval) = c;
  2126. ;}
  2127. break;
  2128. case 77:
  2129. #line 774 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2130. {
  2131. StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(1) - (1)]));
  2132. if (g_parse->checkEnum(ident->v) == false)
  2133. {
  2134. g_parse->error("error enum default value, not defined yet");
  2135. }
  2136. ConstGrammarPtr c = new ConstGrammar();
  2137. c->t = ConstGrammar::ENUM;
  2138. c->v = ident->v;
  2139. (yyval) = c;
  2140. ;}
  2141. break;
  2142. case 78:
  2143. #line 787 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2144. {
  2145. StringGrammarPtr scoped = StringGrammarPtr::dynamicCast((yyvsp[(1) - (3)]));
  2146. StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(3) - (3)]));
  2147. if (g_parse->checkEnum(ident->v) == false)
  2148. {
  2149. g_parse->error("error enum default value, not defined yet");
  2150. }
  2151. ConstGrammarPtr c = new ConstGrammar();
  2152. c->t = ConstGrammar::ENUM;
  2153. c->v = scoped->v + "::" + ident->v;
  2154. (yyval) = c;
  2155. ;}
  2156. break;
  2157. case 79:
  2158. #line 807 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2159. {
  2160. NamespacePtr np = NamespacePtr::dynamicCast(g_parse->currentContainer());
  2161. if(!np)
  2162. {
  2163. g_parse->error("const type must define in namespace");
  2164. }
  2165. TypeIdPtr t = TypeIdPtr::dynamicCast((yyvsp[(2) - (4)]));
  2166. ConstGrammarPtr c = ConstGrammarPtr::dynamicCast((yyvsp[(4) - (4)]));
  2167. ConstPtr cPtr = np->createConst(t, c);
  2168. (yyval) = cPtr;
  2169. ;}
  2170. break;
  2171. case 80:
  2172. #line 825 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2173. {
  2174. TypePtr type = TypePtr::dynamicCast((yyvsp[(1) - (2)]));
  2175. StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(2) - (2)]));
  2176. TypeIdPtr typeIdPtr = new TypeId(type, ident->v);
  2177. (yyval) = GrammarBasePtr::dynamicCast(typeIdPtr);
  2178. ;}
  2179. break;
  2180. case 81:
  2181. #line 834 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2182. {
  2183. TypePtr type = g_parse->createVector(TypePtr::dynamicCast((yyvsp[(1) - (5)])));
  2184. IntergerGrammarPtr iPtrSize = IntergerGrammarPtr::dynamicCast((yyvsp[(4) - (5)]));
  2185. g_parse->checkArrayVaid(type,iPtrSize->v);
  2186. type->setArray(iPtrSize->v);
  2187. StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(2) - (5)]));
  2188. TypeIdPtr typeIdPtr = new TypeId(type, ident->v);
  2189. (yyval) = GrammarBasePtr::dynamicCast(typeIdPtr);
  2190. ;}
  2191. break;
  2192. case 82:
  2193. #line 844 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2194. {
  2195. TypePtr type = g_parse->createVector(TypePtr::dynamicCast((yyvsp[(1) - (3)])));
  2196. //IntergerGrammarPtr iPtrSize = IntergerGrammarPtr::dynamicCast($4);
  2197. g_parse->checkPointerVaid(type);
  2198. type->setPointer(true);
  2199. StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(3) - (3)]));
  2200. TypeIdPtr typeIdPtr = new TypeId(type, ident->v);
  2201. (yyval) = GrammarBasePtr::dynamicCast(typeIdPtr);
  2202. ;}
  2203. break;
  2204. case 83:
  2205. #line 854 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2206. {
  2207. TypePtr type = TypePtr::dynamicCast((yyvsp[(1) - (4)]));
  2208. StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(2) - (4)]));
  2209. TypeIdPtr typeIdPtr = new TypeId(type, ident->v);
  2210. IntergerGrammarPtr iPtrSize = IntergerGrammarPtr::dynamicCast((yyvsp[(3) - (4)]));
  2211. g_parse->checkArrayVaid(type,iPtrSize->v);
  2212. (yyval) = GrammarBasePtr::dynamicCast(typeIdPtr);
  2213. ;}
  2214. break;
  2215. case 84:
  2216. #line 863 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2217. {
  2218. StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(2) - (2)]));
  2219. g_parse->error("keyword `" + ident->v + "' cannot be used as data member name");
  2220. ;}
  2221. break;
  2222. case 85:
  2223. #line 868 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2224. {
  2225. g_parse->error("missing data member name");
  2226. ;}
  2227. break;
  2228. case 86:
  2229. #line 872 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2230. {
  2231. g_parse->error("unkown type");
  2232. ;}
  2233. break;
  2234. case 87:
  2235. #line 881 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2236. {
  2237. TypePtr type = TypePtr::dynamicCast((yyvsp[(1) - (3)]));
  2238. IntergerGrammarPtr iPtrSize = IntergerGrammarPtr::dynamicCast((yyvsp[(3) - (3)]));
  2239. g_parse->checkArrayVaid(type,iPtrSize->v);
  2240. type->setArray(iPtrSize->v);
  2241. (yyval) = type;
  2242. ;}
  2243. break;
  2244. case 88:
  2245. #line 890 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2246. {
  2247. (yyval) = (yyvsp[(1) - (1)]);
  2248. ;}
  2249. break;
  2250. case 89:
  2251. #line 894 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2252. {
  2253. g_parse->error("array missing size");
  2254. ;}
  2255. break;
  2256. case 90:
  2257. #line 903 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2258. {
  2259. (yyval) = g_parse->createBuiltin(Builtin::KindBool);
  2260. ;}
  2261. break;
  2262. case 91:
  2263. #line 907 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2264. {
  2265. (yyval) = g_parse->createBuiltin(Builtin::KindByte);
  2266. ;}
  2267. break;
  2268. case 92:
  2269. #line 911 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2270. {
  2271. (yyval) = g_parse->createBuiltin(Builtin::KindShort,true);
  2272. ;}
  2273. break;
  2274. case 93:
  2275. #line 915 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2276. {
  2277. (yyval) = g_parse->createBuiltin(Builtin::KindShort);
  2278. ;}
  2279. break;
  2280. case 94:
  2281. #line 919 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2282. {
  2283. (yyval) = g_parse->createBuiltin(Builtin::KindInt,true);
  2284. ;}
  2285. break;
  2286. case 95:
  2287. #line 923 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2288. {
  2289. (yyval) = g_parse->createBuiltin(Builtin::KindInt);
  2290. ;}
  2291. break;
  2292. case 96:
  2293. #line 927 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2294. {
  2295. (yyval) = g_parse->createBuiltin(Builtin::KindLong,true);
  2296. ;}
  2297. break;
  2298. case 97:
  2299. #line 931 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2300. {
  2301. (yyval) = g_parse->createBuiltin(Builtin::KindLong);
  2302. ;}
  2303. break;
  2304. case 98:
  2305. #line 935 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2306. {
  2307. (yyval) = g_parse->createBuiltin(Builtin::KindFloat);
  2308. ;}
  2309. break;
  2310. case 99:
  2311. #line 939 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2312. {
  2313. (yyval) = g_parse->createBuiltin(Builtin::KindDouble);
  2314. ;}
  2315. break;
  2316. case 100:
  2317. #line 943 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2318. {
  2319. (yyval) = g_parse->createBuiltin(Builtin::KindString);
  2320. ;}
  2321. break;
  2322. case 101:
  2323. #line 947 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2324. {
  2325. (yyval) = GrammarBasePtr::dynamicCast((yyvsp[(1) - (1)]));
  2326. ;}
  2327. break;
  2328. case 102:
  2329. #line 951 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2330. {
  2331. (yyval) = GrammarBasePtr::dynamicCast((yyvsp[(1) - (1)]));
  2332. ;}
  2333. break;
  2334. case 103:
  2335. #line 955 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2336. {
  2337. StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(1) - (1)]));
  2338. TypePtr sp = g_parse->findUserType(ident->v);
  2339. if(sp)
  2340. {
  2341. (yyval) = GrammarBasePtr::dynamicCast(sp);
  2342. }
  2343. else
  2344. {
  2345. g_parse->error("'" + ident->v + "' undefined!");
  2346. }
  2347. ;}
  2348. break;
  2349. case 104:
  2350. #line 973 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2351. {
  2352. (yyval) = GrammarBasePtr::dynamicCast(g_parse->createVector(TypePtr::dynamicCast((yyvsp[(3) - (4)]))));
  2353. ;}
  2354. break;
  2355. case 105:
  2356. #line 977 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2357. {
  2358. g_parse->error("vector error");
  2359. ;}
  2360. break;
  2361. case 106:
  2362. #line 981 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2363. {
  2364. g_parse->error("vector missing '>'");
  2365. ;}
  2366. break;
  2367. case 107:
  2368. #line 985 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2369. {
  2370. g_parse->error("vector missing type");
  2371. ;}
  2372. break;
  2373. case 108:
  2374. #line 994 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2375. {
  2376. (yyval) = GrammarBasePtr::dynamicCast(g_parse->createMap(TypePtr::dynamicCast((yyvsp[(3) - (6)])), TypePtr::dynamicCast((yyvsp[(5) - (6)]))));
  2377. ;}
  2378. break;
  2379. case 109:
  2380. #line 998 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2381. {
  2382. g_parse->error("map error");
  2383. ;}
  2384. break;
  2385. case 110:
  2386. #line 1007 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2387. {
  2388. ;}
  2389. break;
  2390. case 111:
  2391. #line 1010 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2392. {
  2393. StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(2) - (2)]));
  2394. ident->v = "::" + ident->v;
  2395. (yyval) = GrammarBasePtr::dynamicCast(ident);
  2396. ;}
  2397. break;
  2398. case 112:
  2399. #line 1016 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2400. {
  2401. StringGrammarPtr scoped = StringGrammarPtr::dynamicCast((yyvsp[(1) - (3)]));
  2402. StringGrammarPtr ident = StringGrammarPtr::dynamicCast((yyvsp[(3) - (3)]));
  2403. scoped->v += "::";
  2404. scoped->v += ident->v;
  2405. (yyval) = GrammarBasePtr::dynamicCast(scoped);
  2406. ;}
  2407. break;
  2408. case 113:
  2409. #line 1029 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2410. {
  2411. ;}
  2412. break;
  2413. case 114:
  2414. #line 1032 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2415. {
  2416. ;}
  2417. break;
  2418. case 115:
  2419. #line 1035 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2420. {
  2421. ;}
  2422. break;
  2423. case 116:
  2424. #line 1038 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2425. {
  2426. ;}
  2427. break;
  2428. case 117:
  2429. #line 1041 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2430. {
  2431. ;}
  2432. break;
  2433. case 118:
  2434. #line 1044 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2435. {
  2436. ;}
  2437. break;
  2438. case 119:
  2439. #line 1047 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2440. {
  2441. ;}
  2442. break;
  2443. case 120:
  2444. #line 1050 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2445. {
  2446. ;}
  2447. break;
  2448. case 121:
  2449. #line 1053 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2450. {
  2451. ;}
  2452. break;
  2453. case 122:
  2454. #line 1056 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2455. {
  2456. ;}
  2457. break;
  2458. case 123:
  2459. #line 1059 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2460. {
  2461. ;}
  2462. break;
  2463. case 124:
  2464. #line 1062 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2465. {
  2466. ;}
  2467. break;
  2468. case 125:
  2469. #line 1065 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2470. {
  2471. ;}
  2472. break;
  2473. case 126:
  2474. #line 1068 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2475. {
  2476. ;}
  2477. break;
  2478. case 127:
  2479. #line 1071 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2480. {
  2481. ;}
  2482. break;
  2483. case 128:
  2484. #line 1074 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2485. {
  2486. ;}
  2487. break;
  2488. case 129:
  2489. #line 1077 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2490. {
  2491. ;}
  2492. break;
  2493. case 130:
  2494. #line 1080 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2495. {
  2496. ;}
  2497. break;
  2498. case 131:
  2499. #line 1083 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2500. {
  2501. ;}
  2502. break;
  2503. case 132:
  2504. #line 1086 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2505. {
  2506. ;}
  2507. break;
  2508. case 133:
  2509. #line 1089 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2510. {
  2511. ;}
  2512. break;
  2513. case 134:
  2514. #line 1092 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2515. {
  2516. ;}
  2517. break;
  2518. case 135:
  2519. #line 1095 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2520. {
  2521. ;}
  2522. break;
  2523. case 136:
  2524. #line 1098 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2525. {
  2526. ;}
  2527. break;
  2528. case 137:
  2529. #line 1101 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"
  2530. {
  2531. ;}
  2532. break;
  2533. /* Line 1267 of yacc.c. */
  2534. #line 2907 "tars.tab.cpp"
  2535. default: break;
  2536. }
  2537. YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
  2538. YYPOPSTACK (yylen);
  2539. yylen = 0;
  2540. YY_STACK_PRINT (yyss, yyssp);
  2541. *++yyvsp = yyval;
  2542. /* Now `shift' the result of the reduction. Determine what state
  2543. that goes to, based on the state we popped back to and the rule
  2544. number reduced by. */
  2545. yyn = yyr1[yyn];
  2546. yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
  2547. if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
  2548. yystate = yytable[yystate];
  2549. else
  2550. yystate = yydefgoto[yyn - YYNTOKENS];
  2551. goto yynewstate;
  2552. /*------------------------------------.
  2553. | yyerrlab -- here on detecting error |
  2554. `------------------------------------*/
  2555. yyerrlab:
  2556. /* If not already recovering from an error, report this error. */
  2557. if (!yyerrstatus)
  2558. {
  2559. ++yynerrs;
  2560. #if ! YYERROR_VERBOSE
  2561. yyerror (YY_("syntax error"));
  2562. #else
  2563. {
  2564. YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
  2565. if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
  2566. {
  2567. YYSIZE_T yyalloc = 2 * yysize;
  2568. if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
  2569. yyalloc = YYSTACK_ALLOC_MAXIMUM;
  2570. if (yymsg != yymsgbuf)
  2571. YYSTACK_FREE (yymsg);
  2572. yymsg = (char *) YYSTACK_ALLOC (yyalloc);
  2573. if (yymsg)
  2574. yymsg_alloc = yyalloc;
  2575. else
  2576. {
  2577. yymsg = yymsgbuf;
  2578. yymsg_alloc = sizeof yymsgbuf;
  2579. }
  2580. }
  2581. if (0 < yysize && yysize <= yymsg_alloc)
  2582. {
  2583. (void) yysyntax_error (yymsg, yystate, yychar);
  2584. yyerror (yymsg);
  2585. }
  2586. else
  2587. {
  2588. yyerror (YY_("syntax error"));
  2589. if (yysize != 0)
  2590. goto yyexhaustedlab;
  2591. }
  2592. }
  2593. #endif
  2594. }
  2595. if (yyerrstatus == 3)
  2596. {
  2597. /* If just tried and failed to reuse look-ahead token after an
  2598. error, discard it. */
  2599. if (yychar <= YYEOF)
  2600. {
  2601. /* Return failure if at end of input. */
  2602. if (yychar == YYEOF)
  2603. YYABORT;
  2604. }
  2605. else
  2606. {
  2607. yydestruct ("Error: discarding",
  2608. yytoken, &yylval);
  2609. yychar = YYEMPTY;
  2610. }
  2611. }
  2612. /* Else will try to reuse look-ahead token after shifting the error
  2613. token. */
  2614. goto yyerrlab1;
  2615. /*---------------------------------------------------.
  2616. | yyerrorlab -- error raised explicitly by YYERROR. |
  2617. `---------------------------------------------------*/
  2618. yyerrorlab:
  2619. /* Pacify compilers like GCC when the user code never invokes
  2620. YYERROR and the label yyerrorlab therefore never appears in user
  2621. code. */
  2622. if (/*CONSTCOND*/ 0)
  2623. goto yyerrorlab;
  2624. /* Do not reclaim the symbols of the rule which action triggered
  2625. this YYERROR. */
  2626. YYPOPSTACK (yylen);
  2627. yylen = 0;
  2628. YY_STACK_PRINT (yyss, yyssp);
  2629. yystate = *yyssp;
  2630. goto yyerrlab1;
  2631. /*-------------------------------------------------------------.
  2632. | yyerrlab1 -- common code for both syntax error and YYERROR. |
  2633. `-------------------------------------------------------------*/
  2634. yyerrlab1:
  2635. yyerrstatus = 3; /* Each real token shifted decrements this. */
  2636. for (;;)
  2637. {
  2638. yyn = yypact[yystate];
  2639. if (yyn != YYPACT_NINF)
  2640. {
  2641. yyn += YYTERROR;
  2642. if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
  2643. {
  2644. yyn = yytable[yyn];
  2645. if (0 < yyn)
  2646. break;
  2647. }
  2648. }
  2649. /* Pop the current state because it cannot handle the error token. */
  2650. if (yyssp == yyss)
  2651. YYABORT;
  2652. yydestruct ("Error: popping",
  2653. yystos[yystate], yyvsp);
  2654. YYPOPSTACK (1);
  2655. yystate = *yyssp;
  2656. YY_STACK_PRINT (yyss, yyssp);
  2657. }
  2658. if (yyn == YYFINAL)
  2659. YYACCEPT;
  2660. *++yyvsp = yylval;
  2661. /* Shift the error token. */
  2662. YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
  2663. yystate = yyn;
  2664. goto yynewstate;
  2665. /*-------------------------------------.
  2666. | yyacceptlab -- YYACCEPT comes here. |
  2667. `-------------------------------------*/
  2668. yyacceptlab:
  2669. yyresult = 0;
  2670. goto yyreturn;
  2671. /*-----------------------------------.
  2672. | yyabortlab -- YYABORT comes here. |
  2673. `-----------------------------------*/
  2674. yyabortlab:
  2675. yyresult = 1;
  2676. goto yyreturn;
  2677. #ifndef yyoverflow
  2678. /*-------------------------------------------------.
  2679. | yyexhaustedlab -- memory exhaustion comes here. |
  2680. `-------------------------------------------------*/
  2681. yyexhaustedlab:
  2682. yyerror (YY_("memory exhausted"));
  2683. yyresult = 2;
  2684. /* Fall through. */
  2685. #endif
  2686. yyreturn:
  2687. if (yychar != YYEOF && yychar != YYEMPTY)
  2688. yydestruct ("Cleanup: discarding lookahead",
  2689. yytoken, &yylval);
  2690. /* Do not reclaim the symbols of the rule which action triggered
  2691. this YYABORT or YYACCEPT. */
  2692. YYPOPSTACK (yylen);
  2693. YY_STACK_PRINT (yyss, yyssp);
  2694. while (yyssp != yyss)
  2695. {
  2696. yydestruct ("Cleanup: popping",
  2697. yystos[*yyssp], yyvsp);
  2698. YYPOPSTACK (1);
  2699. }
  2700. #ifndef yyoverflow
  2701. if (yyss != yyssa)
  2702. YYSTACK_FREE (yyss);
  2703. #endif
  2704. #if YYERROR_VERBOSE
  2705. if (yymsg != yymsgbuf)
  2706. YYSTACK_FREE (yymsg);
  2707. #endif
  2708. /* Make sure YYID is used. */
  2709. return YYID (yyresult);
  2710. }
  2711. #line 1105 "/Volumes/MyData/centos/Tars/framework/tarscpp/tools/tarsgrammar/tars.y"