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