1627 行
54 KiB

  1. /* A Bison parser, made by GNU Bison 2.4.2. */
  2. /* Skeleton implementation for Bison LALR(1) parsers in C++
  3. Copyright (C) 2002-2010 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 310 of lalr1.cc */
  29. #line 1 "easymesh/easymesh-parser.y"
  30. //
  31. // Lol Engine
  32. //
  33. // Copyright: (c) 2010-2013 Sam Hocevar <sam@hocevar.net>
  34. // (c) 2009-2013 Cédric Lecacheur <jordx@free.fr>
  35. // (c) 2009-2013 Benjamin "Touky" 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://www.wtfpl.net/ 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 310 of lalr1.cc */
  48. #line 65 "generated/easymesh-parser.cpp"
  49. #include "easymesh-parser.h"
  50. /* User implementation prologue. */
  51. /* Line 316 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. /* HACK: workaround for Bison who insists on using exceptions */
  57. #define try if (true)
  58. #define catch(...) if (false)
  59. #define throw (void)0
  60. /* Line 316 of lalr1.cc */
  61. #line 87 "generated/easymesh-parser.cpp"
  62. #ifndef YY_
  63. # if defined YYENABLE_NLS && YYENABLE_NLS
  64. # if ENABLE_NLS
  65. # include <libintl.h> /* FIXME: INFRINGES ON USER NAME SPACE */
  66. # define YY_(msgid) dgettext ("bison-runtime", msgid)
  67. # endif
  68. # endif
  69. # ifndef YY_
  70. # define YY_(msgid) msgid
  71. # endif
  72. #endif
  73. /* Suppress unused-variable warnings by "using" E. */
  74. #define YYUSE(e) ((void) (e))
  75. /* Enable debugging if requested. */
  76. #if YYDEBUG
  77. /* A pseudo ostream that takes yydebug_ into account. */
  78. # define YYCDEBUG if (yydebug_) (*yycdebug_)
  79. # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
  80. do { \
  81. if (yydebug_) \
  82. { \
  83. *yycdebug_ << Title << ' '; \
  84. yy_symbol_print_ ((Type), (Value), (Location)); \
  85. *yycdebug_ << std::endl; \
  86. } \
  87. } while (false)
  88. # define YY_REDUCE_PRINT(Rule) \
  89. do { \
  90. if (yydebug_) \
  91. yy_reduce_print_ (Rule); \
  92. } while (false)
  93. # define YY_STACK_PRINT() \
  94. do { \
  95. if (yydebug_) \
  96. yystack_print_ (); \
  97. } while (false)
  98. #else /* !YYDEBUG */
  99. # define YYCDEBUG if (false) std::cerr
  100. # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
  101. # define YY_REDUCE_PRINT(Rule)
  102. # define YY_STACK_PRINT()
  103. #endif /* !YYDEBUG */
  104. #define yyerrok (yyerrstatus_ = 0)
  105. #define yyclearin (yychar = yyempty_)
  106. #define YYACCEPT goto yyacceptlab
  107. #define YYABORT goto yyabortlab
  108. #define YYERROR goto yyerrorlab
  109. #define YYRECOVERING() (!!yyerrstatus_)
  110. namespace lol {
  111. /* Line 379 of lalr1.cc */
  112. #line 153 "generated/easymesh-parser.cpp"
  113. #if YYERROR_VERBOSE
  114. /* Return YYSTR after stripping away unnecessary quotes and
  115. backslashes, so that it's suitable for yyerror. The heuristic is
  116. that double-quoting is unnecessary unless the string contains an
  117. apostrophe, a comma, or backslash (other than backslash-backslash).
  118. YYSTR is taken from yytname. */
  119. std::string
  120. EasyMeshParser::yytnamerr_ (const char *yystr)
  121. {
  122. if (*yystr == '"')
  123. {
  124. std::string yyr = "";
  125. char const *yyp = yystr;
  126. for (;;)
  127. switch (*++yyp)
  128. {
  129. case '\'':
  130. case ',':
  131. goto do_not_strip_quotes;
  132. case '\\':
  133. if (*++yyp != '\\')
  134. goto do_not_strip_quotes;
  135. /* Fall through. */
  136. default:
  137. yyr += *yyp;
  138. break;
  139. case '"':
  140. return yyr;
  141. }
  142. do_not_strip_quotes: ;
  143. }
  144. return yystr;
  145. }
  146. #endif
  147. /// Build a parser object.
  148. EasyMeshParser::EasyMeshParser (class EasyMeshCompiler& mc_yyarg)
  149. :
  150. #if YYDEBUG
  151. yydebug_ (false),
  152. yycdebug_ (&std::cerr),
  153. #endif
  154. mc (mc_yyarg)
  155. {
  156. }
  157. EasyMeshParser::~EasyMeshParser ()
  158. {
  159. }
  160. #if YYDEBUG
  161. /*--------------------------------.
  162. | Print this symbol on YYOUTPUT. |
  163. `--------------------------------*/
  164. inline void
  165. EasyMeshParser::yy_symbol_value_print_ (int yytype,
  166. const semantic_type* yyvaluep, const location_type* yylocationp)
  167. {
  168. YYUSE (yylocationp);
  169. YYUSE (yyvaluep);
  170. switch (yytype)
  171. {
  172. default:
  173. break;
  174. }
  175. }
  176. void
  177. EasyMeshParser::yy_symbol_print_ (int yytype,
  178. const semantic_type* yyvaluep, const location_type* yylocationp)
  179. {
  180. *yycdebug_ << (yytype < yyntokens_ ? "token" : "nterm")
  181. << ' ' << yytname_[yytype] << " ("
  182. << *yylocationp << ": ";
  183. yy_symbol_value_print_ (yytype, yyvaluep, yylocationp);
  184. *yycdebug_ << ')';
  185. }
  186. #endif
  187. void
  188. EasyMeshParser::yydestruct_ (const char* yymsg,
  189. int yytype, semantic_type* yyvaluep, location_type* yylocationp)
  190. {
  191. YYUSE (yylocationp);
  192. YYUSE (yymsg);
  193. YYUSE (yyvaluep);
  194. YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
  195. switch (yytype)
  196. {
  197. default:
  198. break;
  199. }
  200. }
  201. void
  202. EasyMeshParser::yypop_ (unsigned int n)
  203. {
  204. yystate_stack_.pop (n);
  205. yysemantic_stack_.pop (n);
  206. yylocation_stack_.pop (n);
  207. }
  208. #if YYDEBUG
  209. std::ostream&
  210. EasyMeshParser::debug_stream () const
  211. {
  212. return *yycdebug_;
  213. }
  214. void
  215. EasyMeshParser::set_debug_stream (std::ostream& o)
  216. {
  217. yycdebug_ = &o;
  218. }
  219. EasyMeshParser::debug_level_type
  220. EasyMeshParser::debug_level () const
  221. {
  222. return yydebug_;
  223. }
  224. void
  225. EasyMeshParser::set_debug_level (debug_level_type l)
  226. {
  227. yydebug_ = l;
  228. }
  229. #endif
  230. int
  231. EasyMeshParser::parse ()
  232. {
  233. /// Lookahead and lookahead in internal form.
  234. int yychar = yyempty_;
  235. int yytoken = 0;
  236. /* State. */
  237. int yyn;
  238. int yylen = 0;
  239. int yystate = 0;
  240. /* Error handling. */
  241. int yynerrs_ = 0;
  242. int yyerrstatus_ = 0;
  243. /// Semantic value of the lookahead.
  244. semantic_type yylval;
  245. /// Location of the lookahead.
  246. location_type yylloc;
  247. /// The locations where the error started and ended.
  248. location_type yyerror_range[2];
  249. /// $$.
  250. semantic_type yyval;
  251. /// @$.
  252. location_type yyloc;
  253. int yyresult;
  254. YYCDEBUG << "Starting parse" << std::endl;
  255. /* Initialize the stacks. The initial state will be pushed in
  256. yynewstate, since the latter expects the semantical and the
  257. location values to have been already stored, initialize these
  258. stacks with a primary value. */
  259. yystate_stack_ = state_stack_type (0);
  260. yysemantic_stack_ = semantic_stack_type (0);
  261. yylocation_stack_ = location_stack_type (0);
  262. yysemantic_stack_.push (yylval);
  263. yylocation_stack_.push (yylloc);
  264. /* New state. */
  265. yynewstate:
  266. yystate_stack_.push (yystate);
  267. YYCDEBUG << "Entering state " << yystate << std::endl;
  268. /* Accept? */
  269. if (yystate == yyfinal_)
  270. goto yyacceptlab;
  271. goto yybackup;
  272. /* Backup. */
  273. yybackup:
  274. /* Try to take a decision without lookahead. */
  275. yyn = yypact_[yystate];
  276. if (yyn == yypact_ninf_)
  277. goto yydefault;
  278. /* Read a lookahead token. */
  279. if (yychar == yyempty_)
  280. {
  281. YYCDEBUG << "Reading a token: ";
  282. yychar = yylex (&yylval, &yylloc);
  283. }
  284. /* Convert token to internal form. */
  285. if (yychar <= yyeof_)
  286. {
  287. yychar = yytoken = yyeof_;
  288. YYCDEBUG << "Now at end of input." << std::endl;
  289. }
  290. else
  291. {
  292. yytoken = yytranslate_ (yychar);
  293. YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
  294. }
  295. /* If the proper action on seeing token YYTOKEN is to reduce or to
  296. detect an error, take that action. */
  297. yyn += yytoken;
  298. if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yytoken)
  299. goto yydefault;
  300. /* Reduce or error. */
  301. yyn = yytable_[yyn];
  302. if (yyn <= 0)
  303. {
  304. if (yyn == 0 || yyn == yytable_ninf_)
  305. goto yyerrlab;
  306. yyn = -yyn;
  307. goto yyreduce;
  308. }
  309. /* Shift the lookahead token. */
  310. YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
  311. /* Discard the token being shifted. */
  312. yychar = yyempty_;
  313. yysemantic_stack_.push (yylval);
  314. yylocation_stack_.push (yylloc);
  315. /* Count tokens shifted since error; after three, turn off error
  316. status. */
  317. if (yyerrstatus_)
  318. --yyerrstatus_;
  319. yystate = yyn;
  320. goto yynewstate;
  321. /*-----------------------------------------------------------.
  322. | yydefault -- do the default action for the current state. |
  323. `-----------------------------------------------------------*/
  324. yydefault:
  325. yyn = yydefact_[yystate];
  326. if (yyn == 0)
  327. goto yyerrlab;
  328. goto yyreduce;
  329. /*-----------------------------.
  330. | yyreduce -- Do a reduction. |
  331. `-----------------------------*/
  332. yyreduce:
  333. yylen = yyr2_[yyn];
  334. /* If YYLEN is nonzero, implement the default value of the action:
  335. `$$ = $1'. Otherwise, use the top of the stack.
  336. Otherwise, the following line sets YYVAL to garbage.
  337. This behavior is undocumented and Bison
  338. users should not rely upon it. */
  339. if (yylen)
  340. yyval = yysemantic_stack_[yylen - 1];
  341. else
  342. yyval = yysemantic_stack_[0];
  343. {
  344. slice<location_type, location_stack_type> slice (yylocation_stack_, yylen);
  345. YYLLOC_DEFAULT (yyloc, slice, yylen);
  346. }
  347. YY_REDUCE_PRINT (yyn);
  348. switch (yyn)
  349. {
  350. case 7:
  351. /* Line 677 of lalr1.cc */
  352. #line 94 "easymesh/easymesh-parser.y"
  353. { mc.m_mesh.OpenBrace(); }
  354. break;
  355. case 8:
  356. /* Line 677 of lalr1.cc */
  357. #line 98 "easymesh/easymesh-parser.y"
  358. { mc.m_mesh.CloseBrace(); }
  359. break;
  360. case 14:
  361. /* Line 677 of lalr1.cc */
  362. #line 113 "easymesh/easymesh-parser.y"
  363. { 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)); }
  364. break;
  365. case 15:
  366. /* Line 677 of lalr1.cc */
  367. #line 114 "easymesh/easymesh-parser.y"
  368. { uint32_t x = (yysemantic_stack_[(2) - (2)].u32val);
  369. vec4 v(x >> 24, (x >> 16) & 0xff, (x >> 8) & 0xff, x & 0xff);
  370. mc.m_mesh.SetCurColor(vec4(v) * (1.f / 255)); }
  371. break;
  372. case 16:
  373. /* Line 677 of lalr1.cc */
  374. #line 117 "easymesh/easymesh-parser.y"
  375. { 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)); }
  376. break;
  377. case 17:
  378. /* Line 677 of lalr1.cc */
  379. #line 118 "easymesh/easymesh-parser.y"
  380. { uint32_t x = (yysemantic_stack_[(2) - (2)].u32val);
  381. vec4 v(x >> 24, (x >> 16) & 0xff, (x >> 8) & 0xff, x & 0xff);
  382. mc.m_mesh.SetCurColor2(vec4(v) * (1.f / 255)); }
  383. break;
  384. case 18:
  385. /* Line 677 of lalr1.cc */
  386. #line 124 "easymesh/easymesh-parser.y"
  387. { mc.m_mesh.Chamfer((yysemantic_stack_[(2) - (2)].args).f0); }
  388. break;
  389. case 19:
  390. /* Line 677 of lalr1.cc */
  391. #line 125 "easymesh/easymesh-parser.y"
  392. { mc.m_mesh.Translate(vec3((yysemantic_stack_[(2) - (2)].args).f0, 0, 0)); }
  393. break;
  394. case 20:
  395. /* Line 677 of lalr1.cc */
  396. #line 126 "easymesh/easymesh-parser.y"
  397. { mc.m_mesh.Translate(vec3(0, (yysemantic_stack_[(2) - (2)].args).f0, 0)); }
  398. break;
  399. case 21:
  400. /* Line 677 of lalr1.cc */
  401. #line 127 "easymesh/easymesh-parser.y"
  402. { mc.m_mesh.Translate(vec3(0, 0, (yysemantic_stack_[(2) - (2)].args).f0)); }
  403. break;
  404. case 22:
  405. /* Line 677 of lalr1.cc */
  406. #line 128 "easymesh/easymesh-parser.y"
  407. { mc.m_mesh.Translate(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); }
  408. break;
  409. case 23:
  410. /* Line 677 of lalr1.cc */
  411. #line 129 "easymesh/easymesh-parser.y"
  412. { mc.m_mesh.RotateX((yysemantic_stack_[(2) - (2)].args).f0); }
  413. break;
  414. case 24:
  415. /* Line 677 of lalr1.cc */
  416. #line 130 "easymesh/easymesh-parser.y"
  417. { mc.m_mesh.RotateY((yysemantic_stack_[(2) - (2)].args).f0); }
  418. break;
  419. case 25:
  420. /* Line 677 of lalr1.cc */
  421. #line 131 "easymesh/easymesh-parser.y"
  422. { mc.m_mesh.RotateZ((yysemantic_stack_[(2) - (2)].args).f0); }
  423. break;
  424. case 26:
  425. /* Line 677 of lalr1.cc */
  426. #line 132 "easymesh/easymesh-parser.y"
  427. { mc.m_mesh.TaperX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
  428. break;
  429. case 27:
  430. /* Line 677 of lalr1.cc */
  431. #line 133 "easymesh/easymesh-parser.y"
  432. { mc.m_mesh.TaperX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3); }
  433. break;
  434. case 28:
  435. /* Line 677 of lalr1.cc */
  436. #line 134 "easymesh/easymesh-parser.y"
  437. { mc.m_mesh.TaperY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
  438. break;
  439. case 29:
  440. /* Line 677 of lalr1.cc */
  441. #line 135 "easymesh/easymesh-parser.y"
  442. { mc.m_mesh.TaperY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3); }
  443. break;
  444. case 30:
  445. /* Line 677 of lalr1.cc */
  446. #line 136 "easymesh/easymesh-parser.y"
  447. { mc.m_mesh.TaperZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
  448. break;
  449. case 31:
  450. /* Line 677 of lalr1.cc */
  451. #line 137 "easymesh/easymesh-parser.y"
  452. { mc.m_mesh.TaperZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3); }
  453. break;
  454. case 32:
  455. /* Line 677 of lalr1.cc */
  456. #line 138 "easymesh/easymesh-parser.y"
  457. { mc.m_mesh.TwistX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); }
  458. break;
  459. case 33:
  460. /* Line 677 of lalr1.cc */
  461. #line 139 "easymesh/easymesh-parser.y"
  462. { mc.m_mesh.TwistY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); }
  463. break;
  464. case 34:
  465. /* Line 677 of lalr1.cc */
  466. #line 140 "easymesh/easymesh-parser.y"
  467. { mc.m_mesh.TwistZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); }
  468. break;
  469. case 35:
  470. /* Line 677 of lalr1.cc */
  471. #line 141 "easymesh/easymesh-parser.y"
  472. { mc.m_mesh.ShearX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
  473. break;
  474. case 36:
  475. /* Line 677 of lalr1.cc */
  476. #line 142 "easymesh/easymesh-parser.y"
  477. { mc.m_mesh.ShearX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3); }
  478. break;
  479. case 37:
  480. /* Line 677 of lalr1.cc */
  481. #line 143 "easymesh/easymesh-parser.y"
  482. { mc.m_mesh.ShearY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
  483. break;
  484. case 38:
  485. /* Line 677 of lalr1.cc */
  486. #line 144 "easymesh/easymesh-parser.y"
  487. { mc.m_mesh.ShearY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3); }
  488. break;
  489. case 39:
  490. /* Line 677 of lalr1.cc */
  491. #line 145 "easymesh/easymesh-parser.y"
  492. { mc.m_mesh.ShearZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
  493. break;
  494. case 40:
  495. /* Line 677 of lalr1.cc */
  496. #line 146 "easymesh/easymesh-parser.y"
  497. { mc.m_mesh.ShearZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3); }
  498. break;
  499. case 41:
  500. /* Line 677 of lalr1.cc */
  501. #line 147 "easymesh/easymesh-parser.y"
  502. { mc.m_mesh.StretchX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
  503. break;
  504. case 42:
  505. /* Line 677 of lalr1.cc */
  506. #line 148 "easymesh/easymesh-parser.y"
  507. { mc.m_mesh.StretchY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
  508. break;
  509. case 43:
  510. /* Line 677 of lalr1.cc */
  511. #line 149 "easymesh/easymesh-parser.y"
  512. { mc.m_mesh.StretchZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
  513. break;
  514. case 44:
  515. /* Line 677 of lalr1.cc */
  516. #line 150 "easymesh/easymesh-parser.y"
  517. { mc.m_mesh.BendXY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); }
  518. break;
  519. case 45:
  520. /* Line 677 of lalr1.cc */
  521. #line 151 "easymesh/easymesh-parser.y"
  522. { mc.m_mesh.BendXZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); }
  523. break;
  524. case 46:
  525. /* Line 677 of lalr1.cc */
  526. #line 152 "easymesh/easymesh-parser.y"
  527. { mc.m_mesh.BendYX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); }
  528. break;
  529. case 47:
  530. /* Line 677 of lalr1.cc */
  531. #line 153 "easymesh/easymesh-parser.y"
  532. { mc.m_mesh.BendYZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); }
  533. break;
  534. case 48:
  535. /* Line 677 of lalr1.cc */
  536. #line 154 "easymesh/easymesh-parser.y"
  537. { mc.m_mesh.BendZX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); }
  538. break;
  539. case 49:
  540. /* Line 677 of lalr1.cc */
  541. #line 155 "easymesh/easymesh-parser.y"
  542. { mc.m_mesh.BendZY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); }
  543. break;
  544. case 50:
  545. /* Line 677 of lalr1.cc */
  546. #line 156 "easymesh/easymesh-parser.y"
  547. { mc.m_mesh.Scale(vec3((yysemantic_stack_[(2) - (2)].args).f0, 1.0, 1.0)); }
  548. break;
  549. case 51:
  550. /* Line 677 of lalr1.cc */
  551. #line 157 "easymesh/easymesh-parser.y"
  552. { mc.m_mesh.Scale(vec3(1.0, (yysemantic_stack_[(2) - (2)].args).f0, 1.0)); }
  553. break;
  554. case 52:
  555. /* Line 677 of lalr1.cc */
  556. #line 158 "easymesh/easymesh-parser.y"
  557. { mc.m_mesh.Scale(vec3(1.0, 1.0, (yysemantic_stack_[(2) - (2)].args).f0)); }
  558. break;
  559. case 53:
  560. /* Line 677 of lalr1.cc */
  561. #line 159 "easymesh/easymesh-parser.y"
  562. { mc.m_mesh.Scale(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); }
  563. break;
  564. case 54:
  565. /* Line 677 of lalr1.cc */
  566. #line 160 "easymesh/easymesh-parser.y"
  567. { mc.m_mesh.MirrorX(); }
  568. break;
  569. case 55:
  570. /* Line 677 of lalr1.cc */
  571. #line 161 "easymesh/easymesh-parser.y"
  572. { mc.m_mesh.MirrorY(); }
  573. break;
  574. case 56:
  575. /* Line 677 of lalr1.cc */
  576. #line 162 "easymesh/easymesh-parser.y"
  577. { mc.m_mesh.MirrorZ(); }
  578. break;
  579. case 57:
  580. /* Line 677 of lalr1.cc */
  581. #line 163 "easymesh/easymesh-parser.y"
  582. { mc.m_mesh.RadialJitter((yysemantic_stack_[(2) - (2)].args).f0); }
  583. break;
  584. case 58:
  585. /* Line 677 of lalr1.cc */
  586. #line 164 "easymesh/easymesh-parser.y"
  587. { mc.m_mesh.SplitTriangles((yysemantic_stack_[(2) - (2)].args).f0); }
  588. break;
  589. case 59:
  590. /* Line 677 of lalr1.cc */
  591. #line 165 "easymesh/easymesh-parser.y"
  592. { mc.m_mesh.SmoothMesh((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
  593. break;
  594. case 60:
  595. /* Line 677 of lalr1.cc */
  596. #line 166 "easymesh/easymesh-parser.y"
  597. { mc.m_mesh.ToggleScaleWinding(); }
  598. break;
  599. case 61:
  600. /* Line 677 of lalr1.cc */
  601. #line 167 "easymesh/easymesh-parser.y"
  602. { mc.m_mesh.CsgUnion(); }
  603. break;
  604. case 62:
  605. /* Line 677 of lalr1.cc */
  606. #line 168 "easymesh/easymesh-parser.y"
  607. { mc.m_mesh.CsgSubstract(); }
  608. break;
  609. case 63:
  610. /* Line 677 of lalr1.cc */
  611. #line 169 "easymesh/easymesh-parser.y"
  612. { mc.m_mesh.CsgSubstractLoss(); }
  613. break;
  614. case 64:
  615. /* Line 677 of lalr1.cc */
  616. #line 170 "easymesh/easymesh-parser.y"
  617. { mc.m_mesh.CsgAnd(); }
  618. break;
  619. case 65:
  620. /* Line 677 of lalr1.cc */
  621. #line 171 "easymesh/easymesh-parser.y"
  622. { mc.m_mesh.CsgXor(); }
  623. break;
  624. case 66:
  625. /* Line 677 of lalr1.cc */
  626. #line 175 "easymesh/easymesh-parser.y"
  627. { mc.m_mesh.AppendCylinder((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
  628. (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3,
  629. (int)(yysemantic_stack_[(2) - (2)].args).f4, (int)(yysemantic_stack_[(2) - (2)].args).f5, 0); }
  630. break;
  631. case 67:
  632. /* Line 677 of lalr1.cc */
  633. #line 178 "easymesh/easymesh-parser.y"
  634. { mc.m_mesh.AppendCylinder((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
  635. (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3,
  636. (int)(yysemantic_stack_[(2) - (2)].args).f4, (int)(yysemantic_stack_[(2) - (2)].args).f5, (int)(yysemantic_stack_[(2) - (2)].args).f6); }
  637. break;
  638. case 68:
  639. /* Line 677 of lalr1.cc */
  640. #line 181 "easymesh/easymesh-parser.y"
  641. { mc.m_mesh.AppendBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); }
  642. break;
  643. case 69:
  644. /* Line 677 of lalr1.cc */
  645. #line 182 "easymesh/easymesh-parser.y"
  646. { mc.m_mesh.AppendSmoothChamfBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
  647. (yysemantic_stack_[(2) - (2)].args).f2), (yysemantic_stack_[(2) - (2)].args).f3); }
  648. break;
  649. case 70:
  650. /* Line 677 of lalr1.cc */
  651. #line 184 "easymesh/easymesh-parser.y"
  652. { mc.m_mesh.AppendFlatChamfBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
  653. (yysemantic_stack_[(2) - (2)].args).f2), (yysemantic_stack_[(2) - (2)].args).f3); }
  654. break;
  655. case 71:
  656. /* Line 677 of lalr1.cc */
  657. #line 186 "easymesh/easymesh-parser.y"
  658. { mc.m_mesh.AppendSphere((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); }
  659. break;
  660. case 72:
  661. /* Line 677 of lalr1.cc */
  662. #line 187 "easymesh/easymesh-parser.y"
  663. { mc.m_mesh.AppendCapsule((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
  664. break;
  665. case 73:
  666. /* Line 677 of lalr1.cc */
  667. #line 188 "easymesh/easymesh-parser.y"
  668. { mc.m_mesh.AppendTorus((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
  669. break;
  670. case 74:
  671. /* Line 677 of lalr1.cc */
  672. #line 189 "easymesh/easymesh-parser.y"
  673. { mc.m_mesh.AppendStar((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2,
  674. (int)(yysemantic_stack_[(2) - (2)].args).f3, (int)(yysemantic_stack_[(2) - (2)].args).f4); }
  675. break;
  676. case 75:
  677. /* Line 677 of lalr1.cc */
  678. #line 191 "easymesh/easymesh-parser.y"
  679. { mc.m_mesh.AppendExpandedStar((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
  680. (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3); }
  681. break;
  682. case 76:
  683. /* Line 677 of lalr1.cc */
  684. #line 193 "easymesh/easymesh-parser.y"
  685. { mc.m_mesh.AppendDisc((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (int)(yysemantic_stack_[(2) - (2)].args).f2); }
  686. break;
  687. case 77:
  688. /* Line 677 of lalr1.cc */
  689. #line 194 "easymesh/easymesh-parser.y"
  690. { mc.m_mesh.AppendSimpleTriangle((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); }
  691. break;
  692. case 78:
  693. /* Line 677 of lalr1.cc */
  694. #line 195 "easymesh/easymesh-parser.y"
  695. { mc.m_mesh.AppendSimpleQuad((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); }
  696. break;
  697. case 79:
  698. /* Line 677 of lalr1.cc */
  699. #line 196 "easymesh/easymesh-parser.y"
  700. { mc.m_mesh.AppendCog((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
  701. (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3, (yysemantic_stack_[(2) - (2)].args).f4, (yysemantic_stack_[(2) - (2)].args).f5, (yysemantic_stack_[(2) - (2)].args).f6,
  702. (yysemantic_stack_[(2) - (2)].args).f7, (yysemantic_stack_[(2) - (2)].args).f8, (int)(yysemantic_stack_[(2) - (2)].args).f9); }
  703. break;
  704. case 80:
  705. /* Line 677 of lalr1.cc */
  706. #line 201 "easymesh/easymesh-parser.y"
  707. { (yyval.args).f0 = (yysemantic_stack_[(1) - (1)].fval); }
  708. break;
  709. case 81:
  710. /* Line 677 of lalr1.cc */
  711. #line 202 "easymesh/easymesh-parser.y"
  712. { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f1 = (yysemantic_stack_[(2) - (2)].fval); }
  713. break;
  714. case 82:
  715. /* Line 677 of lalr1.cc */
  716. #line 203 "easymesh/easymesh-parser.y"
  717. { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f2 = (yysemantic_stack_[(2) - (2)].fval); }
  718. break;
  719. case 83:
  720. /* Line 677 of lalr1.cc */
  721. #line 204 "easymesh/easymesh-parser.y"
  722. { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f3 = (yysemantic_stack_[(2) - (2)].fval); }
  723. break;
  724. case 84:
  725. /* Line 677 of lalr1.cc */
  726. #line 205 "easymesh/easymesh-parser.y"
  727. { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f4 = (yysemantic_stack_[(2) - (2)].fval); }
  728. break;
  729. case 85:
  730. /* Line 677 of lalr1.cc */
  731. #line 206 "easymesh/easymesh-parser.y"
  732. { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f5 = (yysemantic_stack_[(2) - (2)].fval); }
  733. break;
  734. case 86:
  735. /* Line 677 of lalr1.cc */
  736. #line 207 "easymesh/easymesh-parser.y"
  737. { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f6 = (yysemantic_stack_[(2) - (2)].fval); }
  738. break;
  739. case 87:
  740. /* Line 677 of lalr1.cc */
  741. #line 208 "easymesh/easymesh-parser.y"
  742. { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f7 = (yysemantic_stack_[(2) - (2)].fval); }
  743. break;
  744. case 88:
  745. /* Line 677 of lalr1.cc */
  746. #line 209 "easymesh/easymesh-parser.y"
  747. { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f8 = (yysemantic_stack_[(2) - (2)].fval); }
  748. break;
  749. case 89:
  750. /* Line 677 of lalr1.cc */
  751. #line 210 "easymesh/easymesh-parser.y"
  752. { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f9 = (yysemantic_stack_[(2) - (2)].fval); }
  753. break;
  754. case 90:
  755. /* Line 677 of lalr1.cc */
  756. #line 213 "easymesh/easymesh-parser.y"
  757. { (yyval.fval) = (yysemantic_stack_[(1) - (1)].fval); }
  758. break;
  759. case 91:
  760. /* Line 677 of lalr1.cc */
  761. #line 214 "easymesh/easymesh-parser.y"
  762. { (yyval.fval) = -(yysemantic_stack_[(2) - (2)].fval); }
  763. break;
  764. /* Line 677 of lalr1.cc */
  765. #line 1018 "generated/easymesh-parser.cpp"
  766. default:
  767. break;
  768. }
  769. YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc);
  770. yypop_ (yylen);
  771. yylen = 0;
  772. YY_STACK_PRINT ();
  773. yysemantic_stack_.push (yyval);
  774. yylocation_stack_.push (yyloc);
  775. /* Shift the result of the reduction. */
  776. yyn = yyr1_[yyn];
  777. yystate = yypgoto_[yyn - yyntokens_] + yystate_stack_[0];
  778. if (0 <= yystate && yystate <= yylast_
  779. && yycheck_[yystate] == yystate_stack_[0])
  780. yystate = yytable_[yystate];
  781. else
  782. yystate = yydefgoto_[yyn - yyntokens_];
  783. goto yynewstate;
  784. /*------------------------------------.
  785. | yyerrlab -- here on detecting error |
  786. `------------------------------------*/
  787. yyerrlab:
  788. /* If not already recovering from an error, report this error. */
  789. if (!yyerrstatus_)
  790. {
  791. ++yynerrs_;
  792. error (yylloc, yysyntax_error_ (yystate, yytoken));
  793. }
  794. yyerror_range[0] = yylloc;
  795. if (yyerrstatus_ == 3)
  796. {
  797. /* If just tried and failed to reuse lookahead token after an
  798. error, discard it. */
  799. if (yychar <= yyeof_)
  800. {
  801. /* Return failure if at end of input. */
  802. if (yychar == yyeof_)
  803. YYABORT;
  804. }
  805. else
  806. {
  807. yydestruct_ ("Error: discarding", yytoken, &yylval, &yylloc);
  808. yychar = yyempty_;
  809. }
  810. }
  811. /* Else will try to reuse lookahead token after shifting the error
  812. token. */
  813. goto yyerrlab1;
  814. /*---------------------------------------------------.
  815. | yyerrorlab -- error raised explicitly by YYERROR. |
  816. `---------------------------------------------------*/
  817. yyerrorlab:
  818. /* Pacify compilers like GCC when the user code never invokes
  819. YYERROR and the label yyerrorlab therefore never appears in user
  820. code. */
  821. if (false)
  822. goto yyerrorlab;
  823. yyerror_range[0] = yylocation_stack_[yylen - 1];
  824. /* Do not reclaim the symbols of the rule which action triggered
  825. this YYERROR. */
  826. yypop_ (yylen);
  827. yylen = 0;
  828. yystate = yystate_stack_[0];
  829. goto yyerrlab1;
  830. /*-------------------------------------------------------------.
  831. | yyerrlab1 -- common code for both syntax error and YYERROR. |
  832. `-------------------------------------------------------------*/
  833. yyerrlab1:
  834. yyerrstatus_ = 3; /* Each real token shifted decrements this. */
  835. for (;;)
  836. {
  837. yyn = yypact_[yystate];
  838. if (yyn != yypact_ninf_)
  839. {
  840. yyn += yyterror_;
  841. if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
  842. {
  843. yyn = yytable_[yyn];
  844. if (0 < yyn)
  845. break;
  846. }
  847. }
  848. /* Pop the current state because it cannot handle the error token. */
  849. if (yystate_stack_.height () == 1)
  850. YYABORT;
  851. yyerror_range[0] = yylocation_stack_[0];
  852. yydestruct_ ("Error: popping",
  853. yystos_[yystate],
  854. &yysemantic_stack_[0], &yylocation_stack_[0]);
  855. yypop_ ();
  856. yystate = yystate_stack_[0];
  857. YY_STACK_PRINT ();
  858. }
  859. yyerror_range[1] = yylloc;
  860. // Using YYLLOC is tempting, but would change the location of
  861. // the lookahead. YYLOC is available though.
  862. YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
  863. yysemantic_stack_.push (yylval);
  864. yylocation_stack_.push (yyloc);
  865. /* Shift the error token. */
  866. YY_SYMBOL_PRINT ("Shifting", yystos_[yyn],
  867. &yysemantic_stack_[0], &yylocation_stack_[0]);
  868. yystate = yyn;
  869. goto yynewstate;
  870. /* Accept. */
  871. yyacceptlab:
  872. yyresult = 0;
  873. goto yyreturn;
  874. /* Abort. */
  875. yyabortlab:
  876. yyresult = 1;
  877. goto yyreturn;
  878. yyreturn:
  879. if (yychar != yyempty_)
  880. yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc);
  881. /* Do not reclaim the symbols of the rule which action triggered
  882. this YYABORT or YYACCEPT. */
  883. yypop_ (yylen);
  884. while (yystate_stack_.height () != 1)
  885. {
  886. yydestruct_ ("Cleanup: popping",
  887. yystos_[yystate_stack_[0]],
  888. &yysemantic_stack_[0],
  889. &yylocation_stack_[0]);
  890. yypop_ ();
  891. }
  892. return yyresult;
  893. }
  894. // Generate an error message.
  895. std::string
  896. EasyMeshParser::yysyntax_error_ (int yystate, int tok)
  897. {
  898. std::string res;
  899. YYUSE (yystate);
  900. #if YYERROR_VERBOSE
  901. int yyn = yypact_[yystate];
  902. if (yypact_ninf_ < yyn && yyn <= yylast_)
  903. {
  904. /* Start YYX at -YYN if negative to avoid negative indexes in
  905. YYCHECK. */
  906. int yyxbegin = yyn < 0 ? -yyn : 0;
  907. /* Stay within bounds of both yycheck and yytname. */
  908. int yychecklim = yylast_ - yyn + 1;
  909. int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
  910. int count = 0;
  911. for (int x = yyxbegin; x < yyxend; ++x)
  912. if (yycheck_[x + yyn] == x && x != yyterror_)
  913. ++count;
  914. // FIXME: This method of building the message is not compatible
  915. // with internationalization. It should work like yacc.c does it.
  916. // That is, first build a string that looks like this:
  917. // "syntax error, unexpected %s or %s or %s"
  918. // Then, invoke YY_ on this string.
  919. // Finally, use the string as a format to output
  920. // yytname_[tok], etc.
  921. // Until this gets fixed, this message appears in English only.
  922. res = "syntax error, unexpected ";
  923. res += yytnamerr_ (yytname_[tok]);
  924. if (count < 5)
  925. {
  926. count = 0;
  927. for (int x = yyxbegin; x < yyxend; ++x)
  928. if (yycheck_[x + yyn] == x && x != yyterror_)
  929. {
  930. res += (!count++) ? ", expecting " : " or ";
  931. res += yytnamerr_ (yytname_[x]);
  932. }
  933. }
  934. }
  935. else
  936. #endif
  937. res = YY_("syntax error");
  938. return res;
  939. }
  940. /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
  941. STATE-NUM. */
  942. const signed char EasyMeshParser::yypact_ninf_ = -71;
  943. const signed char
  944. EasyMeshParser::yypact_[] =
  945. {
  946. 62, -42, -25, -49, -49, -49, -49, -49, -49, -49,
  947. -49, -49, -71, -49, -49, -49, -49, -49, -49, -49,
  948. -49, -49, -71, -49, -49, -49, -49, -49, -49, -49,
  949. -49, -49, -71, -49, -49, -71, -49, -49, -49, -71,
  950. -71, -71, -71, -71, -49, -49, -49, -49, -49, -49,
  951. -49, -49, -49, -49, -49, -49, -49, -49, -71, 4,
  952. 6, 62, 62, 123, -71, -71, -71, -71, -71, -71,
  953. -49, -49, -49, -49, -71, -71, -71, -71, -71, -71,
  954. -49, -71, -71, -49, -71, -71, -71, -71, -71, -71,
  955. -71, -49, -71, -71, -49, -71, -71, -71, -71, -71,
  956. -71, -71, -49, -71, -71, -49, -71, -71, -71, -71,
  957. -71, -71, -71, -71, -71, -71, -71, -49, -49, -49,
  958. -71, -71, -71, -71, -71, -71, -71, -71, -71, -71,
  959. -71, -49, -49, -49, -49, -71, -71, -71, -71, -71,
  960. -55, -71, -71, -71, -71, -71, -71, -71, -71, -71,
  961. -71, -71, -71, -71
  962. };
  963. /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
  964. doesn't specify something else to do. Zero means the default is an
  965. error. */
  966. const unsigned char
  967. EasyMeshParser::yydefact_[] =
  968. {
  969. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  970. 0, 0, 54, 0, 0, 0, 0, 0, 0, 0,
  971. 0, 0, 55, 0, 0, 0, 0, 0, 0, 0,
  972. 0, 0, 56, 0, 0, 60, 0, 0, 0, 61,
  973. 62, 63, 64, 65, 0, 0, 0, 0, 0, 0,
  974. 0, 0, 0, 0, 0, 0, 0, 0, 7, 0,
  975. 0, 3, 0, 5, 9, 11, 12, 13, 90, 15,
  976. 0, 0, 0, 0, 14, 80, 17, 16, 19, 23,
  977. 26, 27, 32, 35, 36, 41, 44, 45, 50, 20,
  978. 24, 28, 29, 33, 37, 38, 42, 46, 47, 51,
  979. 21, 25, 30, 31, 34, 39, 40, 43, 48, 49,
  980. 52, 22, 53, 57, 58, 59, 18, 0, 0, 66,
  981. 67, 68, 69, 70, 71, 72, 74, 75, 76, 77,
  982. 78, 0, 0, 0, 0, 79, 73, 1, 2, 4,
  983. 0, 10, 91, 81, 82, 83, 84, 85, 86, 87,
  984. 88, 89, 8, 6
  985. };
  986. /* YYPGOTO[NTERM-NUM]. */
  987. const short int
  988. EasyMeshParser::yypgoto_[] =
  989. {
  990. -71, -71, -32, -71, -71, -71, -71, -52, -71, -71,
  991. -71, 232, 184, 0, 182, -37, -34, -30, -71, -71,
  992. -71, -70
  993. };
  994. /* YYDEFGOTO[NTERM-NUM]. */
  995. const short int
  996. EasyMeshParser::yydefgoto_[] =
  997. {
  998. -1, 59, 60, 61, 62, 153, 63, 64, 65, 66,
  999. 67, 71, 72, 73, 117, 118, 119, 120, 133, 134,
  1000. 135, 75
  1001. };
  1002. /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
  1003. positive, shift that token. If negative, reduce the rule which
  1004. number is the opposite. If zero, do what YYDEFACT says. */
  1005. const signed char EasyMeshParser::yytable_ninf_ = -1;
  1006. const unsigned char
  1007. EasyMeshParser::yytable_[] =
  1008. {
  1009. 142, 143, 144, 145, 137, 80, 138, 83, 85, 152,
  1010. 145, 141, 68, 145, 126, 91, 70, 94, 96, 68,
  1011. 69, 145, 131, 70, 145, 102, 132, 105, 107, 139,
  1012. 140, 0, 145, 111, 112, 145, 68, 76, 115, 0,
  1013. 70, 0, 0, 0, 0, 0, 121, 146, 147, 148,
  1014. 125, 0, 0, 128, 0, 0, 0, 136, 0, 0,
  1015. 0, 148, 149, 150, 151, 1, 2, 3, 4, 5,
  1016. 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  1017. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
  1018. 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
  1019. 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
  1020. 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
  1021. 56, 57, 0, 0, 0, 58, 1, 2, 3, 4,
  1022. 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
  1023. 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
  1024. 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
  1025. 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
  1026. 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
  1027. 55, 56, 57, 74, 77, 0, 0, 81, 0, 84,
  1028. 82, 0, 0, 86, 87, 0, 0, 92, 0, 95,
  1029. 93, 0, 0, 97, 98, 0, 0, 103, 0, 106,
  1030. 104, 0, 0, 108, 109, 0, 0, 0, 0, 0,
  1031. 0, 0, 0, 0, 0, 0, 0, 0, 0, 122,
  1032. 123, 0, 0, 124, 127, 78, 79, 0, 129, 130,
  1033. 0, 0, 0, 88, 0, 89, 90, 0, 0, 0,
  1034. 0, 0, 0, 99, 0, 100, 101, 0, 0, 0,
  1035. 0, 0, 0, 110, 0, 0, 0, 0, 113, 114,
  1036. 0, 0, 0, 0, 0, 0, 116
  1037. };
  1038. /* YYCHECK. */
  1039. const short int
  1040. EasyMeshParser::yycheck_[] =
  1041. {
  1042. 70, 71, 72, 73, 0, 5, 0, 7, 8, 64,
  1043. 80, 63, 61, 83, 51, 15, 65, 17, 18, 61,
  1044. 62, 91, 56, 65, 94, 25, 56, 27, 28, 61,
  1045. 62, -1, 102, 33, 34, 105, 61, 62, 38, -1,
  1046. 65, -1, -1, -1, -1, -1, 46, 117, 118, 119,
  1047. 50, -1, -1, 53, -1, -1, -1, 57, -1, -1,
  1048. -1, 131, 132, 133, 134, 3, 4, 5, 6, 7,
  1049. 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
  1050. 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
  1051. 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
  1052. 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
  1053. 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
  1054. 58, 59, -1, -1, -1, 63, 3, 4, 5, 6,
  1055. 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
  1056. 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
  1057. 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
  1058. 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
  1059. 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
  1060. 57, 58, 59, 1, 2, -1, -1, 5, -1, 7,
  1061. 6, -1, -1, 9, 10, -1, -1, 15, -1, 17,
  1062. 16, -1, -1, 19, 20, -1, -1, 25, -1, 27,
  1063. 26, -1, -1, 29, 30, -1, -1, -1, -1, -1,
  1064. -1, -1, -1, -1, -1, -1, -1, -1, -1, 47,
  1065. 48, -1, -1, 49, 52, 3, 4, -1, 54, 55,
  1066. -1, -1, -1, 11, -1, 13, 14, -1, -1, -1,
  1067. -1, -1, -1, 21, -1, 23, 24, -1, -1, -1,
  1068. -1, -1, -1, 31, -1, -1, -1, -1, 36, 37,
  1069. -1, -1, -1, -1, -1, -1, 44
  1070. };
  1071. /* STOS_[STATE-NUM] -- The (internal number of the) accessing
  1072. symbol of state STATE-NUM. */
  1073. const unsigned char
  1074. EasyMeshParser::yystos_[] =
  1075. {
  1076. 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
  1077. 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
  1078. 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
  1079. 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
  1080. 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
  1081. 52, 53, 54, 55, 56, 57, 58, 59, 63, 67,
  1082. 68, 69, 70, 72, 73, 74, 75, 76, 61, 62,
  1083. 65, 77, 78, 79, 80, 87, 62, 80, 77, 77,
  1084. 79, 80, 78, 79, 80, 79, 78, 78, 77, 77,
  1085. 77, 79, 80, 78, 79, 80, 79, 78, 78, 77,
  1086. 77, 77, 79, 80, 78, 79, 80, 79, 78, 78,
  1087. 77, 79, 79, 77, 77, 79, 77, 80, 81, 82,
  1088. 83, 79, 80, 80, 78, 79, 81, 80, 79, 78,
  1089. 78, 82, 83, 84, 85, 86, 79, 0, 0, 68,
  1090. 68, 73, 87, 87, 87, 87, 87, 87, 87, 87,
  1091. 87, 87, 64, 71
  1092. };
  1093. #if YYDEBUG
  1094. /* TOKEN_NUMBER_[YYLEX-NUM] -- Internal symbol number corresponding
  1095. to YYLEX-NUM. */
  1096. const unsigned short int
  1097. EasyMeshParser::yytoken_number_[] =
  1098. {
  1099. 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
  1100. 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
  1101. 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
  1102. 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
  1103. 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
  1104. 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
  1105. 315, 316, 317, 91, 93, 45
  1106. };
  1107. #endif
  1108. /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
  1109. const unsigned char
  1110. EasyMeshParser::yyr1_[] =
  1111. {
  1112. 0, 66, 67, 68, 68, 69, 69, 70, 71, 72,
  1113. 72, 73, 73, 73, 74, 74, 74, 74, 75, 75,
  1114. 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
  1115. 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
  1116. 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
  1117. 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
  1118. 75, 75, 75, 75, 75, 75, 76, 76, 76, 76,
  1119. 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
  1120. 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
  1121. 87, 87
  1122. };
  1123. /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
  1124. const unsigned char
  1125. EasyMeshParser::yyr2_[] =
  1126. {
  1127. 0, 2, 2, 1, 2, 1, 3, 1, 1, 1,
  1128. 2, 1, 1, 1, 2, 2, 2, 2, 2, 2,
  1129. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1130. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1131. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1132. 2, 2, 2, 2, 1, 1, 1, 2, 2, 2,
  1133. 1, 1, 1, 1, 1, 1, 2, 2, 2, 2,
  1134. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1135. 1, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1136. 1, 2
  1137. };
  1138. #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
  1139. /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
  1140. First, the terminals, then, starting at \a yyntokens_, nonterminals. */
  1141. const char*
  1142. const EasyMeshParser::yytname_[] =
  1143. {
  1144. "T_END", "error", "$undefined", "T_COLOR", "T_BGCOLOR", "T_TRANSLATEX",
  1145. "T_ROTATEX", "T_TAPERX", "T_TWISTX", "T_SHEARX", "T_STRETCHX",
  1146. "T_BENDXY", "T_BENDXZ", "T_SCALEX", "T_MIRRORX", "T_TRANSLATEY",
  1147. "T_ROTATEY", "T_TAPERY", "T_TWISTY", "T_SHEARY", "T_STRETCHY",
  1148. "T_BENDYX", "T_BENDYZ", "T_SCALEY", "T_MIRRORY", "T_TRANSLATEZ",
  1149. "T_ROTATEZ", "T_TAPERZ", "T_TWISTZ", "T_SHEARZ", "T_STRETCHZ",
  1150. "T_BENDZX", "T_BENDZY", "T_SCALEZ", "T_MIRRORZ", "T_TRANSLATE",
  1151. "T_SCALE", "T_TOGGLESCALEWINDING", "T_RADIALJITTER", "T_SPLITTRIANGLE",
  1152. "T_SMOOTHMESH", "T_CSGUNION", "T_CSGSUBSTRACT", "T_CSGSUBSTRACTLOSS",
  1153. "T_CSGAND", "T_CSGXOR", "T_CHAMFER", "T_CYLINDER", "T_BOX",
  1154. "T_SMOOTHCHAMFBOX", "T_FLATCHAMFBOX", "T_SPHERE", "T_CAPSULE", "T_STAR",
  1155. "T_EXPANDEDSTAR", "T_DISC", "T_TRIANGLE", "T_QUAD", "T_COG", "T_TORUS",
  1156. "T_ERROR", "NUMBER", "COLOR", "'['", "']'", "'-'", "$accept",
  1157. "mesh_description", "mesh_expression_list", "mesh_expression",
  1158. "mesh_open", "mesh_close", "mesh_command_list", "mesh_command",
  1159. "color_command", "transform_command", "primitive_command", "args1",
  1160. "args2", "args3", "args4", "args5", "args6", "args7", "args8", "args9",
  1161. "args10", "number", 0
  1162. };
  1163. #endif
  1164. #if YYDEBUG
  1165. /* YYRHS -- A `-1'-separated list of the rules' RHS. */
  1166. const EasyMeshParser::rhs_number_type
  1167. EasyMeshParser::yyrhs_[] =
  1168. {
  1169. 67, 0, -1, 68, 0, -1, 69, -1, 69, 68,
  1170. -1, 72, -1, 70, 68, 71, -1, 63, -1, 64,
  1171. -1, 73, -1, 72, 73, -1, 74, -1, 75, -1,
  1172. 76, -1, 3, 80, -1, 3, 62, -1, 4, 80,
  1173. -1, 4, 62, -1, 46, 77, -1, 5, 77, -1,
  1174. 15, 77, -1, 25, 77, -1, 35, 79, -1, 6,
  1175. 77, -1, 16, 77, -1, 26, 77, -1, 7, 79,
  1176. -1, 7, 80, -1, 17, 79, -1, 17, 80, -1,
  1177. 27, 79, -1, 27, 80, -1, 8, 78, -1, 18,
  1178. 78, -1, 28, 78, -1, 9, 79, -1, 9, 80,
  1179. -1, 19, 79, -1, 19, 80, -1, 29, 79, -1,
  1180. 29, 80, -1, 10, 79, -1, 20, 79, -1, 30,
  1181. 79, -1, 11, 78, -1, 12, 78, -1, 21, 78,
  1182. -1, 22, 78, -1, 31, 78, -1, 32, 78, -1,
  1183. 13, 77, -1, 23, 77, -1, 33, 77, -1, 36,
  1184. 79, -1, 14, -1, 24, -1, 34, -1, 38, 77,
  1185. -1, 39, 77, -1, 40, 79, -1, 37, -1, 41,
  1186. -1, 42, -1, 43, -1, 44, -1, 45, -1, 47,
  1187. 82, -1, 47, 83, -1, 48, 79, -1, 49, 80,
  1188. -1, 50, 80, -1, 51, 78, -1, 52, 79, -1,
  1189. 59, 79, -1, 53, 81, -1, 54, 80, -1, 55,
  1190. 79, -1, 56, 78, -1, 57, 78, -1, 58, 86,
  1191. -1, 87, -1, 77, 87, -1, 78, 87, -1, 79,
  1192. 87, -1, 80, 87, -1, 81, 87, -1, 82, 87,
  1193. -1, 83, 87, -1, 84, 87, -1, 85, 87, -1,
  1194. 61, -1, 65, 87, -1
  1195. };
  1196. /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
  1197. YYRHS. */
  1198. const unsigned char
  1199. EasyMeshParser::yyprhs_[] =
  1200. {
  1201. 0, 0, 3, 6, 8, 11, 13, 17, 19, 21,
  1202. 23, 26, 28, 30, 32, 35, 38, 41, 44, 47,
  1203. 50, 53, 56, 59, 62, 65, 68, 71, 74, 77,
  1204. 80, 83, 86, 89, 92, 95, 98, 101, 104, 107,
  1205. 110, 113, 116, 119, 122, 125, 128, 131, 134, 137,
  1206. 140, 143, 146, 149, 152, 154, 156, 158, 161, 164,
  1207. 167, 169, 171, 173, 175, 177, 179, 182, 185, 188,
  1208. 191, 194, 197, 200, 203, 206, 209, 212, 215, 218,
  1209. 221, 223, 226, 229, 232, 235, 238, 241, 244, 247,
  1210. 250, 252
  1211. };
  1212. /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
  1213. const unsigned char
  1214. EasyMeshParser::yyrline_[] =
  1215. {
  1216. 0, 80, 80, 84, 85, 89, 90, 94, 98, 102,
  1217. 103, 107, 108, 109, 113, 114, 117, 118, 124, 125,
  1218. 126, 127, 128, 129, 130, 131, 132, 133, 134, 135,
  1219. 136, 137, 138, 139, 140, 141, 142, 143, 144, 145,
  1220. 146, 147, 148, 149, 150, 151, 152, 153, 154, 155,
  1221. 156, 157, 158, 159, 160, 161, 162, 163, 164, 165,
  1222. 166, 167, 168, 169, 170, 171, 175, 178, 181, 182,
  1223. 184, 186, 187, 188, 189, 191, 193, 194, 195, 196,
  1224. 201, 202, 203, 204, 205, 206, 207, 208, 209, 210,
  1225. 213, 214
  1226. };
  1227. // Print the state stack on the debug stream.
  1228. void
  1229. EasyMeshParser::yystack_print_ ()
  1230. {
  1231. *yycdebug_ << "Stack now";
  1232. for (state_stack_type::const_iterator i = yystate_stack_.begin ();
  1233. i != yystate_stack_.end (); ++i)
  1234. *yycdebug_ << ' ' << *i;
  1235. *yycdebug_ << std::endl;
  1236. }
  1237. // Report on the debug stream that the rule \a yyrule is going to be reduced.
  1238. void
  1239. EasyMeshParser::yy_reduce_print_ (int yyrule)
  1240. {
  1241. unsigned int yylno = yyrline_[yyrule];
  1242. int yynrhs = yyr2_[yyrule];
  1243. /* Print the symbols being reduced, and their result. */
  1244. *yycdebug_ << "Reducing stack by rule " << yyrule - 1
  1245. << " (line " << yylno << "):" << std::endl;
  1246. /* The symbols being reduced. */
  1247. for (int yyi = 0; yyi < yynrhs; yyi++)
  1248. YY_SYMBOL_PRINT (" $" << yyi + 1 << " =",
  1249. yyrhs_[yyprhs_[yyrule] + yyi],
  1250. &(yysemantic_stack_[(yynrhs) - (yyi + 1)]),
  1251. &(yylocation_stack_[(yynrhs) - (yyi + 1)]));
  1252. }
  1253. #endif // YYDEBUG
  1254. /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
  1255. EasyMeshParser::token_number_type
  1256. EasyMeshParser::yytranslate_ (int t)
  1257. {
  1258. static
  1259. const token_number_type
  1260. translate_table[] =
  1261. {
  1262. 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1263. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1264. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1265. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1266. 2, 2, 2, 2, 2, 65, 2, 2, 2, 2,
  1267. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1268. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1269. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1270. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1271. 2, 63, 2, 64, 2, 2, 2, 2, 2, 2,
  1272. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1273. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1274. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1275. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1276. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1277. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1278. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1279. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1280. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1281. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1282. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1283. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1284. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1285. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1286. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  1287. 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
  1288. 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
  1289. 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
  1290. 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
  1291. 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
  1292. 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
  1293. 55, 56, 57, 58, 59, 60, 61, 62
  1294. };
  1295. if ((unsigned int) t <= yyuser_token_number_max_)
  1296. return translate_table[t];
  1297. else
  1298. return yyundef_token_;
  1299. }
  1300. const int EasyMeshParser::yyeof_ = 0;
  1301. const int EasyMeshParser::yylast_ = 276;
  1302. const int EasyMeshParser::yynnts_ = 22;
  1303. const int EasyMeshParser::yyempty_ = -2;
  1304. const int EasyMeshParser::yyfinal_ = 137;
  1305. const int EasyMeshParser::yyterror_ = 1;
  1306. const int EasyMeshParser::yyerrcode_ = 256;
  1307. const int EasyMeshParser::yyntokens_ = 66;
  1308. const unsigned int EasyMeshParser::yyuser_token_number_max_ = 317;
  1309. const EasyMeshParser::token_number_type EasyMeshParser::yyundef_token_ = 2;
  1310. } // lol
  1311. /* Line 1053 of lalr1.cc */
  1312. #line 1614 "generated/easymesh-parser.cpp"
  1313. /* Line 1055 of lalr1.cc */
  1314. #line 217 "easymesh/easymesh-parser.y"
  1315. void lol::EasyMeshParser::error(const EasyMeshParser::location_type& l,
  1316. const std::string& m)
  1317. {
  1318. mc.Error(l, m);
  1319. }