aRts audio server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1508 lines
42KB

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