dcParser.cxx.prebuilt 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439
  1. /* A Bison parser, made from dcParser.yxx
  2. by GNU Bison version 1.28 */
  3. #define YYBISON 1 /* Identify Bison output. */
  4. #define yyparse dcyyparse
  5. #define yylex dcyylex
  6. #define yyerror dcyyerror
  7. #define yylval dcyylval
  8. #define yychar dcyychar
  9. #define yydebug dcyydebug
  10. #define yynerrs dcyynerrs
  11. #define INTEGER 257
  12. #define REAL 258
  13. #define STRING 259
  14. #define HEX_STRING 260
  15. #define IDENTIFIER 261
  16. #define KW_DCLASS 262
  17. #define KW_INT8 263
  18. #define KW_INT16 264
  19. #define KW_INT32 265
  20. #define KW_INT64 266
  21. #define KW_UINT8 267
  22. #define KW_UINT16 268
  23. #define KW_UINT32 269
  24. #define KW_UINT64 270
  25. #define KW_FLOAT64 271
  26. #define KW_STRING 272
  27. #define KW_BLOB 273
  28. #define KW_INT8ARRAY 274
  29. #define KW_INT16ARRAY 275
  30. #define KW_INT32ARRAY 276
  31. #define KW_UINT8ARRAY 277
  32. #define KW_UINT16ARRAY 278
  33. #define KW_UINT32ARRAY 279
  34. #define KW_UINT32UINT8ARRAY 280
  35. #define KW_MOL 281
  36. #define KW_REQUIRED 282
  37. #define KW_BROADCAST 283
  38. #define KW_P2P 284
  39. #define KW_RAM 285
  40. #define KW_DB 286
  41. #define KW_CLSEND 287
  42. #define KW_CLRECV 288
  43. #define KW_OWNSEND 289
  44. #line 6 "dcParser.yxx"
  45. #include "dcLexerDefs.h"
  46. #include "dcParserDefs.h"
  47. #include "dcFile.h"
  48. #include "dcClass.h"
  49. #include "dcAtomicField.h"
  50. #include "dcMolecularField.h"
  51. // Because our token type contains objects of type string, which
  52. // require correct copy construction (and not simply memcpying), we
  53. // cannot use bison's built-in auto-stack-grow feature. As an easy
  54. // solution, we ensure here that we have enough yacc stack to start
  55. // with, and that it doesn't ever try to grow.
  56. #define YYINITDEPTH 1000
  57. #define YYMAXDEPTH 1000
  58. static DCFile *dc_file = (DCFile *)NULL;
  59. static DCClass *current_class = (DCClass *)NULL;
  60. static DCAtomicField *current_atomic = (DCAtomicField *)NULL;
  61. static DCMolecularField *current_molecular = (DCMolecularField *)NULL;
  62. static DCAtomicField::ElementType atomic_element;
  63. ////////////////////////////////////////////////////////////////////
  64. // Defining the interface to the parser.
  65. ////////////////////////////////////////////////////////////////////
  66. void
  67. dc_init_parser(istream &in, const string &filename, DCFile &file) {
  68. dc_file = &file;
  69. dc_init_lexer(in, filename);
  70. }
  71. void
  72. dc_cleanup_parser() {
  73. dc_file = (DCFile *)NULL;
  74. }
  75. #include <stdio.h>
  76. #ifndef __cplusplus
  77. #ifndef __STDC__
  78. #define const
  79. #endif
  80. #endif
  81. #define YYFINAL 101
  82. #define YYFLAG -32768
  83. #define YYNTBASE 46
  84. #define YYTRANSLATE(x) ((unsigned)(x) <= 289 ? yytranslate[x] : 71)
  85. static const char yytranslate[] = { 0,
  86. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  87. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  88. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  89. 2, 2, 2, 2, 2, 2, 2, 2, 2, 41,
  90. 42, 45, 2, 40, 2, 2, 43, 2, 2, 2,
  91. 2, 2, 2, 2, 2, 2, 2, 39, 36, 2,
  92. 44, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  93. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  94. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  95. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  96. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  97. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  98. 2, 2, 37, 2, 38, 2, 2, 2, 2, 2,
  99. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  100. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  101. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  102. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  103. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  104. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  105. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  106. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  107. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  108. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  109. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  110. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  111. 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
  112. 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
  113. 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
  114. 27, 28, 29, 30, 31, 32, 33, 34, 35
  115. };
  116. #if YYDEBUG != 0
  117. static const short yyprhs[] = { 0,
  118. 0, 2, 5, 8, 9, 17, 19, 21, 24, 26,
  119. 30, 32, 35, 38, 41, 42, 49, 51, 53, 55,
  120. 57, 61, 62, 66, 68, 72, 75, 79, 83, 87,
  121. 91, 97, 99, 102, 104, 106, 108, 112, 114, 116,
  122. 118, 120, 124, 128, 132, 134, 136, 138, 140, 142,
  123. 144, 146, 148, 150, 152, 154, 156, 158, 160, 162,
  124. 164, 166, 168, 170, 173, 176, 179, 182, 185, 188,
  125. 191, 194, 195, 200, 202, 206
  126. };
  127. static const short yyrhs[] = { 70,
  128. 0, 46, 36, 0, 46, 47, 0, 0, 8, 7,
  129. 48, 50, 37, 52, 38, 0, 7, 0, 70, 0,
  130. 39, 51, 0, 49, 0, 51, 40, 49, 0, 70,
  131. 0, 52, 36, 0, 52, 53, 0, 52, 67, 0,
  132. 0, 7, 41, 54, 56, 42, 66, 0, 7, 0,
  133. 70, 0, 57, 0, 58, 0, 57, 40, 58, 0,
  134. 0, 65, 59, 60, 0, 70, 0, 60, 43, 3,
  135. 0, 60, 7, 0, 60, 44, 3, 0, 60, 44,
  136. 4, 0, 60, 44, 5, 0, 60, 44, 6, 0,
  137. 60, 44, 37, 61, 38, 0, 70, 0, 63, 62,
  138. 0, 70, 0, 40, 0, 64, 0, 63, 40, 64,
  139. 0, 3, 0, 4, 0, 5, 0, 6, 0, 3,
  140. 45, 3, 0, 4, 45, 3, 0, 6, 45, 3,
  141. 0, 9, 0, 10, 0, 11, 0, 12, 0, 13,
  142. 0, 14, 0, 15, 0, 16, 0, 17, 0, 18,
  143. 0, 19, 0, 20, 0, 21, 0, 22, 0, 23,
  144. 0, 24, 0, 25, 0, 26, 0, 70, 0, 66,
  145. 28, 0, 66, 29, 0, 66, 30, 0, 66, 31,
  146. 0, 66, 32, 0, 66, 33, 0, 66, 34, 0,
  147. 66, 35, 0, 0, 7, 39, 68, 69, 0, 55,
  148. 0, 69, 40, 55, 0, 0
  149. };
  150. #endif
  151. #if YYDEBUG != 0
  152. static const short yyrline[] = { 0,
  153. 87, 89, 90, 93, 102, 105, 119, 121, 124, 131,
  154. 139, 141, 142, 143, 146, 155, 158, 174, 176, 179,
  155. 181, 184, 191, 196, 198, 202, 206, 212, 218, 224,
  156. 230, 240, 242, 245, 247, 250, 252, 255, 262, 268,
  157. 274, 280, 289, 298, 309, 314, 318, 322, 326, 330,
  158. 334, 338, 342, 346, 350, 354, 358, 362, 366, 370,
  159. 374, 378, 384, 386, 390, 394, 398, 402, 406, 410,
  160. 414, 420, 430, 432, 439, 452
  161. };
  162. #endif
  163. #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
  164. static const char * const yytname[] = { "$","error","$undefined.","INTEGER",
  165. "REAL","STRING","HEX_STRING","IDENTIFIER","KW_DCLASS","KW_INT8","KW_INT16","KW_INT32",
  166. "KW_INT64","KW_UINT8","KW_UINT16","KW_UINT32","KW_UINT64","KW_FLOAT64","KW_STRING",
  167. "KW_BLOB","KW_INT8ARRAY","KW_INT16ARRAY","KW_INT32ARRAY","KW_UINT8ARRAY","KW_UINT16ARRAY",
  168. "KW_UINT32ARRAY","KW_UINT32UINT8ARRAY","KW_MOL","KW_REQUIRED","KW_BROADCAST",
  169. "KW_P2P","KW_RAM","KW_DB","KW_CLSEND","KW_CLRECV","KW_OWNSEND","';'","'{'","'}'",
  170. "':'","','","'('","')'","'/'","'='","'*'","dc","dclass","@1","dclass_name","dclass_derivation",
  171. "base_list","dclass_fields","atomic_field","@2","atomic_name","parameter_list",
  172. "nonempty_parameter_list","atomic_element","@3","atomic_element_definition",
  173. "default_array","maybe_comma","default_array_def","default_array_element","type_token",
  174. "atomic_flags","molecular_field","@4","molecular_atom_list","empty", NULL
  175. };
  176. #endif
  177. static const short yyr1[] = { 0,
  178. 46, 46, 46, 48, 47, 49, 50, 50, 51, 51,
  179. 52, 52, 52, 52, 54, 53, 55, 56, 56, 57,
  180. 57, 59, 58, 60, 60, 60, 60, 60, 60, 60,
  181. 60, 61, 61, 62, 62, 63, 63, 64, 64, 64,
  182. 64, 64, 64, 64, 65, 65, 65, 65, 65, 65,
  183. 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
  184. 65, 65, 66, 66, 66, 66, 66, 66, 66, 66,
  185. 66, 68, 67, 69, 69, 70
  186. };
  187. static const short yyr2[] = { 0,
  188. 1, 2, 2, 0, 7, 1, 1, 2, 1, 3,
  189. 1, 2, 2, 2, 0, 6, 1, 1, 1, 1,
  190. 3, 0, 3, 1, 3, 2, 3, 3, 3, 3,
  191. 5, 1, 2, 1, 1, 1, 3, 1, 1, 1,
  192. 1, 3, 3, 3, 1, 1, 1, 1, 1, 1,
  193. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  194. 1, 1, 1, 2, 2, 2, 2, 2, 2, 2,
  195. 2, 0, 4, 1, 3, 0
  196. };
  197. static const short yydefact[] = { 76,
  198. 0, 1, 0, 2, 3, 4, 76, 0, 0, 7,
  199. 6, 9, 8, 76, 0, 0, 11, 10, 0, 12,
  200. 5, 13, 14, 72, 15, 0, 76, 17, 74, 73,
  201. 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
  202. 55, 56, 57, 58, 59, 60, 61, 62, 0, 19,
  203. 20, 22, 18, 0, 76, 0, 76, 75, 16, 63,
  204. 21, 23, 24, 64, 65, 66, 67, 68, 69, 70,
  205. 71, 26, 0, 0, 25, 27, 28, 29, 30, 76,
  206. 38, 39, 40, 41, 0, 76, 36, 32, 0, 0,
  207. 0, 31, 35, 33, 34, 42, 43, 44, 37, 0,
  208. 0
  209. };
  210. static const short yydefgoto[] = { 1,
  211. 5, 7, 12, 9, 13, 16, 22, 27, 29, 49,
  212. 50, 51, 57, 62, 85, 94, 86, 87, 52, 59,
  213. 23, 26, 30, 2
  214. };
  215. static const short yypact[] = {-32768,
  216. 3,-32768, -2,-32768,-32768,-32768, -31, 2, -27,-32768,
  217. -32768,-32768, -19,-32768, 2, -5,-32768,-32768, -35,-32768,
  218. -32768,-32768,-32768,-32768,-32768, 15, 42,-32768,-32768, -17,
  219. -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  220. -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -18, -15,
  221. -32768,-32768,-32768, 15,-32768, 42,-32768,-32768, 52,-32768,
  222. -32768, -6,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  223. -32768,-32768, 23, 9,-32768,-32768,-32768,-32768,-32768, 13,
  224. -16, -13,-32768, -11, -10, -4,-32768,-32768, 24, 27,
  225. 32,-32768, 13,-32768,-32768,-32768,-32768,-32768,-32768, 40,
  226. -32768
  227. };
  228. static const short yypgoto[] = {-32768,
  229. -32768,-32768, 26,-32768,-32768,-32768,-32768,-32768, -12,-32768,
  230. -32768, -9,-32768,-32768,-32768,-32768,-32768, -50,-32768,-32768,
  231. -32768,-32768,-32768, -7
  232. };
  233. #define YYLAST 87
  234. static const short yytable[] = { 10,
  235. 72, 19, 100, 24, 6, 25, 17, 8, 11, 14,
  236. 3, 76, 77, 78, 79, 81, 82, 83, 84, 53,
  237. 15, 28, 54, 55, 56, 75, 96, 92, 89, 97,
  238. 20, 90, 21, 91, 98, 93, 73, 74, 4, 101,
  239. 18, 58, 99, 0, 0, 80, 61, 60, 0, 63,
  240. 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
  241. 41, 42, 43, 44, 45, 46, 47, 48, 0, 0,
  242. 0, 0, 88, 0, 0, 0, 0, 0, 95, 64,
  243. 65, 66, 67, 68, 69, 70, 71
  244. };
  245. static const short yycheck[] = { 7,
  246. 7, 7, 0, 39, 7, 41, 14, 39, 7, 37,
  247. 8, 3, 4, 5, 6, 3, 4, 5, 6, 27,
  248. 40, 7, 40, 42, 40, 3, 3, 38, 45, 3,
  249. 36, 45, 38, 45, 3, 40, 43, 44, 36, 0,
  250. 15, 54, 93, -1, -1, 37, 56, 55, -1, 57,
  251. 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
  252. 19, 20, 21, 22, 23, 24, 25, 26, -1, -1,
  253. -1, -1, 80, -1, -1, -1, -1, -1, 86, 28,
  254. 29, 30, 31, 32, 33, 34, 35
  255. };
  256. /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
  257. #line 3 "/usr/share/bison.simple"
  258. /* This file comes from bison-1.28. */
  259. /* Skeleton output parser for bison,
  260. Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
  261. This program is free software; you can redistribute it and/or modify
  262. it under the terms of the GNU General Public License as published by
  263. the Free Software Foundation; either version 2, or (at your option)
  264. any later version.
  265. This program is distributed in the hope that it will be useful,
  266. but WITHOUT ANY WARRANTY; without even the implied warranty of
  267. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  268. GNU General Public License for more details.
  269. You should have received a copy of the GNU General Public License
  270. along with this program; if not, write to the Free Software
  271. Foundation, Inc., 59 Temple Place - Suite 330,
  272. Boston, MA 02111-1307, USA. */
  273. /* As a special exception, when this file is copied by Bison into a
  274. Bison output file, you may use that output file without restriction.
  275. This special exception was added by the Free Software Foundation
  276. in version 1.24 of Bison. */
  277. /* This is the parser code that is written into each bison parser
  278. when the %semantic_parser declaration is not specified in the grammar.
  279. It was written by Richard Stallman by simplifying the hairy parser
  280. used when %semantic_parser is specified. */
  281. #ifndef YYSTACK_USE_ALLOCA
  282. #ifdef alloca
  283. #define YYSTACK_USE_ALLOCA
  284. #else /* alloca not defined */
  285. #ifdef __GNUC__
  286. #define YYSTACK_USE_ALLOCA
  287. #define alloca __builtin_alloca
  288. #else /* not GNU C. */
  289. #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
  290. #define YYSTACK_USE_ALLOCA
  291. #include <alloca.h>
  292. #else /* not sparc */
  293. /* We think this test detects Watcom and Microsoft C. */
  294. /* This used to test MSDOS, but that is a bad idea
  295. since that symbol is in the user namespace. */
  296. #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
  297. #if 0 /* No need for malloc.h, which pollutes the namespace;
  298. instead, just don't use alloca. */
  299. #include <malloc.h>
  300. #endif
  301. #else /* not MSDOS, or __TURBOC__ */
  302. #if defined(_AIX)
  303. /* I don't know what this was needed for, but it pollutes the namespace.
  304. So I turned it off. rms, 2 May 1997. */
  305. /* #include <malloc.h> */
  306. #pragma alloca
  307. #define YYSTACK_USE_ALLOCA
  308. #else /* not MSDOS, or __TURBOC__, or _AIX */
  309. #if 0
  310. #ifdef __hpux /* [email protected] says this works for HPUX 9.05 and up,
  311. and on HPUX 10. Eventually we can turn this on. */
  312. #define YYSTACK_USE_ALLOCA
  313. #define alloca __builtin_alloca
  314. #endif /* __hpux */
  315. #endif
  316. #endif /* not _AIX */
  317. #endif /* not MSDOS, or __TURBOC__ */
  318. #endif /* not sparc */
  319. #endif /* not GNU C */
  320. #endif /* alloca not defined */
  321. #endif /* YYSTACK_USE_ALLOCA not defined */
  322. #ifdef YYSTACK_USE_ALLOCA
  323. #define YYSTACK_ALLOC alloca
  324. #else
  325. #define YYSTACK_ALLOC malloc
  326. #endif
  327. /* Note: there must be only one dollar sign in this file.
  328. It is replaced by the list of actions, each action
  329. as one case of the switch. */
  330. #define yyerrok (yyerrstatus = 0)
  331. #define yyclearin (yychar = YYEMPTY)
  332. #define YYEMPTY -2
  333. #define YYEOF 0
  334. #define YYACCEPT goto yyacceptlab
  335. #define YYABORT goto yyabortlab
  336. #define YYERROR goto yyerrlab1
  337. /* Like YYERROR except do call yyerror.
  338. This remains here temporarily to ease the
  339. transition to the new meaning of YYERROR, for GCC.
  340. Once GCC version 2 has supplanted version 1, this can go. */
  341. #define YYFAIL goto yyerrlab
  342. #define YYRECOVERING() (!!yyerrstatus)
  343. #define YYBACKUP(token, value) \
  344. do \
  345. if (yychar == YYEMPTY && yylen == 1) \
  346. { yychar = (token), yylval = (value); \
  347. yychar1 = YYTRANSLATE (yychar); \
  348. YYPOPSTACK; \
  349. goto yybackup; \
  350. } \
  351. else \
  352. { yyerror ("syntax error: cannot back up"); YYERROR; } \
  353. while (0)
  354. #define YYTERROR 1
  355. #define YYERRCODE 256
  356. #ifndef YYPURE
  357. #define YYLEX yylex()
  358. #endif
  359. #ifdef YYPURE
  360. #ifdef YYLSP_NEEDED
  361. #ifdef YYLEX_PARAM
  362. #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
  363. #else
  364. #define YYLEX yylex(&yylval, &yylloc)
  365. #endif
  366. #else /* not YYLSP_NEEDED */
  367. #ifdef YYLEX_PARAM
  368. #define YYLEX yylex(&yylval, YYLEX_PARAM)
  369. #else
  370. #define YYLEX yylex(&yylval)
  371. #endif
  372. #endif /* not YYLSP_NEEDED */
  373. #endif
  374. /* If nonreentrant, generate the variables here */
  375. #ifndef YYPURE
  376. int yychar; /* the lookahead symbol */
  377. YYSTYPE yylval; /* the semantic value of the */
  378. /* lookahead symbol */
  379. #ifdef YYLSP_NEEDED
  380. YYLTYPE yylloc; /* location data for the lookahead */
  381. /* symbol */
  382. #endif
  383. int yynerrs; /* number of parse errors so far */
  384. #endif /* not YYPURE */
  385. #if YYDEBUG != 0
  386. int yydebug; /* nonzero means print parse trace */
  387. /* Since this is uninitialized, it does not stop multiple parsers
  388. from coexisting. */
  389. #endif
  390. /* YYINITDEPTH indicates the initial size of the parser's stacks */
  391. #ifndef YYINITDEPTH
  392. #define YYINITDEPTH 200
  393. #endif
  394. /* YYMAXDEPTH is the maximum size the stacks can grow to
  395. (effective only if the built-in stack extension method is used). */
  396. #if YYMAXDEPTH == 0
  397. #undef YYMAXDEPTH
  398. #endif
  399. #ifndef YYMAXDEPTH
  400. #define YYMAXDEPTH 10000
  401. #endif
  402. /* Define __yy_memcpy. Note that the size argument
  403. should be passed with type unsigned int, because that is what the non-GCC
  404. definitions require. With GCC, __builtin_memcpy takes an arg
  405. of type size_t, but it can handle unsigned int. */
  406. #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
  407. #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
  408. #else /* not GNU C or C++ */
  409. #ifndef __cplusplus
  410. /* This is the most reliable way to avoid incompatibilities
  411. in available built-in functions on various systems. */
  412. static void
  413. __yy_memcpy (to, from, count)
  414. char *to;
  415. char *from;
  416. unsigned int count;
  417. {
  418. register char *f = from;
  419. register char *t = to;
  420. register int i = count;
  421. while (i-- > 0)
  422. *t++ = *f++;
  423. }
  424. #else /* __cplusplus */
  425. /* This is the most reliable way to avoid incompatibilities
  426. in available built-in functions on various systems. */
  427. static void
  428. __yy_memcpy (char *to, char *from, unsigned int count)
  429. {
  430. register char *t = to;
  431. register char *f = from;
  432. register int i = count;
  433. while (i-- > 0)
  434. *t++ = *f++;
  435. }
  436. #endif
  437. #endif
  438. #line 217 "/usr/share/bison.simple"
  439. /* The user can define YYPARSE_PARAM as the name of an argument to be passed
  440. into yyparse. The argument should have type void *.
  441. It should actually point to an object.
  442. Grammar actions can access the variable by casting it
  443. to the proper pointer type. */
  444. #ifdef YYPARSE_PARAM
  445. #ifdef __cplusplus
  446. #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
  447. #define YYPARSE_PARAM_DECL
  448. #else /* not __cplusplus */
  449. #define YYPARSE_PARAM_ARG YYPARSE_PARAM
  450. #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
  451. #endif /* not __cplusplus */
  452. #else /* not YYPARSE_PARAM */
  453. #define YYPARSE_PARAM_ARG
  454. #define YYPARSE_PARAM_DECL
  455. #endif /* not YYPARSE_PARAM */
  456. /* Prevent warning if -Wstrict-prototypes. */
  457. #ifdef __GNUC__
  458. #ifdef YYPARSE_PARAM
  459. int yyparse (void *);
  460. #else
  461. int yyparse (void);
  462. #endif
  463. #endif
  464. int
  465. yyparse(YYPARSE_PARAM_ARG)
  466. YYPARSE_PARAM_DECL
  467. {
  468. register int yystate;
  469. register int yyn;
  470. register short *yyssp;
  471. register YYSTYPE *yyvsp;
  472. int yyerrstatus; /* number of tokens to shift before error messages enabled */
  473. int yychar1 = 0; /* lookahead token as an internal (translated) token number */
  474. short yyssa[YYINITDEPTH]; /* the state stack */
  475. YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
  476. short *yyss = yyssa; /* refer to the stacks thru separate pointers */
  477. YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
  478. #ifdef YYLSP_NEEDED
  479. YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
  480. YYLTYPE *yyls = yylsa;
  481. YYLTYPE *yylsp;
  482. #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
  483. #else
  484. #define YYPOPSTACK (yyvsp--, yyssp--)
  485. #endif
  486. int yystacksize = YYINITDEPTH;
  487. int yyfree_stacks = 0;
  488. #ifdef YYPURE
  489. int yychar;
  490. YYSTYPE yylval;
  491. int yynerrs;
  492. #ifdef YYLSP_NEEDED
  493. YYLTYPE yylloc;
  494. #endif
  495. #endif
  496. YYSTYPE yyval; /* the variable used to return */
  497. /* semantic values from the action */
  498. /* routines */
  499. int yylen;
  500. #if YYDEBUG != 0
  501. if (yydebug)
  502. fprintf(stderr, "Starting parse\n");
  503. #endif
  504. yystate = 0;
  505. yyerrstatus = 0;
  506. yynerrs = 0;
  507. yychar = YYEMPTY; /* Cause a token to be read. */
  508. /* Initialize stack pointers.
  509. Waste one element of value and location stack
  510. so that they stay on the same level as the state stack.
  511. The wasted elements are never initialized. */
  512. yyssp = yyss - 1;
  513. yyvsp = yyvs;
  514. #ifdef YYLSP_NEEDED
  515. yylsp = yyls;
  516. #endif
  517. /* Push a new state, which is found in yystate . */
  518. /* In all cases, when you get here, the value and location stacks
  519. have just been pushed. so pushing a state here evens the stacks. */
  520. yynewstate:
  521. *++yyssp = yystate;
  522. if (yyssp >= yyss + yystacksize - 1)
  523. {
  524. /* Give user a chance to reallocate the stack */
  525. /* Use copies of these so that the &'s don't force the real ones into memory. */
  526. YYSTYPE *yyvs1 = yyvs;
  527. short *yyss1 = yyss;
  528. #ifdef YYLSP_NEEDED
  529. YYLTYPE *yyls1 = yyls;
  530. #endif
  531. /* Get the current used size of the three stacks, in elements. */
  532. int size = yyssp - yyss + 1;
  533. #ifdef yyoverflow
  534. /* Each stack pointer address is followed by the size of
  535. the data in use in that stack, in bytes. */
  536. #ifdef YYLSP_NEEDED
  537. /* This used to be a conditional around just the two extra args,
  538. but that might be undefined if yyoverflow is a macro. */
  539. yyoverflow("parser stack overflow",
  540. &yyss1, size * sizeof (*yyssp),
  541. &yyvs1, size * sizeof (*yyvsp),
  542. &yyls1, size * sizeof (*yylsp),
  543. &yystacksize);
  544. #else
  545. yyoverflow("parser stack overflow",
  546. &yyss1, size * sizeof (*yyssp),
  547. &yyvs1, size * sizeof (*yyvsp),
  548. &yystacksize);
  549. #endif
  550. yyss = yyss1; yyvs = yyvs1;
  551. #ifdef YYLSP_NEEDED
  552. yyls = yyls1;
  553. #endif
  554. #else /* no yyoverflow */
  555. /* Extend the stack our own way. */
  556. if (yystacksize >= YYMAXDEPTH)
  557. {
  558. yyerror("parser stack overflow");
  559. if (yyfree_stacks)
  560. {
  561. free (yyss);
  562. free (yyvs);
  563. #ifdef YYLSP_NEEDED
  564. free (yyls);
  565. #endif
  566. }
  567. return 2;
  568. }
  569. yystacksize *= 2;
  570. if (yystacksize > YYMAXDEPTH)
  571. yystacksize = YYMAXDEPTH;
  572. #ifndef YYSTACK_USE_ALLOCA
  573. yyfree_stacks = 1;
  574. #endif
  575. yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
  576. __yy_memcpy ((char *)yyss, (char *)yyss1,
  577. size * (unsigned int) sizeof (*yyssp));
  578. yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
  579. __yy_memcpy ((char *)yyvs, (char *)yyvs1,
  580. size * (unsigned int) sizeof (*yyvsp));
  581. #ifdef YYLSP_NEEDED
  582. yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
  583. __yy_memcpy ((char *)yyls, (char *)yyls1,
  584. size * (unsigned int) sizeof (*yylsp));
  585. #endif
  586. #endif /* no yyoverflow */
  587. yyssp = yyss + size - 1;
  588. yyvsp = yyvs + size - 1;
  589. #ifdef YYLSP_NEEDED
  590. yylsp = yyls + size - 1;
  591. #endif
  592. #if YYDEBUG != 0
  593. if (yydebug)
  594. fprintf(stderr, "Stack size increased to %d\n", yystacksize);
  595. #endif
  596. if (yyssp >= yyss + yystacksize - 1)
  597. YYABORT;
  598. }
  599. #if YYDEBUG != 0
  600. if (yydebug)
  601. fprintf(stderr, "Entering state %d\n", yystate);
  602. #endif
  603. goto yybackup;
  604. yybackup:
  605. /* Do appropriate processing given the current state. */
  606. /* Read a lookahead token if we need one and don't already have one. */
  607. /* yyresume: */
  608. /* First try to decide what to do without reference to lookahead token. */
  609. yyn = yypact[yystate];
  610. if (yyn == YYFLAG)
  611. goto yydefault;
  612. /* Not known => get a lookahead token if don't already have one. */
  613. /* yychar is either YYEMPTY or YYEOF
  614. or a valid token in external form. */
  615. if (yychar == YYEMPTY)
  616. {
  617. #if YYDEBUG != 0
  618. if (yydebug)
  619. fprintf(stderr, "Reading a token: ");
  620. #endif
  621. yychar = YYLEX;
  622. }
  623. /* Convert token to internal form (in yychar1) for indexing tables with */
  624. if (yychar <= 0) /* This means end of input. */
  625. {
  626. yychar1 = 0;
  627. yychar = YYEOF; /* Don't call YYLEX any more */
  628. #if YYDEBUG != 0
  629. if (yydebug)
  630. fprintf(stderr, "Now at end of input.\n");
  631. #endif
  632. }
  633. else
  634. {
  635. yychar1 = YYTRANSLATE(yychar);
  636. #if YYDEBUG != 0
  637. if (yydebug)
  638. {
  639. fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
  640. /* Give the individual parser a way to print the precise meaning
  641. of a token, for further debugging info. */
  642. #ifdef YYPRINT
  643. YYPRINT (stderr, yychar, yylval);
  644. #endif
  645. fprintf (stderr, ")\n");
  646. }
  647. #endif
  648. }
  649. yyn += yychar1;
  650. if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
  651. goto yydefault;
  652. yyn = yytable[yyn];
  653. /* yyn is what to do for this token type in this state.
  654. Negative => reduce, -yyn is rule number.
  655. Positive => shift, yyn is new state.
  656. New state is final state => don't bother to shift,
  657. just return success.
  658. 0, or most negative number => error. */
  659. if (yyn < 0)
  660. {
  661. if (yyn == YYFLAG)
  662. goto yyerrlab;
  663. yyn = -yyn;
  664. goto yyreduce;
  665. }
  666. else if (yyn == 0)
  667. goto yyerrlab;
  668. if (yyn == YYFINAL)
  669. YYACCEPT;
  670. /* Shift the lookahead token. */
  671. #if YYDEBUG != 0
  672. if (yydebug)
  673. fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
  674. #endif
  675. /* Discard the token being shifted unless it is eof. */
  676. if (yychar != YYEOF)
  677. yychar = YYEMPTY;
  678. *++yyvsp = yylval;
  679. #ifdef YYLSP_NEEDED
  680. *++yylsp = yylloc;
  681. #endif
  682. /* count tokens shifted since error; after three, turn off error status. */
  683. if (yyerrstatus) yyerrstatus--;
  684. yystate = yyn;
  685. goto yynewstate;
  686. /* Do the default action for the current state. */
  687. yydefault:
  688. yyn = yydefact[yystate];
  689. if (yyn == 0)
  690. goto yyerrlab;
  691. /* Do a reduction. yyn is the number of a rule to reduce with. */
  692. yyreduce:
  693. yylen = yyr2[yyn];
  694. if (yylen > 0)
  695. yyval = yyvsp[1-yylen]; /* implement default value of the action */
  696. #if YYDEBUG != 0
  697. if (yydebug)
  698. {
  699. int i;
  700. fprintf (stderr, "Reducing via rule %d (line %d), ",
  701. yyn, yyrline[yyn]);
  702. /* Print the symbols being reduced, and their result. */
  703. for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
  704. fprintf (stderr, "%s ", yytname[yyrhs[i]]);
  705. fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
  706. }
  707. #endif
  708. switch (yyn) {
  709. case 4:
  710. #line 95 "dcParser.yxx"
  711. {
  712. current_class = new DCClass;
  713. current_class->_name = yyvsp[0].str;
  714. if (!dc_file->add_class(current_class)) {
  715. yyerror("Duplicate class name: " + current_class->_name);
  716. }
  717. ;
  718. break;}
  719. case 6:
  720. #line 107 "dcParser.yxx"
  721. {
  722. DCFile::ClassesByName::const_iterator ni;
  723. ni = dc_file->_classes_by_name.find(yyvsp[0].str);
  724. if (ni == dc_file->_classes_by_name.end()) {
  725. yyerror("Unknown class: " + yyvsp[0].str);
  726. yyval.u.dclass = (DCClass *)NULL;
  727. } else {
  728. yyval.u.dclass = (*ni).second;
  729. }
  730. ;
  731. break;}
  732. case 9:
  733. #line 126 "dcParser.yxx"
  734. {
  735. if (yyvsp[0].u.dclass != (DCClass *)NULL) {
  736. current_class->_parents.push_back(yyvsp[0].u.dclass);
  737. }
  738. ;
  739. break;}
  740. case 10:
  741. #line 132 "dcParser.yxx"
  742. {
  743. if (yyvsp[0].u.dclass != (DCClass *)NULL) {
  744. current_class->_parents.push_back(yyvsp[0].u.dclass);
  745. }
  746. ;
  747. break;}
  748. case 15:
  749. #line 148 "dcParser.yxx"
  750. {
  751. current_atomic = new DCAtomicField;
  752. current_atomic->_name = yyvsp[-1].str;
  753. if (!current_class->add_field(current_atomic)) {
  754. yyerror("Duplicate field name: " + current_atomic->_name);
  755. }
  756. ;
  757. break;}
  758. case 17:
  759. #line 160 "dcParser.yxx"
  760. {
  761. DCField *field = current_class->get_field_by_name(yyvsp[0].str);
  762. yyval.u.atomic = (DCAtomicField *)NULL;
  763. if (field == (DCField *)NULL) {
  764. yyerror("Unknown field: " + yyvsp[0].str);
  765. } else {
  766. yyval.u.atomic = field->as_atomic_field();
  767. if (yyval.u.atomic == (DCAtomicField *)NULL) {
  768. yyerror("Not an atomic field: " + yyvsp[0].str);
  769. }
  770. }
  771. ;
  772. break;}
  773. case 22:
  774. #line 186 "dcParser.yxx"
  775. {
  776. atomic_element = DCAtomicField::ElementType();
  777. atomic_element._type = yyvsp[0].u.subatomic;
  778. ;
  779. break;}
  780. case 23:
  781. #line 191 "dcParser.yxx"
  782. {
  783. current_atomic->_elements.push_back(atomic_element);
  784. ;
  785. break;}
  786. case 25:
  787. #line 199 "dcParser.yxx"
  788. {
  789. atomic_element._divisor = yyvsp[0].u.integer;
  790. ;
  791. break;}
  792. case 26:
  793. #line 203 "dcParser.yxx"
  794. {
  795. atomic_element._name = yyvsp[0].str;
  796. ;
  797. break;}
  798. case 27:
  799. #line 207 "dcParser.yxx"
  800. {
  801. if (!atomic_element.set_default_value(yyvsp[0].u.integer)) {
  802. yyerror("Invalid default value: " + yyvsp[0].str);
  803. }
  804. ;
  805. break;}
  806. case 28:
  807. #line 213 "dcParser.yxx"
  808. {
  809. if (!atomic_element.set_default_value(yyvsp[0].u.real)) {
  810. yyerror("Invalid default value: " + yyvsp[0].str);
  811. }
  812. ;
  813. break;}
  814. case 29:
  815. #line 219 "dcParser.yxx"
  816. {
  817. if (!atomic_element.set_default_value(yyvsp[0].str)) {
  818. yyerror("Invalid default value: \"" + yyvsp[0].str + "\"");
  819. }
  820. ;
  821. break;}
  822. case 30:
  823. #line 225 "dcParser.yxx"
  824. {
  825. if (!atomic_element.set_default_value_literal(yyvsp[0].str)) {
  826. yyerror("Invalid default hex string value");
  827. }
  828. ;
  829. break;}
  830. case 31:
  831. #line 231 "dcParser.yxx"
  832. {
  833. if (!atomic_element.end_array()) {
  834. yyerror("Array default value inappropriate");
  835. } else {
  836. atomic_element._has_default_value = true;
  837. }
  838. ;
  839. break;}
  840. case 38:
  841. #line 257 "dcParser.yxx"
  842. {
  843. if (!atomic_element.add_default_value(yyvsp[0].u.integer)) {
  844. yyerror("Invalid default value: " + yyvsp[0].str);
  845. }
  846. ;
  847. break;}
  848. case 39:
  849. #line 263 "dcParser.yxx"
  850. {
  851. if (!atomic_element.add_default_value(yyvsp[0].u.real)) {
  852. yyerror("Invalid default value: " + yyvsp[0].str);
  853. }
  854. ;
  855. break;}
  856. case 40:
  857. #line 269 "dcParser.yxx"
  858. {
  859. if (!atomic_element.add_default_value(yyvsp[0].str)) {
  860. yyerror("Invalid default value: " + yyvsp[0].str);
  861. }
  862. ;
  863. break;}
  864. case 41:
  865. #line 275 "dcParser.yxx"
  866. {
  867. if (!atomic_element.add_default_value_literal(yyvsp[0].str)) {
  868. yyerror("Invalid hex literal in default array");
  869. }
  870. ;
  871. break;}
  872. case 42:
  873. #line 281 "dcParser.yxx"
  874. {
  875. for (int i = 0; i < yyvsp[0].u.integer; i++) {
  876. if (!atomic_element.add_default_value(yyvsp[-2].u.integer)) {
  877. yyerror("Invalid default value: " + yyvsp[-2].str);
  878. break;
  879. }
  880. }
  881. ;
  882. break;}
  883. case 43:
  884. #line 290 "dcParser.yxx"
  885. {
  886. for (int i = 0; i < yyvsp[0].u.integer; i++) {
  887. if (!atomic_element.add_default_value(yyvsp[-2].u.real)) {
  888. yyerror("Invalid default value: " + yyvsp[-2].str);
  889. break;
  890. }
  891. }
  892. ;
  893. break;}
  894. case 44:
  895. #line 299 "dcParser.yxx"
  896. {
  897. for (int i = 0; i < yyvsp[0].u.integer; i++) {
  898. if (!atomic_element.add_default_value_literal(yyvsp[-2].str)) {
  899. yyerror("Invalid hex literal in default array");
  900. break;
  901. }
  902. }
  903. ;
  904. break;}
  905. case 45:
  906. #line 311 "dcParser.yxx"
  907. {
  908. yyval.u.subatomic = ST_int8;
  909. ;
  910. break;}
  911. case 46:
  912. #line 315 "dcParser.yxx"
  913. {
  914. yyval.u.subatomic = ST_int16;
  915. ;
  916. break;}
  917. case 47:
  918. #line 319 "dcParser.yxx"
  919. {
  920. yyval.u.subatomic = ST_int32;
  921. ;
  922. break;}
  923. case 48:
  924. #line 323 "dcParser.yxx"
  925. {
  926. yyval.u.subatomic = ST_int64;
  927. ;
  928. break;}
  929. case 49:
  930. #line 327 "dcParser.yxx"
  931. {
  932. yyval.u.subatomic = ST_uint8;
  933. ;
  934. break;}
  935. case 50:
  936. #line 331 "dcParser.yxx"
  937. {
  938. yyval.u.subatomic = ST_uint16;
  939. ;
  940. break;}
  941. case 51:
  942. #line 335 "dcParser.yxx"
  943. {
  944. yyval.u.subatomic = ST_uint32;
  945. ;
  946. break;}
  947. case 52:
  948. #line 339 "dcParser.yxx"
  949. {
  950. yyval.u.subatomic = ST_uint64;
  951. ;
  952. break;}
  953. case 53:
  954. #line 343 "dcParser.yxx"
  955. {
  956. yyval.u.subatomic = ST_float64;
  957. ;
  958. break;}
  959. case 54:
  960. #line 347 "dcParser.yxx"
  961. {
  962. yyval.u.subatomic = ST_string;
  963. ;
  964. break;}
  965. case 55:
  966. #line 351 "dcParser.yxx"
  967. {
  968. yyval.u.subatomic = ST_blob;
  969. ;
  970. break;}
  971. case 56:
  972. #line 355 "dcParser.yxx"
  973. {
  974. yyval.u.subatomic = ST_int8array;
  975. ;
  976. break;}
  977. case 57:
  978. #line 359 "dcParser.yxx"
  979. {
  980. yyval.u.subatomic = ST_int16array;
  981. ;
  982. break;}
  983. case 58:
  984. #line 363 "dcParser.yxx"
  985. {
  986. yyval.u.subatomic = ST_int32array;
  987. ;
  988. break;}
  989. case 59:
  990. #line 367 "dcParser.yxx"
  991. {
  992. yyval.u.subatomic = ST_uint8array;
  993. ;
  994. break;}
  995. case 60:
  996. #line 371 "dcParser.yxx"
  997. {
  998. yyval.u.subatomic = ST_uint16array;
  999. ;
  1000. break;}
  1001. case 61:
  1002. #line 375 "dcParser.yxx"
  1003. {
  1004. yyval.u.subatomic = ST_uint32array;
  1005. ;
  1006. break;}
  1007. case 62:
  1008. #line 379 "dcParser.yxx"
  1009. {
  1010. yyval.u.subatomic = ST_uint32uint8array;
  1011. ;
  1012. break;}
  1013. case 64:
  1014. #line 387 "dcParser.yxx"
  1015. {
  1016. current_atomic->_flags |= DCAtomicField::F_required;
  1017. ;
  1018. break;}
  1019. case 65:
  1020. #line 391 "dcParser.yxx"
  1021. {
  1022. current_atomic->_flags |= DCAtomicField::F_broadcast;
  1023. ;
  1024. break;}
  1025. case 66:
  1026. #line 395 "dcParser.yxx"
  1027. {
  1028. current_atomic->_flags |= DCAtomicField::F_p2p;
  1029. ;
  1030. break;}
  1031. case 67:
  1032. #line 399 "dcParser.yxx"
  1033. {
  1034. current_atomic->_flags |= DCAtomicField::F_ram;
  1035. ;
  1036. break;}
  1037. case 68:
  1038. #line 403 "dcParser.yxx"
  1039. {
  1040. current_atomic->_flags |= DCAtomicField::F_db;
  1041. ;
  1042. break;}
  1043. case 69:
  1044. #line 407 "dcParser.yxx"
  1045. {
  1046. current_atomic->_flags |= DCAtomicField::F_clsend;
  1047. ;
  1048. break;}
  1049. case 70:
  1050. #line 411 "dcParser.yxx"
  1051. {
  1052. current_atomic->_flags |= DCAtomicField::F_clrecv;
  1053. ;
  1054. break;}
  1055. case 71:
  1056. #line 415 "dcParser.yxx"
  1057. {
  1058. current_atomic->_flags |= DCAtomicField::F_ownsend;
  1059. ;
  1060. break;}
  1061. case 72:
  1062. #line 422 "dcParser.yxx"
  1063. {
  1064. current_molecular = new DCMolecularField;
  1065. current_molecular->_name = yyvsp[-1].str;
  1066. if (!current_class->add_field(current_molecular)) {
  1067. yyerror("Duplicate field name: " + current_molecular->_name);
  1068. }
  1069. ;
  1070. break;}
  1071. case 74:
  1072. #line 434 "dcParser.yxx"
  1073. {
  1074. if (yyvsp[0].u.atomic != (DCAtomicField *)NULL) {
  1075. current_molecular->_fields.push_back(yyvsp[0].u.atomic);
  1076. }
  1077. ;
  1078. break;}
  1079. case 75:
  1080. #line 440 "dcParser.yxx"
  1081. {
  1082. if (yyvsp[0].u.atomic != (DCAtomicField *)NULL) {
  1083. current_molecular->_fields.push_back(yyvsp[0].u.atomic);
  1084. if (current_molecular->_fields[0]->_flags != yyvsp[0].u.atomic->_flags) {
  1085. yyerror("Mismatched flags in molecule between " +
  1086. current_molecular->_fields[0]->_name + " and " +
  1087. yyvsp[0].u.atomic->_name);
  1088. }
  1089. }
  1090. ;
  1091. break;}
  1092. }
  1093. /* the action file gets copied in in place of this dollarsign */
  1094. #line 543 "/usr/share/bison.simple"
  1095. yyvsp -= yylen;
  1096. yyssp -= yylen;
  1097. #ifdef YYLSP_NEEDED
  1098. yylsp -= yylen;
  1099. #endif
  1100. #if YYDEBUG != 0
  1101. if (yydebug)
  1102. {
  1103. short *ssp1 = yyss - 1;
  1104. fprintf (stderr, "state stack now");
  1105. while (ssp1 != yyssp)
  1106. fprintf (stderr, " %d", *++ssp1);
  1107. fprintf (stderr, "\n");
  1108. }
  1109. #endif
  1110. *++yyvsp = yyval;
  1111. #ifdef YYLSP_NEEDED
  1112. yylsp++;
  1113. if (yylen == 0)
  1114. {
  1115. yylsp->first_line = yylloc.first_line;
  1116. yylsp->first_column = yylloc.first_column;
  1117. yylsp->last_line = (yylsp-1)->last_line;
  1118. yylsp->last_column = (yylsp-1)->last_column;
  1119. yylsp->text = 0;
  1120. }
  1121. else
  1122. {
  1123. yylsp->last_line = (yylsp+yylen-1)->last_line;
  1124. yylsp->last_column = (yylsp+yylen-1)->last_column;
  1125. }
  1126. #endif
  1127. /* Now "shift" the result of the reduction.
  1128. Determine what state that goes to,
  1129. based on the state we popped back to
  1130. and the rule number reduced by. */
  1131. yyn = yyr1[yyn];
  1132. yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
  1133. if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
  1134. yystate = yytable[yystate];
  1135. else
  1136. yystate = yydefgoto[yyn - YYNTBASE];
  1137. goto yynewstate;
  1138. yyerrlab: /* here on detecting error */
  1139. if (! yyerrstatus)
  1140. /* If not already recovering from an error, report this error. */
  1141. {
  1142. ++yynerrs;
  1143. #ifdef YYERROR_VERBOSE
  1144. yyn = yypact[yystate];
  1145. if (yyn > YYFLAG && yyn < YYLAST)
  1146. {
  1147. int size = 0;
  1148. char *msg;
  1149. int x, count;
  1150. count = 0;
  1151. /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
  1152. for (x = (yyn < 0 ? -yyn : 0);
  1153. x < (sizeof(yytname) / sizeof(char *)); x++)
  1154. if (yycheck[x + yyn] == x)
  1155. size += strlen(yytname[x]) + 15, count++;
  1156. msg = (char *) malloc(size + 15);
  1157. if (msg != 0)
  1158. {
  1159. strcpy(msg, "parse error");
  1160. if (count < 5)
  1161. {
  1162. count = 0;
  1163. for (x = (yyn < 0 ? -yyn : 0);
  1164. x < (sizeof(yytname) / sizeof(char *)); x++)
  1165. if (yycheck[x + yyn] == x)
  1166. {
  1167. strcat(msg, count == 0 ? ", expecting `" : " or `");
  1168. strcat(msg, yytname[x]);
  1169. strcat(msg, "'");
  1170. count++;
  1171. }
  1172. }
  1173. yyerror(msg);
  1174. free(msg);
  1175. }
  1176. else
  1177. yyerror ("parse error; also virtual memory exceeded");
  1178. }
  1179. else
  1180. #endif /* YYERROR_VERBOSE */
  1181. yyerror("parse error");
  1182. }
  1183. goto yyerrlab1;
  1184. yyerrlab1: /* here on error raised explicitly by an action */
  1185. if (yyerrstatus == 3)
  1186. {
  1187. /* if just tried and failed to reuse lookahead token after an error, discard it. */
  1188. /* return failure if at end of input */
  1189. if (yychar == YYEOF)
  1190. YYABORT;
  1191. #if YYDEBUG != 0
  1192. if (yydebug)
  1193. fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
  1194. #endif
  1195. yychar = YYEMPTY;
  1196. }
  1197. /* Else will try to reuse lookahead token
  1198. after shifting the error token. */
  1199. yyerrstatus = 3; /* Each real token shifted decrements this */
  1200. goto yyerrhandle;
  1201. yyerrdefault: /* current state does not do anything special for the error token. */
  1202. #if 0
  1203. /* This is wrong; only states that explicitly want error tokens
  1204. should shift them. */
  1205. yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
  1206. if (yyn) goto yydefault;
  1207. #endif
  1208. yyerrpop: /* pop the current state because it cannot handle the error token */
  1209. if (yyssp == yyss) YYABORT;
  1210. yyvsp--;
  1211. yystate = *--yyssp;
  1212. #ifdef YYLSP_NEEDED
  1213. yylsp--;
  1214. #endif
  1215. #if YYDEBUG != 0
  1216. if (yydebug)
  1217. {
  1218. short *ssp1 = yyss - 1;
  1219. fprintf (stderr, "Error: state stack now");
  1220. while (ssp1 != yyssp)
  1221. fprintf (stderr, " %d", *++ssp1);
  1222. fprintf (stderr, "\n");
  1223. }
  1224. #endif
  1225. yyerrhandle:
  1226. yyn = yypact[yystate];
  1227. if (yyn == YYFLAG)
  1228. goto yyerrdefault;
  1229. yyn += YYTERROR;
  1230. if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
  1231. goto yyerrdefault;
  1232. yyn = yytable[yyn];
  1233. if (yyn < 0)
  1234. {
  1235. if (yyn == YYFLAG)
  1236. goto yyerrpop;
  1237. yyn = -yyn;
  1238. goto yyreduce;
  1239. }
  1240. else if (yyn == 0)
  1241. goto yyerrpop;
  1242. if (yyn == YYFINAL)
  1243. YYACCEPT;
  1244. #if YYDEBUG != 0
  1245. if (yydebug)
  1246. fprintf(stderr, "Shifting error token, ");
  1247. #endif
  1248. *++yyvsp = yylval;
  1249. #ifdef YYLSP_NEEDED
  1250. *++yylsp = yylloc;
  1251. #endif
  1252. yystate = yyn;
  1253. goto yynewstate;
  1254. yyacceptlab:
  1255. /* YYACCEPT comes here. */
  1256. if (yyfree_stacks)
  1257. {
  1258. free (yyss);
  1259. free (yyvs);
  1260. #ifdef YYLSP_NEEDED
  1261. free (yyls);
  1262. #endif
  1263. }
  1264. return 0;
  1265. yyabortlab:
  1266. /* YYABORT comes here. */
  1267. if (yyfree_stacks)
  1268. {
  1269. free (yyss);
  1270. free (yyvs);
  1271. #ifdef YYLSP_NEEDED
  1272. free (yyls);
  1273. #endif
  1274. }
  1275. return 1;
  1276. }
  1277. #line 454 "dcParser.yxx"