tars.tab.cpp 96 KB

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