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