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

easymesh-parser.cpp 41 KiB

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