1398 lines
46 KiB

  1. /* A Bison parser, made by GNU Bison 2.5. */
  2. /* Skeleton implementation for Bison LALR(1) parsers in C++
  3. Copyright (C) 2002-2011 Free Software Foundation, Inc.
  4. This program is free software: you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation, either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  14. /* As a special exception, you may create a larger work that contains
  15. part or all of the Bison parser skeleton and distribute that work
  16. under terms of your choice, so long as that work isn't itself a
  17. parser generator using the skeleton or a modified version thereof
  18. as a parser skeleton. Alternatively, if you modify or redistribute
  19. the parser skeleton itself, you may (at your option) remove this
  20. special exception, which will cause the skeleton and the resulting
  21. Bison output files to be licensed under the GNU General Public
  22. License without this special exception.
  23. This special exception was added by the Free Software Foundation in
  24. version 2.2 of Bison. */
  25. // Take the name prefix into account.
  26. #define yylex lollex
  27. /* First part of user declarations. */
  28. /* Line 293 of lalr1.cc */
  29. #line 1 "easymesh/easymesh-parser.y"
  30. //
  31. // Lol Engine
  32. //
  33. // Copyright: (c) 2010-2012 Sam Hocevar <sam@hocevar.net>
  34. // (c) 2009-2012 Cédric Lecacheur <jordx@free.fr>
  35. // (c) 2009-2012 Benjamin Huet <huet.benjamin@gmail.com>
  36. // This program is free software; you can redistribute it and/or
  37. // modify it under the terms of the Do What The Fuck You Want To
  38. // Public License, Version 2, as published by Sam Hocevar. See
  39. // http://sam.zoy.org/projects/COPYING.WTFPL for more details.
  40. //
  41. #if defined HAVE_CONFIG_H
  42. # include "config.h"
  43. #endif
  44. #include "core.h"
  45. #include "easymesh/easymesh.h"
  46. #include <string>
  47. /* Line 293 of lalr1.cc */
  48. #line 66 "generated/easymesh-parser.cpp"
  49. #include "easymesh-parser.h"
  50. /* User implementation prologue. */
  51. /* Line 299 of lalr1.cc */
  52. #line 65 "easymesh/easymesh-parser.y"
  53. #include "easymesh/easymesh-compiler.h"
  54. #undef yylex
  55. #define yylex mc.m_lexer->lex
  56. /* Line 299 of lalr1.cc */
  57. #line 83 "generated/easymesh-parser.cpp"
  58. #ifndef YY_
  59. # if defined YYENABLE_NLS && YYENABLE_NLS
  60. # if ENABLE_NLS
  61. # include <libintl.h> /* FIXME: INFRINGES ON USER NAME SPACE */
  62. # define YY_(msgid) dgettext ("bison-runtime", msgid)
  63. # endif
  64. # endif
  65. # ifndef YY_
  66. # define YY_(msgid) msgid
  67. # endif
  68. #endif
  69. /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
  70. If N is 0, then set CURRENT to the empty location which ends
  71. the previous symbol: RHS[0] (always defined). */
  72. #define YYRHSLOC(Rhs, K) ((Rhs)[K])
  73. #ifndef YYLLOC_DEFAULT
  74. # define YYLLOC_DEFAULT(Current, Rhs, N) \
  75. do \
  76. if (N) \
  77. { \
  78. (Current).begin = YYRHSLOC (Rhs, 1).begin; \
  79. (Current).end = YYRHSLOC (Rhs, N).end; \
  80. } \
  81. else \
  82. { \
  83. (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \
  84. } \
  85. while (false)
  86. #endif
  87. /* Suppress unused-variable warnings by "using" E. */
  88. #define YYUSE(e) ((void) (e))
  89. /* Enable debugging if requested. */
  90. #if YYDEBUG
  91. /* A pseudo ostream that takes yydebug_ into account. */
  92. # define YYCDEBUG if (yydebug_) (*yycdebug_)
  93. # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
  94. do { \
  95. if (yydebug_) \
  96. { \
  97. *yycdebug_ << Title << ' '; \
  98. yy_symbol_print_ ((Type), (Value), (Location)); \
  99. *yycdebug_ << std::endl; \
  100. } \
  101. } while (false)
  102. # define YY_REDUCE_PRINT(Rule) \
  103. do { \
  104. if (yydebug_) \
  105. yy_reduce_print_ (Rule); \
  106. } while (false)
  107. # define YY_STACK_PRINT() \
  108. do { \
  109. if (yydebug_) \
  110. yystack_print_ (); \
  111. } while (false)
  112. #else /* !YYDEBUG */
  113. # define YYCDEBUG if (false) std::cerr
  114. # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
  115. # define YY_REDUCE_PRINT(Rule)
  116. # define YY_STACK_PRINT()
  117. #endif /* !YYDEBUG */
  118. #define yyerrok (yyerrstatus_ = 0)
  119. #define yyclearin (yychar = yyempty_)
  120. #define YYACCEPT goto yyacceptlab
  121. #define YYABORT goto yyabortlab
  122. #define YYERROR goto yyerrorlab
  123. #define YYRECOVERING() (!!yyerrstatus_)
  124. namespace lol {
  125. /* Line 382 of lalr1.cc */
  126. #line 169 "generated/easymesh-parser.cpp"
  127. /* Return YYSTR after stripping away unnecessary quotes and
  128. backslashes, so that it's suitable for yyerror. The heuristic is
  129. that double-quoting is unnecessary unless the string contains an
  130. apostrophe, a comma, or backslash (other than backslash-backslash).
  131. YYSTR is taken from yytname. */
  132. std::string
  133. EasyMeshParser::yytnamerr_ (const char *yystr)
  134. {
  135. if (*yystr == '"')
  136. {
  137. std::string yyr = "";
  138. char const *yyp = yystr;
  139. for (;;)
  140. switch (*++yyp)
  141. {
  142. case '\'':
  143. case ',':
  144. goto do_not_strip_quotes;
  145. case '\\':
  146. if (*++yyp != '\\')
  147. goto do_not_strip_quotes;
  148. /* Fall through. */
  149. default:
  150. yyr += *yyp;
  151. break;
  152. case '"':
  153. return yyr;
  154. }
  155. do_not_strip_quotes: ;
  156. }
  157. return yystr;
  158. }
  159. /// Build a parser object.
  160. EasyMeshParser::EasyMeshParser (class EasyMeshCompiler& mc_yyarg)
  161. :
  162. #if YYDEBUG
  163. yydebug_ (false),
  164. yycdebug_ (&std::cerr),
  165. #endif
  166. mc (mc_yyarg)
  167. {
  168. }
  169. EasyMeshParser::~EasyMeshParser ()
  170. {
  171. }
  172. #if YYDEBUG
  173. /*--------------------------------.
  174. | Print this symbol on YYOUTPUT. |
  175. `--------------------------------*/
  176. inline void
  177. EasyMeshParser::yy_symbol_value_print_ (int yytype,
  178. const semantic_type* yyvaluep, const location_type* yylocationp)
  179. {
  180. YYUSE (yylocationp);
  181. YYUSE (yyvaluep);
  182. switch (yytype)
  183. {
  184. default:
  185. break;
  186. }
  187. }
  188. void
  189. EasyMeshParser::yy_symbol_print_ (int yytype,
  190. const semantic_type* yyvaluep, const location_type* yylocationp)
  191. {
  192. *yycdebug_ << (yytype < yyntokens_ ? "token" : "nterm")
  193. << ' ' << yytname_[yytype] << " ("
  194. << *yylocationp << ": ";
  195. yy_symbol_value_print_ (yytype, yyvaluep, yylocationp);
  196. *yycdebug_ << ')';
  197. }
  198. #endif
  199. void
  200. EasyMeshParser::yydestruct_ (const char* yymsg,
  201. int yytype, semantic_type* yyvaluep, location_type* yylocationp)
  202. {
  203. YYUSE (yylocationp);
  204. YYUSE (yymsg);
  205. YYUSE (yyvaluep);
  206. YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
  207. switch (yytype)
  208. {
  209. default:
  210. break;
  211. }
  212. }
  213. void
  214. EasyMeshParser::yypop_ (unsigned int n)
  215. {
  216. yystate_stack_.pop (n);
  217. yysemantic_stack_.pop (n);
  218. yylocation_stack_.pop (n);
  219. }
  220. #if YYDEBUG
  221. std::ostream&
  222. EasyMeshParser::debug_stream () const
  223. {
  224. return *yycdebug_;
  225. }
  226. void
  227. EasyMeshParser::set_debug_stream (std::ostream& o)
  228. {
  229. yycdebug_ = &o;
  230. }
  231. EasyMeshParser::debug_level_type
  232. EasyMeshParser::debug_level () const
  233. {
  234. return yydebug_;
  235. }
  236. void
  237. EasyMeshParser::set_debug_level (debug_level_type l)
  238. {
  239. yydebug_ = l;
  240. }
  241. #endif
  242. inline bool
  243. EasyMeshParser::yy_pact_value_is_default_ (int yyvalue)
  244. {
  245. return yyvalue == yypact_ninf_;
  246. }
  247. inline bool
  248. EasyMeshParser::yy_table_value_is_error_ (int yyvalue)
  249. {
  250. return yyvalue == yytable_ninf_;
  251. }
  252. int
  253. EasyMeshParser::parse ()
  254. {
  255. /// Lookahead and lookahead in internal form.
  256. int yychar = yyempty_;
  257. int yytoken = 0;
  258. /* State. */
  259. int yyn;
  260. int yylen = 0;
  261. int yystate = 0;
  262. /* Error handling. */
  263. int yynerrs_ = 0;
  264. int yyerrstatus_ = 0;
  265. /// Semantic value of the lookahead.
  266. semantic_type yylval;
  267. /// Location of the lookahead.
  268. location_type yylloc;
  269. /// The locations where the error started and ended.
  270. location_type yyerror_range[3];
  271. /// $$.
  272. semantic_type yyval;
  273. /// @$.
  274. location_type yyloc;
  275. int yyresult;
  276. YYCDEBUG << "Starting parse" << std::endl;
  277. /* Initialize the stacks. The initial state will be pushed in
  278. yynewstate, since the latter expects the semantical and the
  279. location values to have been already stored, initialize these
  280. stacks with a primary value. */
  281. yystate_stack_ = state_stack_type (0);
  282. yysemantic_stack_ = semantic_stack_type (0);
  283. yylocation_stack_ = location_stack_type (0);
  284. yysemantic_stack_.push (yylval);
  285. yylocation_stack_.push (yylloc);
  286. /* New state. */
  287. yynewstate:
  288. yystate_stack_.push (yystate);
  289. YYCDEBUG << "Entering state " << yystate << std::endl;
  290. /* Accept? */
  291. if (yystate == yyfinal_)
  292. goto yyacceptlab;
  293. goto yybackup;
  294. /* Backup. */
  295. yybackup:
  296. /* Try to take a decision without lookahead. */
  297. yyn = yypact_[yystate];
  298. if (yy_pact_value_is_default_ (yyn))
  299. goto yydefault;
  300. /* Read a lookahead token. */
  301. if (yychar == yyempty_)
  302. {
  303. YYCDEBUG << "Reading a token: ";
  304. yychar = yylex (&yylval, &yylloc);
  305. }
  306. /* Convert token to internal form. */
  307. if (yychar <= yyeof_)
  308. {
  309. yychar = yytoken = yyeof_;
  310. YYCDEBUG << "Now at end of input." << std::endl;
  311. }
  312. else
  313. {
  314. yytoken = yytranslate_ (yychar);
  315. YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
  316. }
  317. /* If the proper action on seeing token YYTOKEN is to reduce or to
  318. detect an error, take that action. */
  319. yyn += yytoken;
  320. if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yytoken)
  321. goto yydefault;
  322. /* Reduce or error. */
  323. yyn = yytable_[yyn];
  324. if (yyn <= 0)
  325. {
  326. if (yy_table_value_is_error_ (yyn))
  327. goto yyerrlab;
  328. yyn = -yyn;
  329. goto yyreduce;
  330. }
  331. /* Shift the lookahead token. */
  332. YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
  333. /* Discard the token being shifted. */
  334. yychar = yyempty_;
  335. yysemantic_stack_.push (yylval);
  336. yylocation_stack_.push (yylloc);
  337. /* Count tokens shifted since error; after three, turn off error
  338. status. */
  339. if (yyerrstatus_)
  340. --yyerrstatus_;
  341. yystate = yyn;
  342. goto yynewstate;
  343. /*-----------------------------------------------------------.
  344. | yydefault -- do the default action for the current state. |
  345. `-----------------------------------------------------------*/
  346. yydefault:
  347. yyn = yydefact_[yystate];
  348. if (yyn == 0)
  349. goto yyerrlab;
  350. goto yyreduce;
  351. /*-----------------------------.
  352. | yyreduce -- Do a reduction. |
  353. `-----------------------------*/
  354. yyreduce:
  355. yylen = yyr2_[yyn];
  356. /* If YYLEN is nonzero, implement the default value of the action:
  357. `$$ = $1'. Otherwise, use the top of the stack.
  358. Otherwise, the following line sets YYVAL to garbage.
  359. This behavior is undocumented and Bison
  360. users should not rely upon it. */
  361. if (yylen)
  362. yyval = yysemantic_stack_[yylen - 1];
  363. else
  364. yyval = yysemantic_stack_[0];
  365. {
  366. slice<location_type, location_stack_type> slice (yylocation_stack_, yylen);
  367. YYLLOC_DEFAULT (yyloc, slice, yylen);
  368. }
  369. YY_REDUCE_PRINT (yyn);
  370. switch (yyn)
  371. {
  372. case 7:
  373. /* Line 690 of lalr1.cc */
  374. #line 89 "easymesh/easymesh-parser.y"
  375. { mc.m_mesh.OpenBrace(); }
  376. break;
  377. case 8:
  378. /* Line 690 of lalr1.cc */
  379. #line 93 "easymesh/easymesh-parser.y"
  380. { mc.m_mesh.CloseBrace(); }
  381. break;
  382. case 14:
  383. /* Line 690 of lalr1.cc */
  384. #line 108 "easymesh/easymesh-parser.y"
  385. { mc.m_mesh.SetCurColor(vec4((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3)); }
  386. break;
  387. case 15:
  388. /* Line 690 of lalr1.cc */
  389. #line 109 "easymesh/easymesh-parser.y"
  390. { uint32_t x = (yysemantic_stack_[(2) - (2)].u32val);
  391. vec4 v(x >> 24, (x >> 16) & 0xff, (x >> 8) & 0xff, x & 0xff);
  392. mc.m_mesh.SetCurColor(vec4(v) * (1. / 255)); }
  393. break;
  394. case 16:
  395. /* Line 690 of lalr1.cc */
  396. #line 112 "easymesh/easymesh-parser.y"
  397. { mc.m_mesh.SetCurColor2(vec4((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3)); }
  398. break;
  399. case 17:
  400. /* Line 690 of lalr1.cc */
  401. #line 113 "easymesh/easymesh-parser.y"
  402. { uint32_t x = (yysemantic_stack_[(2) - (2)].u32val);
  403. vec4 v(x >> 24, (x >> 16) & 0xff, (x >> 8) & 0xff, x & 0xff);
  404. mc.m_mesh.SetCurColor2(vec4(v) * (1. / 255)); }
  405. break;
  406. case 18:
  407. /* Line 690 of lalr1.cc */
  408. #line 119 "easymesh/easymesh-parser.y"
  409. { mc.m_mesh.Chamfer((yysemantic_stack_[(2) - (2)].args).f0); }
  410. break;
  411. case 19:
  412. /* Line 690 of lalr1.cc */
  413. #line 120 "easymesh/easymesh-parser.y"
  414. { mc.m_mesh.Translate(vec3((yysemantic_stack_[(2) - (2)].args).f0, 0, 0)); }
  415. break;
  416. case 20:
  417. /* Line 690 of lalr1.cc */
  418. #line 121 "easymesh/easymesh-parser.y"
  419. { mc.m_mesh.Translate(vec3(0, (yysemantic_stack_[(2) - (2)].args).f0, 0)); }
  420. break;
  421. case 21:
  422. /* Line 690 of lalr1.cc */
  423. #line 122 "easymesh/easymesh-parser.y"
  424. { mc.m_mesh.Translate(vec3(0, 0, (yysemantic_stack_[(2) - (2)].args).f0)); }
  425. break;
  426. case 22:
  427. /* Line 690 of lalr1.cc */
  428. #line 123 "easymesh/easymesh-parser.y"
  429. { mc.m_mesh.Translate(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); }
  430. break;
  431. case 23:
  432. /* Line 690 of lalr1.cc */
  433. #line 124 "easymesh/easymesh-parser.y"
  434. { mc.m_mesh.RotateX((yysemantic_stack_[(2) - (2)].args).f0); }
  435. break;
  436. case 24:
  437. /* Line 690 of lalr1.cc */
  438. #line 125 "easymesh/easymesh-parser.y"
  439. { mc.m_mesh.RotateY((yysemantic_stack_[(2) - (2)].args).f0); }
  440. break;
  441. case 25:
  442. /* Line 690 of lalr1.cc */
  443. #line 126 "easymesh/easymesh-parser.y"
  444. { mc.m_mesh.RotateZ((yysemantic_stack_[(2) - (2)].args).f0); }
  445. break;
  446. case 26:
  447. /* Line 690 of lalr1.cc */
  448. #line 127 "easymesh/easymesh-parser.y"
  449. { mc.m_mesh.TaperX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
  450. break;
  451. case 27:
  452. /* Line 690 of lalr1.cc */
  453. #line 128 "easymesh/easymesh-parser.y"
  454. { mc.m_mesh.TaperY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
  455. break;
  456. case 28:
  457. /* Line 690 of lalr1.cc */
  458. #line 129 "easymesh/easymesh-parser.y"
  459. { mc.m_mesh.TaperZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
  460. break;
  461. case 29:
  462. /* Line 690 of lalr1.cc */
  463. #line 130 "easymesh/easymesh-parser.y"
  464. { mc.m_mesh.Scale(vec3((yysemantic_stack_[(2) - (2)].args).f0, 0, 0)); }
  465. break;
  466. case 30:
  467. /* Line 690 of lalr1.cc */
  468. #line 131 "easymesh/easymesh-parser.y"
  469. { mc.m_mesh.Scale(vec3(0, (yysemantic_stack_[(2) - (2)].args).f0, 0)); }
  470. break;
  471. case 31:
  472. /* Line 690 of lalr1.cc */
  473. #line 132 "easymesh/easymesh-parser.y"
  474. { mc.m_mesh.Scale(vec3(0, 0, (yysemantic_stack_[(2) - (2)].args).f0)); }
  475. break;
  476. case 32:
  477. /* Line 690 of lalr1.cc */
  478. #line 133 "easymesh/easymesh-parser.y"
  479. { mc.m_mesh.Scale(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); }
  480. break;
  481. case 33:
  482. /* Line 690 of lalr1.cc */
  483. #line 134 "easymesh/easymesh-parser.y"
  484. { mc.m_mesh.MirrorX(); }
  485. break;
  486. case 34:
  487. /* Line 690 of lalr1.cc */
  488. #line 135 "easymesh/easymesh-parser.y"
  489. { mc.m_mesh.MirrorY(); }
  490. break;
  491. case 35:
  492. /* Line 690 of lalr1.cc */
  493. #line 136 "easymesh/easymesh-parser.y"
  494. { mc.m_mesh.MirrorZ(); }
  495. break;
  496. case 36:
  497. /* Line 690 of lalr1.cc */
  498. #line 140 "easymesh/easymesh-parser.y"
  499. { mc.m_mesh.AppendCylinder((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
  500. (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3,
  501. (int)(yysemantic_stack_[(2) - (2)].args).f4, (int)(yysemantic_stack_[(2) - (2)].args).f5); }
  502. break;
  503. case 37:
  504. /* Line 690 of lalr1.cc */
  505. #line 143 "easymesh/easymesh-parser.y"
  506. { mc.m_mesh.AppendBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); }
  507. break;
  508. case 38:
  509. /* Line 690 of lalr1.cc */
  510. #line 144 "easymesh/easymesh-parser.y"
  511. { mc.m_mesh.AppendSmoothChamfBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
  512. (yysemantic_stack_[(2) - (2)].args).f2), (yysemantic_stack_[(2) - (2)].args).f3); }
  513. break;
  514. case 39:
  515. /* Line 690 of lalr1.cc */
  516. #line 146 "easymesh/easymesh-parser.y"
  517. { mc.m_mesh.AppendFlatChamfBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
  518. (yysemantic_stack_[(2) - (2)].args).f2), (yysemantic_stack_[(2) - (2)].args).f3); }
  519. break;
  520. case 40:
  521. /* Line 690 of lalr1.cc */
  522. #line 148 "easymesh/easymesh-parser.y"
  523. { mc.m_mesh.AppendSphere((yysemantic_stack_[(2) - (2)].args).f0,
  524. vec3((yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3)); }
  525. break;
  526. case 41:
  527. /* Line 690 of lalr1.cc */
  528. #line 150 "easymesh/easymesh-parser.y"
  529. { mc.m_mesh.AppendCapsule((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
  530. break;
  531. case 42:
  532. /* Line 690 of lalr1.cc */
  533. #line 151 "easymesh/easymesh-parser.y"
  534. { mc.m_mesh.AppendStar((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2,
  535. (int)(yysemantic_stack_[(2) - (2)].args).f3, (int)(yysemantic_stack_[(2) - (2)].args).f4); }
  536. break;
  537. case 43:
  538. /* Line 690 of lalr1.cc */
  539. #line 153 "easymesh/easymesh-parser.y"
  540. { mc.m_mesh.AppendExpandedStar((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
  541. (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3); }
  542. break;
  543. case 44:
  544. /* Line 690 of lalr1.cc */
  545. #line 155 "easymesh/easymesh-parser.y"
  546. { mc.m_mesh.AppendDisc((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (int)(yysemantic_stack_[(2) - (2)].args).f2); }
  547. break;
  548. case 45:
  549. /* Line 690 of lalr1.cc */
  550. #line 156 "easymesh/easymesh-parser.y"
  551. { mc.m_mesh.AppendSimpleTriangle((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); }
  552. break;
  553. case 46:
  554. /* Line 690 of lalr1.cc */
  555. #line 157 "easymesh/easymesh-parser.y"
  556. { mc.m_mesh.AppendSimpleQuad((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); }
  557. break;
  558. case 47:
  559. /* Line 690 of lalr1.cc */
  560. #line 158 "easymesh/easymesh-parser.y"
  561. { mc.m_mesh.AppendCog((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3,
  562. (yysemantic_stack_[(2) - (2)].args).f4, (yysemantic_stack_[(2) - (2)].args).f5, (yysemantic_stack_[(2) - (2)].args).f6, (int)(yysemantic_stack_[(2) - (2)].args).f7); }
  563. break;
  564. case 48:
  565. /* Line 690 of lalr1.cc */
  566. #line 162 "easymesh/easymesh-parser.y"
  567. { (yyval.args).f0 = (yysemantic_stack_[(1) - (1)].fval); }
  568. break;
  569. case 49:
  570. /* Line 690 of lalr1.cc */
  571. #line 163 "easymesh/easymesh-parser.y"
  572. { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f1 = (yysemantic_stack_[(2) - (2)].fval); }
  573. break;
  574. case 50:
  575. /* Line 690 of lalr1.cc */
  576. #line 164 "easymesh/easymesh-parser.y"
  577. { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f2 = (yysemantic_stack_[(2) - (2)].fval); }
  578. break;
  579. case 51:
  580. /* Line 690 of lalr1.cc */
  581. #line 165 "easymesh/easymesh-parser.y"
  582. { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f3 = (yysemantic_stack_[(2) - (2)].fval); }
  583. break;
  584. case 52:
  585. /* Line 690 of lalr1.cc */
  586. #line 166 "easymesh/easymesh-parser.y"
  587. { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f4 = (yysemantic_stack_[(2) - (2)].fval); }
  588. break;
  589. case 53:
  590. /* Line 690 of lalr1.cc */
  591. #line 167 "easymesh/easymesh-parser.y"
  592. { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f5 = (yysemantic_stack_[(2) - (2)].fval); }
  593. break;
  594. case 54:
  595. /* Line 690 of lalr1.cc */
  596. #line 168 "easymesh/easymesh-parser.y"
  597. { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f6 = (yysemantic_stack_[(2) - (2)].fval); }
  598. break;
  599. case 55:
  600. /* Line 690 of lalr1.cc */
  601. #line 169 "easymesh/easymesh-parser.y"
  602. { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f7 = (yysemantic_stack_[(2) - (2)].fval); }
  603. break;
  604. case 56:
  605. /* Line 690 of lalr1.cc */
  606. #line 172 "easymesh/easymesh-parser.y"
  607. { (yyval.fval) = (yysemantic_stack_[(1) - (1)].fval); }
  608. break;
  609. case 57:
  610. /* Line 690 of lalr1.cc */
  611. #line 173 "easymesh/easymesh-parser.y"
  612. { (yyval.fval) = -(yysemantic_stack_[(2) - (2)].fval); }
  613. break;
  614. /* Line 690 of lalr1.cc */
  615. #line 804 "generated/easymesh-parser.cpp"
  616. default:
  617. break;
  618. }
  619. /* User semantic actions sometimes alter yychar, and that requires
  620. that yytoken be updated with the new translation. We take the
  621. approach of translating immediately before every use of yytoken.
  622. One alternative is translating here after every semantic action,
  623. but that translation would be missed if the semantic action
  624. invokes YYABORT, YYACCEPT, or YYERROR immediately after altering
  625. yychar. In the case of YYABORT or YYACCEPT, an incorrect
  626. destructor might then be invoked immediately. In the case of
  627. YYERROR, subsequent parser actions might lead to an incorrect
  628. destructor call or verbose syntax error message before the
  629. lookahead is translated. */
  630. YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc);
  631. yypop_ (yylen);
  632. yylen = 0;
  633. YY_STACK_PRINT ();
  634. yysemantic_stack_.push (yyval);
  635. yylocation_stack_.push (yyloc);
  636. /* Shift the result of the reduction. */
  637. yyn = yyr1_[yyn];
  638. yystate = yypgoto_[yyn - yyntokens_] + yystate_stack_[0];
  639. if (0 <= yystate && yystate <= yylast_
  640. && yycheck_[yystate] == yystate_stack_[0])
  641. yystate = yytable_[yystate];
  642. else
  643. yystate = yydefgoto_[yyn - yyntokens_];
  644. goto yynewstate;
  645. /*------------------------------------.
  646. | yyerrlab -- here on detecting error |
  647. `------------------------------------*/
  648. yyerrlab:
  649. /* Make sure we have latest lookahead translation. See comments at
  650. user semantic actions for why this is necessary. */
  651. yytoken = yytranslate_ (yychar);
  652. /* If not already recovering from an error, report this error. */
  653. if (!yyerrstatus_)
  654. {
  655. ++yynerrs_;
  656. if (yychar == yyempty_)
  657. yytoken = yyempty_;
  658. error (yylloc, yysyntax_error_ (yystate, yytoken));
  659. }
  660. yyerror_range[1] = yylloc;
  661. if (yyerrstatus_ == 3)
  662. {
  663. /* If just tried and failed to reuse lookahead token after an
  664. error, discard it. */
  665. if (yychar <= yyeof_)
  666. {
  667. /* Return failure if at end of input. */
  668. if (yychar == yyeof_)
  669. YYABORT;
  670. }
  671. else
  672. {
  673. yydestruct_ ("Error: discarding", yytoken, &yylval, &yylloc);
  674. yychar = yyempty_;
  675. }
  676. }
  677. /* Else will try to reuse lookahead token after shifting the error
  678. token. */
  679. goto yyerrlab1;
  680. /*---------------------------------------------------.
  681. | yyerrorlab -- error raised explicitly by YYERROR. |
  682. `---------------------------------------------------*/
  683. yyerrorlab:
  684. /* Pacify compilers like GCC when the user code never invokes
  685. YYERROR and the label yyerrorlab therefore never appears in user
  686. code. */
  687. if (false)
  688. goto yyerrorlab;
  689. yyerror_range[1] = yylocation_stack_[yylen - 1];
  690. /* Do not reclaim the symbols of the rule which action triggered
  691. this YYERROR. */
  692. yypop_ (yylen);
  693. yylen = 0;
  694. yystate = yystate_stack_[0];
  695. goto yyerrlab1;
  696. /*-------------------------------------------------------------.
  697. | yyerrlab1 -- common code for both syntax error and YYERROR. |
  698. `-------------------------------------------------------------*/
  699. yyerrlab1:
  700. yyerrstatus_ = 3; /* Each real token shifted decrements this. */
  701. for (;;)
  702. {
  703. yyn = yypact_[yystate];
  704. if (!yy_pact_value_is_default_ (yyn))
  705. {
  706. yyn += yyterror_;
  707. if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
  708. {
  709. yyn = yytable_[yyn];
  710. if (0 < yyn)
  711. break;
  712. }
  713. }
  714. /* Pop the current state because it cannot handle the error token. */
  715. if (yystate_stack_.height () == 1)
  716. YYABORT;
  717. yyerror_range[1] = yylocation_stack_[0];
  718. yydestruct_ ("Error: popping",
  719. yystos_[yystate],
  720. &yysemantic_stack_[0], &yylocation_stack_[0]);
  721. yypop_ ();
  722. yystate = yystate_stack_[0];
  723. YY_STACK_PRINT ();
  724. }
  725. yyerror_range[2] = yylloc;
  726. // Using YYLLOC is tempting, but would change the location of
  727. // the lookahead. YYLOC is available though.
  728. YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
  729. yysemantic_stack_.push (yylval);
  730. yylocation_stack_.push (yyloc);
  731. /* Shift the error token. */
  732. YY_SYMBOL_PRINT ("Shifting", yystos_[yyn],
  733. &yysemantic_stack_[0], &yylocation_stack_[0]);
  734. yystate = yyn;
  735. goto yynewstate;
  736. /* Accept. */
  737. yyacceptlab:
  738. yyresult = 0;
  739. goto yyreturn;
  740. /* Abort. */
  741. yyabortlab:
  742. yyresult = 1;
  743. goto yyreturn;
  744. yyreturn:
  745. if (yychar != yyempty_)
  746. {
  747. /* Make sure we have latest lookahead translation. See comments
  748. at user semantic actions for why this is necessary. */
  749. yytoken = yytranslate_ (yychar);
  750. yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval,
  751. &yylloc);
  752. }
  753. /* Do not reclaim the symbols of the rule which action triggered
  754. this YYABORT or YYACCEPT. */
  755. yypop_ (yylen);
  756. while (yystate_stack_.height () != 1)
  757. {
  758. yydestruct_ ("Cleanup: popping",
  759. yystos_[yystate_stack_[0]],
  760. &yysemantic_stack_[0],
  761. &yylocation_stack_[0]);
  762. yypop_ ();
  763. }
  764. return yyresult;
  765. }
  766. // Generate an error message.
  767. std::string
  768. EasyMeshParser::yysyntax_error_ (int yystate, int yytoken)
  769. {
  770. std::string yyres;
  771. // Number of reported tokens (one for the "unexpected", one per
  772. // "expected").
  773. size_t yycount = 0;
  774. // Its maximum.
  775. enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
  776. // Arguments of yyformat.
  777. char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
  778. /* There are many possibilities here to consider:
  779. - If this state is a consistent state with a default action, then
  780. the only way this function was invoked is if the default action
  781. is an error action. In that case, don't check for expected
  782. tokens because there are none.
  783. - The only way there can be no lookahead present (in yytoken) is
  784. if this state is a consistent state with a default action.
  785. Thus, detecting the absence of a lookahead is sufficient to
  786. determine that there is no unexpected or expected token to
  787. report. In that case, just report a simple "syntax error".
  788. - Don't assume there isn't a lookahead just because this state is
  789. a consistent state with a default action. There might have
  790. been a previous inconsistent state, consistent state with a
  791. non-default action, or user semantic action that manipulated
  792. yychar.
  793. - Of course, the expected token list depends on states to have
  794. correct lookahead information, and it depends on the parser not
  795. to perform extra reductions after fetching a lookahead from the
  796. scanner and before detecting a syntax error. Thus, state
  797. merging (from LALR or IELR) and default reductions corrupt the
  798. expected token list. However, the list is correct for
  799. canonical LR with one exception: it will still contain any
  800. token that will not be accepted due to an error action in a
  801. later state.
  802. */
  803. if (yytoken != yyempty_)
  804. {
  805. yyarg[yycount++] = yytname_[yytoken];
  806. int yyn = yypact_[yystate];
  807. if (!yy_pact_value_is_default_ (yyn))
  808. {
  809. /* Start YYX at -YYN if negative to avoid negative indexes in
  810. YYCHECK. In other words, skip the first -YYN actions for
  811. this state because they are default actions. */
  812. int yyxbegin = yyn < 0 ? -yyn : 0;
  813. /* Stay within bounds of both yycheck and yytname. */
  814. int yychecklim = yylast_ - yyn + 1;
  815. int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
  816. for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
  817. if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_
  818. && !yy_table_value_is_error_ (yytable_[yyx + yyn]))
  819. {
  820. if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
  821. {
  822. yycount = 1;
  823. break;
  824. }
  825. else
  826. yyarg[yycount++] = yytname_[yyx];
  827. }
  828. }
  829. }
  830. char const* yyformat = 0;
  831. switch (yycount)
  832. {
  833. #define YYCASE_(N, S) \
  834. case N: \
  835. yyformat = S; \
  836. break
  837. YYCASE_(0, YY_("syntax error"));
  838. YYCASE_(1, YY_("syntax error, unexpected %s"));
  839. YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
  840. YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
  841. YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
  842. YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
  843. #undef YYCASE_
  844. }
  845. // Argument number.
  846. size_t yyi = 0;
  847. for (char const* yyp = yyformat; *yyp; ++yyp)
  848. if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount)
  849. {
  850. yyres += yytnamerr_ (yyarg[yyi++]);
  851. ++yyp;
  852. }
  853. else
  854. yyres += *yyp;
  855. return yyres;
  856. }
  857. /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
  858. STATE-NUM. */
  859. const signed char EasyMeshParser::yypact_ninf_ = -46;
  860. const signed char
  861. EasyMeshParser::yypact_[] =
  862. {
  863. 35, -30, -7, 72, 72, 72, 72, -46, 72, 72,
  864. 72, 72, -46, 72, 72, 72, 72, -46, 72, 72,
  865. 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
  866. 72, 72, 72, -46, 12, 15, 35, 35, 71, -46,
  867. -46, -46, -46, -46, -46, 72, 72, 72, 72, -46,
  868. -46, -46, -46, -46, -46, -46, -46, -46, -46, -46,
  869. -46, -46, -46, -46, -46, -46, -46, -46, 72, 72,
  870. -46, -46, -46, -46, -46, -46, -46, -46, -46, -46,
  871. -46, 72, 72, -46, -46, -46, -46, -22, -46, -46,
  872. -46, -46, -46, -46, -46, -46, -46, -46, -46
  873. };
  874. /* YYDEFACT[S] -- default reduction number in state S. Performed when
  875. YYTABLE doesn't specify something else to do. Zero means the
  876. default is an error. */
  877. const unsigned char
  878. EasyMeshParser::yydefact_[] =
  879. {
  880. 0, 0, 0, 0, 0, 0, 0, 33, 0, 0,
  881. 0, 0, 34, 0, 0, 0, 0, 35, 0, 0,
  882. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  883. 0, 0, 0, 7, 0, 0, 3, 0, 5, 9,
  884. 11, 12, 13, 56, 15, 0, 0, 0, 0, 14,
  885. 48, 17, 16, 19, 23, 26, 29, 20, 24, 27,
  886. 30, 21, 25, 28, 31, 22, 32, 18, 0, 0,
  887. 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
  888. 46, 0, 0, 47, 1, 2, 4, 0, 10, 57,
  889. 49, 50, 51, 52, 53, 54, 55, 8, 6
  890. };
  891. /* YYPGOTO[NTERM-NUM]. */
  892. const signed char
  893. EasyMeshParser::yypgoto_[] =
  894. {
  895. -46, -46, -2, -46, -46, -46, -46, -18, -46, -46,
  896. -46, 5, 40, 101, 3, -5, 0, -46, -46, -45
  897. };
  898. /* YYDEFGOTO[NTERM-NUM]. */
  899. const signed char
  900. EasyMeshParser::yydefgoto_[] =
  901. {
  902. -1, 34, 35, 36, 37, 98, 38, 39, 40, 41,
  903. 42, 46, 47, 48, 68, 69, 70, 82, 83, 50
  904. };
  905. /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
  906. positive, shift that token. If negative, reduce the rule which
  907. number is the opposite. If YYTABLE_NINF_, syntax error. */
  908. const signed char EasyMeshParser::yytable_ninf_ = -1;
  909. const unsigned char
  910. EasyMeshParser::yytable_[] =
  911. {
  912. 89, 90, 91, 92, 49, 52, 43, 44, 53, 54,
  913. 45, 56, 84, 57, 58, 85, 60, 97, 61, 62,
  914. 88, 64, 76, 93, 94, 67, 72, 73, 74, 43,
  915. 51, 77, 81, 45, 86, 87, 95, 96, 1, 2,
  916. 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
  917. 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
  918. 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
  919. 79, 80, 0, 33, 1, 2, 3, 4, 5, 6,
  920. 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
  921. 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
  922. 27, 28, 29, 30, 31, 32, 55, 0, 43, 0,
  923. 0, 59, 45, 0, 0, 0, 63, 0, 0, 65,
  924. 66, 0, 0, 71, 0, 0, 0, 75, 0, 0,
  925. 78
  926. };
  927. /* YYCHECK. */
  928. const signed char
  929. EasyMeshParser::yycheck_[] =
  930. {
  931. 45, 46, 47, 48, 1, 2, 36, 37, 3, 4,
  932. 40, 6, 0, 8, 9, 0, 11, 39, 13, 14,
  933. 38, 16, 27, 68, 69, 20, 23, 24, 25, 36,
  934. 37, 28, 32, 40, 36, 37, 81, 82, 3, 4,
  935. 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
  936. 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
  937. 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
  938. 30, 31, -1, 38, 3, 4, 5, 6, 7, 8,
  939. 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
  940. 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
  941. 29, 30, 31, 32, 33, 34, 5, -1, 36, -1,
  942. -1, 10, 40, -1, -1, -1, 15, -1, -1, 18,
  943. 19, -1, -1, 22, -1, -1, -1, 26, -1, -1,
  944. 29
  945. };
  946. /* STOS_[STATE-NUM] -- The (internal number of the) accessing
  947. symbol of state STATE-NUM. */
  948. const unsigned char
  949. EasyMeshParser::yystos_[] =
  950. {
  951. 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
  952. 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
  953. 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  954. 32, 33, 34, 38, 42, 43, 44, 45, 47, 48,
  955. 49, 50, 51, 36, 37, 40, 52, 53, 54, 55,
  956. 60, 37, 55, 52, 52, 54, 52, 52, 52, 54,
  957. 52, 52, 52, 54, 52, 54, 54, 52, 55, 56,
  958. 57, 54, 55, 55, 55, 54, 56, 55, 54, 53,
  959. 53, 57, 58, 59, 0, 0, 43, 43, 48, 60,
  960. 60, 60, 60, 60, 60, 60, 60, 39, 46
  961. };
  962. #if YYDEBUG
  963. /* TOKEN_NUMBER_[YYLEX-NUM] -- Internal symbol number corresponding
  964. to YYLEX-NUM. */
  965. const unsigned short int
  966. EasyMeshParser::yytoken_number_[] =
  967. {
  968. 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
  969. 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
  970. 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
  971. 285, 286, 287, 288, 289, 290, 291, 292, 91, 93,
  972. 45
  973. };
  974. #endif
  975. /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
  976. const unsigned char
  977. EasyMeshParser::yyr1_[] =
  978. {
  979. 0, 41, 42, 43, 43, 44, 44, 45, 46, 47,
  980. 47, 48, 48, 48, 49, 49, 49, 49, 50, 50,
  981. 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
  982. 50, 50, 50, 50, 50, 50, 51, 51, 51, 51,
  983. 51, 51, 51, 51, 51, 51, 51, 51, 52, 53,
  984. 54, 55, 56, 57, 58, 59, 60, 60
  985. };
  986. /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
  987. const unsigned char
  988. EasyMeshParser::yyr2_[] =
  989. {
  990. 0, 2, 2, 1, 2, 1, 3, 1, 1, 1,
  991. 2, 1, 1, 1, 2, 2, 2, 2, 2, 2,
  992. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  993. 2, 2, 2, 1, 1, 1, 2, 2, 2, 2,
  994. 2, 2, 2, 2, 2, 2, 2, 2, 1, 2,
  995. 2, 2, 2, 2, 2, 2, 1, 2
  996. };
  997. #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
  998. /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
  999. First, the terminals, then, starting at \a yyntokens_, nonterminals. */
  1000. const char*
  1001. const EasyMeshParser::yytname_[] =
  1002. {
  1003. "T_END", "error", "$undefined", "T_COLOR", "T_BGCOLOR", "T_TRANSLATEX",
  1004. "T_ROTATEX", "T_TAPERX", "T_SCALEX", "T_MIRRORX", "T_TRANSLATEY",
  1005. "T_ROTATEY", "T_TAPERY", "T_SCALEY", "T_MIRRORY", "T_TRANSLATEZ",
  1006. "T_ROTATEZ", "T_TAPERZ", "T_SCALEZ", "T_MIRRORZ", "T_TRANSLATE",
  1007. "T_SCALE", "T_CHAMFER", "T_CYLINDER", "T_BOX", "T_SMOOTHCHAMFBOX",
  1008. "T_FLATCHAMFBOX", "T_SPHERE", "T_CAPSULE", "T_STAR", "T_EXPANDEDSTAR",
  1009. "T_DISC", "T_TRIANGLE", "T_QUAD", "T_COG", "T_ERROR", "NUMBER", "COLOR",
  1010. "'['", "']'", "'-'", "$accept", "mesh_description",
  1011. "mesh_expression_list", "mesh_expression", "mesh_open", "mesh_close",
  1012. "mesh_command_list", "mesh_command", "color_command",
  1013. "transform_command", "primitive_command", "args1", "args2", "args3",
  1014. "args4", "args5", "args6", "args7", "args8", "number", 0
  1015. };
  1016. #endif
  1017. #if YYDEBUG
  1018. /* YYRHS -- A `-1'-separated list of the rules' RHS. */
  1019. const EasyMeshParser::rhs_number_type
  1020. EasyMeshParser::yyrhs_[] =
  1021. {
  1022. 42, 0, -1, 43, 0, -1, 44, -1, 44, 43,
  1023. -1, 47, -1, 45, 43, 46, -1, 38, -1, 39,
  1024. -1, 48, -1, 47, 48, -1, 49, -1, 50, -1,
  1025. 51, -1, 3, 55, -1, 3, 37, -1, 4, 55,
  1026. -1, 4, 37, -1, 22, 52, -1, 5, 52, -1,
  1027. 10, 52, -1, 15, 52, -1, 20, 54, -1, 6,
  1028. 52, -1, 11, 52, -1, 16, 52, -1, 7, 54,
  1029. -1, 12, 54, -1, 17, 54, -1, 8, 52, -1,
  1030. 13, 52, -1, 18, 52, -1, 21, 54, -1, 9,
  1031. -1, 14, -1, 19, -1, 23, 57, -1, 24, 54,
  1032. -1, 25, 55, -1, 26, 55, -1, 27, 55, -1,
  1033. 28, 54, -1, 29, 56, -1, 30, 55, -1, 31,
  1034. 54, -1, 32, 53, -1, 33, 53, -1, 34, 59,
  1035. -1, 60, -1, 52, 60, -1, 53, 60, -1, 54,
  1036. 60, -1, 55, 60, -1, 56, 60, -1, 57, 60,
  1037. -1, 58, 60, -1, 36, -1, 40, 60, -1
  1038. };
  1039. /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
  1040. YYRHS. */
  1041. const unsigned char
  1042. EasyMeshParser::yyprhs_[] =
  1043. {
  1044. 0, 0, 3, 6, 8, 11, 13, 17, 19, 21,
  1045. 23, 26, 28, 30, 32, 35, 38, 41, 44, 47,
  1046. 50, 53, 56, 59, 62, 65, 68, 71, 74, 77,
  1047. 80, 83, 86, 89, 91, 93, 95, 98, 101, 104,
  1048. 107, 110, 113, 116, 119, 122, 125, 128, 131, 133,
  1049. 136, 139, 142, 145, 148, 151, 154, 156
  1050. };
  1051. /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
  1052. const unsigned char
  1053. EasyMeshParser::yyrline_[] =
  1054. {
  1055. 0, 75, 75, 79, 80, 84, 85, 89, 93, 97,
  1056. 98, 102, 103, 104, 108, 109, 112, 113, 119, 120,
  1057. 121, 122, 123, 124, 125, 126, 127, 128, 129, 130,
  1058. 131, 132, 133, 134, 135, 136, 140, 143, 144, 146,
  1059. 148, 150, 151, 153, 155, 156, 157, 158, 162, 163,
  1060. 164, 165, 166, 167, 168, 169, 172, 173
  1061. };
  1062. // Print the state stack on the debug stream.
  1063. void
  1064. EasyMeshParser::yystack_print_ ()
  1065. {
  1066. *yycdebug_ << "Stack now";
  1067. for (state_stack_type::const_iterator i = yystate_stack_.begin ();
  1068. i != yystate_stack_.end (); ++i)
  1069. *yycdebug_ << ' ' << *i;
  1070. *yycdebug_ << std::endl;
  1071. }
  1072. // Report on the debug stream that the rule \a yyrule is going to be reduced.
  1073. void
  1074. EasyMeshParser::yy_reduce_print_ (int yyrule)
  1075. {
  1076. unsigned int yylno = yyrline_[yyrule];
  1077. int yynrhs = yyr2_[yyrule];
  1078. /* Print the symbols being reduced, and their result. */
  1079. *yycdebug_ << "Reducing stack by rule " << yyrule - 1
  1080. << " (line " << yylno << "):" << std::endl;
  1081. /* The symbols being reduced. */
  1082. for (int yyi = 0; yyi < yynrhs; yyi++)
  1083. YY_SYMBOL_PRINT (" $" << yyi + 1 << " =",
  1084. yyrhs_[yyprhs_[yyrule] + yyi],
  1085. &(yysemantic_stack_[(yynrhs) - (yyi + 1)]),
  1086. &(yylocation_stack_[(yynrhs) - (yyi + 1)]));
  1087. }
  1088. #endif // YYDEBUG
  1089. /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
  1090. EasyMeshParser::token_number_type
  1091. EasyMeshParser::yytranslate_ (int t)
  1092. {
  1093. static
  1094. const token_number_type
  1095. translate_table[] =
  1096. {
  1097. 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1098. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1099. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1100. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1101. 2, 2, 2, 2, 2, 40, 2, 2, 2, 2,
  1102. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1103. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1104. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1105. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1106. 2, 38, 2, 39, 2, 2, 2, 2, 2, 2,
  1107. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1108. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1109. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1110. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1111. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1112. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1113. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1114. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1115. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1116. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1117. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1118. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1119. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1120. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1121. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1122. 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
  1123. 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
  1124. 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
  1125. 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
  1126. 35, 36, 37
  1127. };
  1128. if ((unsigned int) t <= yyuser_token_number_max_)
  1129. return translate_table[t];
  1130. else
  1131. return yyundef_token_;
  1132. }
  1133. const int EasyMeshParser::yyeof_ = 0;
  1134. const int EasyMeshParser::yylast_ = 130;
  1135. const int EasyMeshParser::yynnts_ = 20;
  1136. const int EasyMeshParser::yyempty_ = -2;
  1137. const int EasyMeshParser::yyfinal_ = 84;
  1138. const int EasyMeshParser::yyterror_ = 1;
  1139. const int EasyMeshParser::yyerrcode_ = 256;
  1140. const int EasyMeshParser::yyntokens_ = 41;
  1141. const unsigned int EasyMeshParser::yyuser_token_number_max_ = 292;
  1142. const EasyMeshParser::token_number_type EasyMeshParser::yyundef_token_ = 2;
  1143. } // lol
  1144. /* Line 1136 of lalr1.cc */
  1145. #line 1385 "generated/easymesh-parser.cpp"
  1146. /* Line 1138 of lalr1.cc */
  1147. #line 176 "easymesh/easymesh-parser.y"
  1148. void lol::EasyMeshParser::error(const EasyMeshParser::location_type& l,
  1149. const std::string& m)
  1150. {
  1151. mc.Error(l, m);
  1152. }