xref: /netbsd-src/external/gpl3/binutils/dist/gas/config/loongarch-parse.c (revision cb63e24e8d6aae7ddac1859a9015f48b1d8bd90e)
1 /* A Bison parser, made by GNU Bison 3.8.2.  */
2 
3 /* Bison implementation for Yacc-like parsers in C
4 
5    Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
6    Inc.
7 
8    This program is free software: you can redistribute it and/or modify
9    it under the terms of the GNU General Public License as published by
10    the Free Software Foundation, either version 3 of the License, or
11    (at your option) any later version.
12 
13    This program is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16    GNU General Public License for more details.
17 
18    You should have received a copy of the GNU General Public License
19    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
20 
21 /* As a special exception, you may create a larger work that contains
22    part or all of the Bison parser skeleton and distribute that work
23    under terms of your choice, so long as that work isn't itself a
24    parser generator using the skeleton or a modified version thereof
25    as a parser skeleton.  Alternatively, if you modify or redistribute
26    the parser skeleton itself, you may (at your option) remove this
27    special exception, which will cause the skeleton and the resulting
28    Bison output files to be licensed under the GNU General Public
29    License without this special exception.
30 
31    This special exception was added by the Free Software Foundation in
32    version 2.2 of Bison.  */
33 
34 /* C LALR(1) parser skeleton written by Richard Stallman, by
35    simplifying the original so-called "semantic" parser.  */
36 
37 /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
38    especially those whose name start with YY_ or yy_.  They are
39    private implementation details that can be changed or removed.  */
40 
41 /* All symbols defined below should begin with yy or YY, to avoid
42    infringing on user name space.  This should be done even for local
43    variables, as they might otherwise be expanded by user macros.
44    There are some unavoidable exceptions within include files to
45    define necessary library symbols; they are noted "INFRINGES ON
46    USER NAME SPACE" below.  */
47 
48 /* Identify Bison output, and Bison version.  */
49 #define YYBISON 30802
50 
51 /* Bison version string.  */
52 #define YYBISON_VERSION "3.8.2"
53 
54 /* Skeleton name.  */
55 #define YYSKELETON_NAME "yacc.c"
56 
57 /* Pure parsers.  */
58 #define YYPURE 0
59 
60 /* Push parsers.  */
61 #define YYPUSH 0
62 
63 /* Pull parsers.  */
64 #define YYPULL 1
65 
66 
67 
68 
69 /* First part of user prologue.  */
70 #line 19 "./config/loongarch-parse.y"
71 
72 #include "as.h"
73 #include "loongarch-lex.h"
74 #include "loongarch-parse.h"
yyerror(const char * s ATTRIBUTE_UNUSED)75 static void yyerror (const char *s ATTRIBUTE_UNUSED)
76 {
77 };
78 int yylex (void);
79 
80 
81 static struct reloc_info *top, *end;
82 
83 static expressionS const_0 =
84 {
85   .X_op = O_constant,
86   .X_add_number = 0
87 };
88 
89 static int
is_const(struct reloc_info * info)90 is_const (struct reloc_info *info)
91 {
92   return (info->type == BFD_RELOC_LARCH_SOP_PUSH_ABSOLUTE
93 	  && info->value.X_op == O_constant);
94 }
95 
96 int
loongarch_parse_expr(const char * expr,struct reloc_info * reloc_stack_top,size_t max_reloc_num,size_t * reloc_num,offsetT * imm)97 loongarch_parse_expr (const char *expr,
98 		      struct reloc_info *reloc_stack_top,
99 		      size_t max_reloc_num,
100 		      size_t *reloc_num,
101 		      offsetT *imm)
102 {
103   int ret;
104   struct yy_buffer_state *buffstate;
105   top = reloc_stack_top;
106   end = top + max_reloc_num;
107   buffstate = yy_scan_string (expr);
108   ret = yyparse ();
109 
110   if (ret == 0)
111     {
112       if (is_const (top - 1))
113 	*imm = (--top)->value.X_add_number;
114       else
115 	*imm = 0;
116       *reloc_num = top - reloc_stack_top;
117     }
118   yy_delete_buffer (buffstate);
119 
120   return ret;
121 }
122 
123 static void
emit_const(offsetT imm)124 emit_const (offsetT imm)
125 {
126   if (end <= top)
127     as_fatal (_("expr too huge"));
128   top->type = BFD_RELOC_LARCH_SOP_PUSH_ABSOLUTE;
129   top->value.X_op = O_constant;
130   top->value.X_add_number = imm;
131   top++;
132 }
133 
134 static const char *
my_getExpression(expressionS * ep,const char * str)135 my_getExpression (expressionS *ep, const char *str)
136 {
137   char *save_in, *ret;
138 
139   if (*str == ':')
140     {
141       unsigned long j;
142       char *str_1 = (char *) str;
143       j = strtol (str_1, &str_1, 10);
144       get_internal_label (ep, j, *str_1 == 'f');
145       return NULL;
146     }
147   save_in = input_line_pointer;
148   input_line_pointer = (char *)str;
149   expression (ep);
150   ret = input_line_pointer;
151   input_line_pointer = save_in;
152   return ret;
153 }
154 
155 static void
emit_const_var(const char * op)156 emit_const_var (const char *op)
157 {
158   expressionS ep;
159 
160   if (end <= top)
161     as_fatal (_("expr too huge"));
162 
163   my_getExpression (&ep, op);
164 
165   if (ep.X_op != O_constant)
166     as_bad ("illegal operand: %s", op);
167 
168   top->value.X_op = O_constant;
169   top->value.X_add_number = ep.X_add_number;
170   top->type = BFD_RELOC_LARCH_SOP_PUSH_ABSOLUTE;
171   top++;
172 }
173 
174 static void
reloc(const char * op_c_str,const char * id_c_str,offsetT addend)175 reloc (const char *op_c_str, const char *id_c_str, offsetT addend)
176 {
177   expressionS id_sym_expr;
178   bfd_reloc_code_real_type btype;
179 
180   if (end <= top)
181     as_fatal (_("expr too huge"));
182 
183   /* For compatible old asm code.  */
184   if (0 == strcmp (op_c_str, "plt"))
185     btype = BFD_RELOC_LARCH_B26;
186   else
187     {
188       btype = loongarch_larch_reloc_name_lookup (NULL, op_c_str);
189       if (btype == BFD_RELOC_NONE)
190 	as_fatal (_("unsupported modifier %s"), op_c_str);
191     }
192 
193   if (id_c_str)
194   {
195     my_getExpression (&id_sym_expr, id_c_str);
196     id_sym_expr.X_add_number += addend;
197   }
198   else
199   {
200     id_sym_expr.X_op = O_constant;
201     id_sym_expr.X_add_number = addend;
202   }
203 
204   top->value = id_sym_expr;
205   top->type = btype;
206   top++;
207 }
208 
209 static void
emit_unary(char op)210 emit_unary (char op)
211 {
212   struct reloc_info *s_top = top - 1;
213   if (is_const (s_top))
214     {
215       offsetT opr = s_top->value.X_add_number;
216       switch (op)
217 	{
218 	case '+':
219 	  break;
220 	case '-':
221 	  opr = -opr;
222 	  break;
223 	case '~':
224 	  opr = ~opr;
225 	  break;
226 	case '!':
227 	  opr = !opr;
228 	  break;
229 	default:
230 	  abort ();
231 	}
232       s_top->value.X_add_number = opr;
233     }
234   else
235     {
236       if (end <= top)
237 	as_fatal (_("expr too huge"));
238       switch (op)
239 	{
240 	case '!':
241 	  top->type = BFD_RELOC_LARCH_SOP_NOT;
242 	  break;
243 	default:
244 	  abort ();
245 	}
246       top->value = const_0;
247       top++;
248     }
249 }
250 
251 static void
emit_bin(int op)252 emit_bin (int op)
253 {
254   struct reloc_info *last_1st = top - 1, *last_2nd = top - 2;
255   if (is_const (last_1st) && is_const (last_2nd))
256     {
257       offsetT opr1 = last_2nd->value.X_add_number;
258       offsetT opr2 = last_1st->value.X_add_number;
259       switch (op)
260 	{
261 	case '*':
262 	  opr1 = opr1 * opr2;
263 	  break;
264 	case '/':
265 	  opr1 = opr1 / opr2;
266 	  break;
267 	case '%':
268 	  opr1 = opr1 % opr2;
269 	  break;
270 	case '+':
271 	  opr1 = opr1 + opr2;
272 	  break;
273 	case '-':
274 	  opr1 = opr1 - opr2;
275 	  break;
276 	case LEFT_OP:
277 	  opr1 = opr1 << opr2;
278 	  break;
279 	case RIGHT_OP:
280 	  /* Algorithm right shift.  */
281 	  opr1 = (offsetT)opr1 >> (offsetT)opr2;
282 	  break;
283 	case '<':
284 	  opr1 = opr1 < opr2;
285 	  break;
286 	case '>':
287 	  opr1 = opr1 > opr2;
288 	  break;
289 	case LE_OP:
290 	  opr1 = opr1 <= opr2;
291 	  break;
292 	case GE_OP:
293 	  opr1 = opr1 >= opr2;
294 	  break;
295 	case EQ_OP:
296 	  opr1 = opr1 == opr2;
297 	  break;
298 	case NE_OP:
299 	  opr1 = opr1 != opr2;
300 	  break;
301 	case '&':
302 	  opr1 = opr1 & opr2;
303 	  break;
304 	case '^':
305 	  opr1 = opr1 ^ opr2;
306 	  break;
307 	case '|':
308 	  opr1 = opr1 | opr2;
309 	  break;
310 	case AND_OP:
311 	  opr1 = opr1 && opr2;
312 	  break;
313 	case OR_OP:
314 	  opr1 = opr1 || opr2;
315 	  break;
316 	default:
317 	  abort ();
318 	}
319       last_2nd->value.X_add_number = opr1;
320       last_1st->type = 0;
321       top--;
322     }
323   else
324     {
325       if (end <= top)
326 	as_fatal (_("expr too huge"));
327       switch (op)
328 	{
329 	case '+':
330 	  top->type = BFD_RELOC_LARCH_SOP_ADD;
331 	  break;
332 	case '-':
333 	  top->type = BFD_RELOC_LARCH_SOP_SUB;
334 	  break;
335 	case LEFT_OP:
336 	  top->type = BFD_RELOC_LARCH_SOP_SL;
337 	  break;
338 	case RIGHT_OP:
339 	  top->type = BFD_RELOC_LARCH_SOP_SR;
340 	  break;
341 	case '&':
342 	  top->type = BFD_RELOC_LARCH_SOP_AND;
343 	  break;
344 	default:
345 	  abort ();
346 	}
347       top->value = const_0;
348       top++;
349     }
350 }
351 
352 static void
emit_if_else(void)353 emit_if_else (void)
354 {
355   struct reloc_info *last_1st = top - 1;
356   struct reloc_info *last_2nd = top - 2;
357   struct reloc_info *last_3rd = top - 3;
358   if (is_const (last_1st) && is_const (last_2nd) && is_const (last_3rd))
359     {
360       offsetT opr1 = last_3rd->value.X_add_number;
361       offsetT opr2 = last_2nd->value.X_add_number;
362       offsetT opr3 = last_1st->value.X_add_number;
363       opr1 = opr1 ? opr2 : opr3;
364       last_3rd->value.X_add_number = opr1;
365       last_2nd->type = 0;
366       last_1st->type = 0;
367       top -= 2;
368     }
369   else
370     {
371       if (end <= top)
372 	as_fatal (_("expr too huge"));
373       top->type = BFD_RELOC_LARCH_SOP_IF_ELSE;
374       top->value = const_0;
375       top++;
376     }
377 }
378 
379 
380 #line 381 "config/loongarch-parse.c"
381 
382 # ifndef YY_CAST
383 #  ifdef __cplusplus
384 #   define YY_CAST(Type, Val) static_cast<Type> (Val)
385 #   define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
386 #  else
387 #   define YY_CAST(Type, Val) ((Type) (Val))
388 #   define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
389 #  endif
390 # endif
391 # ifndef YY_NULLPTR
392 #  if defined __cplusplus
393 #   if 201103L <= __cplusplus
394 #    define YY_NULLPTR nullptr
395 #   else
396 #    define YY_NULLPTR 0
397 #   endif
398 #  else
399 #   define YY_NULLPTR ((void*)0)
400 #  endif
401 # endif
402 
403 /* Use api.header.include to #include this header
404    instead of duplicating it here.  */
405 #ifndef YY_YY_CONFIG_LOONGARCH_PARSE_H_INCLUDED
406 # define YY_YY_CONFIG_LOONGARCH_PARSE_H_INCLUDED
407 /* Debug traces.  */
408 #ifndef YYDEBUG
409 # define YYDEBUG 0
410 #endif
411 #if YYDEBUG
412 extern int yydebug;
413 #endif
414 
415 /* Token kinds.  */
416 #ifndef YYTOKENTYPE
417 # define YYTOKENTYPE
418   enum yytokentype
419   {
420     YYEMPTY = -2,
421     YYEOF = 0,                     /* "end of file"  */
422     YYerror = 256,                 /* error  */
423     YYUNDEF = 257,                 /* "invalid token"  */
424     INTEGER = 258,                 /* INTEGER  */
425     IDENTIFIER = 259,              /* IDENTIFIER  */
426     LEFT_OP = 260,                 /* LEFT_OP  */
427     RIGHT_OP = 261,                /* RIGHT_OP  */
428     LE_OP = 262,                   /* LE_OP  */
429     GE_OP = 263,                   /* GE_OP  */
430     EQ_OP = 264,                   /* EQ_OP  */
431     NE_OP = 265,                   /* NE_OP  */
432     AND_OP = 266,                  /* AND_OP  */
433     OR_OP = 267                    /* OR_OP  */
434   };
435   typedef enum yytokentype yytoken_kind_t;
436 #endif
437 /* Token kinds.  */
438 #define YYEMPTY -2
439 #define YYEOF 0
440 #define YYerror 256
441 #define YYUNDEF 257
442 #define INTEGER 258
443 #define IDENTIFIER 259
444 #define LEFT_OP 260
445 #define RIGHT_OP 261
446 #define LE_OP 262
447 #define GE_OP 263
448 #define EQ_OP 264
449 #define NE_OP 265
450 #define AND_OP 266
451 #define OR_OP 267
452 
453 /* Value type.  */
454 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
455 union YYSTYPE
456 {
457 #line 329 "./config/loongarch-parse.y"
458 
459 char *c_str;
460 offsetT imm;
461 
462 #line 463 "config/loongarch-parse.c"
463 
464 };
465 typedef union YYSTYPE YYSTYPE;
466 # define YYSTYPE_IS_TRIVIAL 1
467 # define YYSTYPE_IS_DECLARED 1
468 #endif
469 
470 
471 extern YYSTYPE yylval;
472 
473 
474 int yyparse (void);
475 
476 
477 #endif /* !YY_YY_CONFIG_LOONGARCH_PARSE_H_INCLUDED  */
478 /* Symbol kind.  */
479 enum yysymbol_kind_t
480 {
481   YYSYMBOL_YYEMPTY = -2,
482   YYSYMBOL_YYEOF = 0,                      /* "end of file"  */
483   YYSYMBOL_YYerror = 1,                    /* error  */
484   YYSYMBOL_YYUNDEF = 2,                    /* "invalid token"  */
485   YYSYMBOL_INTEGER = 3,                    /* INTEGER  */
486   YYSYMBOL_IDENTIFIER = 4,                 /* IDENTIFIER  */
487   YYSYMBOL_LEFT_OP = 5,                    /* LEFT_OP  */
488   YYSYMBOL_RIGHT_OP = 6,                   /* RIGHT_OP  */
489   YYSYMBOL_LE_OP = 7,                      /* LE_OP  */
490   YYSYMBOL_GE_OP = 8,                      /* GE_OP  */
491   YYSYMBOL_EQ_OP = 9,                      /* EQ_OP  */
492   YYSYMBOL_NE_OP = 10,                     /* NE_OP  */
493   YYSYMBOL_AND_OP = 11,                    /* AND_OP  */
494   YYSYMBOL_OR_OP = 12,                     /* OR_OP  */
495   YYSYMBOL_13_ = 13,                       /* '('  */
496   YYSYMBOL_14_ = 14,                       /* ')'  */
497   YYSYMBOL_15_ = 15,                       /* '%'  */
498   YYSYMBOL_16_ = 16,                       /* '-'  */
499   YYSYMBOL_17_ = 17,                       /* '+'  */
500   YYSYMBOL_18_ = 18,                       /* '~'  */
501   YYSYMBOL_19_ = 19,                       /* '!'  */
502   YYSYMBOL_20_ = 20,                       /* '*'  */
503   YYSYMBOL_21_ = 21,                       /* '/'  */
504   YYSYMBOL_22_ = 22,                       /* '<'  */
505   YYSYMBOL_23_ = 23,                       /* '>'  */
506   YYSYMBOL_24_ = 24,                       /* '&'  */
507   YYSYMBOL_25_ = 25,                       /* '^'  */
508   YYSYMBOL_26_ = 26,                       /* '|'  */
509   YYSYMBOL_27_ = 27,                       /* '?'  */
510   YYSYMBOL_28_ = 28,                       /* ':'  */
511   YYSYMBOL_YYACCEPT = 29,                  /* $accept  */
512   YYSYMBOL_primary_expression = 30,        /* primary_expression  */
513   YYSYMBOL_addend = 31,                    /* addend  */
514   YYSYMBOL_unary_expression = 32,          /* unary_expression  */
515   YYSYMBOL_multiplicative_expression = 33, /* multiplicative_expression  */
516   YYSYMBOL_additive_expression = 34,       /* additive_expression  */
517   YYSYMBOL_shift_expression = 35,          /* shift_expression  */
518   YYSYMBOL_relational_expression = 36,     /* relational_expression  */
519   YYSYMBOL_equality_expression = 37,       /* equality_expression  */
520   YYSYMBOL_and_expression = 38,            /* and_expression  */
521   YYSYMBOL_exclusive_or_expression = 39,   /* exclusive_or_expression  */
522   YYSYMBOL_inclusive_or_expression = 40,   /* inclusive_or_expression  */
523   YYSYMBOL_logical_and_expression = 41,    /* logical_and_expression  */
524   YYSYMBOL_logical_or_expression = 42,     /* logical_or_expression  */
525   YYSYMBOL_conditional_expression = 43,    /* conditional_expression  */
526   YYSYMBOL_expression = 44                 /* expression  */
527 };
528 typedef enum yysymbol_kind_t yysymbol_kind_t;
529 
530 
531 
532 
533 #ifdef short
534 # undef short
535 #endif
536 
537 /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
538    <limits.h> and (if available) <stdint.h> are included
539    so that the code can choose integer types of a good width.  */
540 
541 #ifndef __PTRDIFF_MAX__
542 # include <limits.h> /* INFRINGES ON USER NAME SPACE */
543 # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
544 #  include <stdint.h> /* INFRINGES ON USER NAME SPACE */
545 #  define YY_STDINT_H
546 # endif
547 #endif
548 
549 /* Narrow types that promote to a signed type and that can represent a
550    signed or unsigned integer of at least N bits.  In tables they can
551    save space and decrease cache pressure.  Promoting to a signed type
552    helps avoid bugs in integer arithmetic.  */
553 
554 #ifdef __INT_LEAST8_MAX__
555 typedef __INT_LEAST8_TYPE__ yytype_int8;
556 #elif defined YY_STDINT_H
557 typedef int_least8_t yytype_int8;
558 #else
559 typedef signed char yytype_int8;
560 #endif
561 
562 #ifdef __INT_LEAST16_MAX__
563 typedef __INT_LEAST16_TYPE__ yytype_int16;
564 #elif defined YY_STDINT_H
565 typedef int_least16_t yytype_int16;
566 #else
567 typedef short yytype_int16;
568 #endif
569 
570 /* Work around bug in HP-UX 11.23, which defines these macros
571    incorrectly for preprocessor constants.  This workaround can likely
572    be removed in 2023, as HPE has promised support for HP-UX 11.23
573    (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
574    <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>.  */
575 #ifdef __hpux
576 # undef UINT_LEAST8_MAX
577 # undef UINT_LEAST16_MAX
578 # define UINT_LEAST8_MAX 255
579 # define UINT_LEAST16_MAX 65535
580 #endif
581 
582 #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
583 typedef __UINT_LEAST8_TYPE__ yytype_uint8;
584 #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
585        && UINT_LEAST8_MAX <= INT_MAX)
586 typedef uint_least8_t yytype_uint8;
587 #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
588 typedef unsigned char yytype_uint8;
589 #else
590 typedef short yytype_uint8;
591 #endif
592 
593 #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
594 typedef __UINT_LEAST16_TYPE__ yytype_uint16;
595 #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
596        && UINT_LEAST16_MAX <= INT_MAX)
597 typedef uint_least16_t yytype_uint16;
598 #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
599 typedef unsigned short yytype_uint16;
600 #else
601 typedef int yytype_uint16;
602 #endif
603 
604 #ifndef YYPTRDIFF_T
605 # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
606 #  define YYPTRDIFF_T __PTRDIFF_TYPE__
607 #  define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
608 # elif defined PTRDIFF_MAX
609 #  ifndef ptrdiff_t
610 #   include <stddef.h> /* INFRINGES ON USER NAME SPACE */
611 #  endif
612 #  define YYPTRDIFF_T ptrdiff_t
613 #  define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
614 # else
615 #  define YYPTRDIFF_T long
616 #  define YYPTRDIFF_MAXIMUM LONG_MAX
617 # endif
618 #endif
619 
620 #ifndef YYSIZE_T
621 # ifdef __SIZE_TYPE__
622 #  define YYSIZE_T __SIZE_TYPE__
623 # elif defined size_t
624 #  define YYSIZE_T size_t
625 # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
626 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
627 #  define YYSIZE_T size_t
628 # else
629 #  define YYSIZE_T unsigned
630 # endif
631 #endif
632 
633 #define YYSIZE_MAXIMUM                                  \
634   YY_CAST (YYPTRDIFF_T,                                 \
635            (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1)  \
636             ? YYPTRDIFF_MAXIMUM                         \
637             : YY_CAST (YYSIZE_T, -1)))
638 
639 #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
640 
641 
642 /* Stored state numbers (used for stacks). */
643 typedef yytype_int8 yy_state_t;
644 
645 /* State numbers in computations.  */
646 typedef int yy_state_fast_t;
647 
648 #ifndef YY_
649 # if defined YYENABLE_NLS && YYENABLE_NLS
650 #  if ENABLE_NLS
651 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
652 #   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
653 #  endif
654 # endif
655 # ifndef YY_
656 #  define YY_(Msgid) Msgid
657 # endif
658 #endif
659 
660 
661 #ifndef YY_ATTRIBUTE_PURE
662 # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
663 #  define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
664 # else
665 #  define YY_ATTRIBUTE_PURE
666 # endif
667 #endif
668 
669 #ifndef YY_ATTRIBUTE_UNUSED
670 # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
671 #  define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
672 # else
673 #  define YY_ATTRIBUTE_UNUSED
674 # endif
675 #endif
676 
677 /* Suppress unused-variable warnings by "using" E.  */
678 #if ! defined lint || defined __GNUC__
679 # define YY_USE(E) ((void) (E))
680 #else
681 # define YY_USE(E) /* empty */
682 #endif
683 
684 /* Suppress an incorrect diagnostic about yylval being uninitialized.  */
685 #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
686 # if __GNUC__ * 100 + __GNUC_MINOR__ < 407
687 #  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
688     _Pragma ("GCC diagnostic push")                                     \
689     _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
690 # else
691 #  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
692     _Pragma ("GCC diagnostic push")                                     \
693     _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")              \
694     _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
695 # endif
696 # define YY_IGNORE_MAYBE_UNINITIALIZED_END      \
697     _Pragma ("GCC diagnostic pop")
698 #else
699 # define YY_INITIAL_VALUE(Value) Value
700 #endif
701 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
702 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
703 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
704 #endif
705 #ifndef YY_INITIAL_VALUE
706 # define YY_INITIAL_VALUE(Value) /* Nothing. */
707 #endif
708 
709 #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
710 # define YY_IGNORE_USELESS_CAST_BEGIN                          \
711     _Pragma ("GCC diagnostic push")                            \
712     _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
713 # define YY_IGNORE_USELESS_CAST_END            \
714     _Pragma ("GCC diagnostic pop")
715 #endif
716 #ifndef YY_IGNORE_USELESS_CAST_BEGIN
717 # define YY_IGNORE_USELESS_CAST_BEGIN
718 # define YY_IGNORE_USELESS_CAST_END
719 #endif
720 
721 
722 #define YY_ASSERT(E) ((void) (0 && (E)))
723 
724 #if !defined yyoverflow
725 
726 /* The parser invokes alloca or malloc; define the necessary symbols.  */
727 
728 # ifdef YYSTACK_USE_ALLOCA
729 #  if YYSTACK_USE_ALLOCA
730 #   ifdef __GNUC__
731 #    define YYSTACK_ALLOC __builtin_alloca
732 #   elif defined __BUILTIN_VA_ARG_INCR
733 #    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
734 #   elif defined _AIX
735 #    define YYSTACK_ALLOC __alloca
736 #   elif defined _MSC_VER
737 #    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
738 #    define alloca _alloca
739 #   else
740 #    define YYSTACK_ALLOC alloca
741 #    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
742 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
743       /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
744 #     ifndef EXIT_SUCCESS
745 #      define EXIT_SUCCESS 0
746 #     endif
747 #    endif
748 #   endif
749 #  endif
750 # endif
751 
752 # ifdef YYSTACK_ALLOC
753    /* Pacify GCC's 'empty if-body' warning.  */
754 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
755 #  ifndef YYSTACK_ALLOC_MAXIMUM
756     /* The OS might guarantee only one guard page at the bottom of the stack,
757        and a page size can be as small as 4096 bytes.  So we cannot safely
758        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
759        to allow for a few compiler-allocated temporary stack slots.  */
760 #   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
761 #  endif
762 # else
763 #  define YYSTACK_ALLOC YYMALLOC
764 #  define YYSTACK_FREE YYFREE
765 #  ifndef YYSTACK_ALLOC_MAXIMUM
766 #   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
767 #  endif
768 #  if (defined __cplusplus && ! defined EXIT_SUCCESS \
769        && ! ((defined YYMALLOC || defined malloc) \
770              && (defined YYFREE || defined free)))
771 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
772 #   ifndef EXIT_SUCCESS
773 #    define EXIT_SUCCESS 0
774 #   endif
775 #  endif
776 #  ifndef YYMALLOC
777 #   define YYMALLOC malloc
778 #   if ! defined malloc && ! defined EXIT_SUCCESS
779 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
780 #   endif
781 #  endif
782 #  ifndef YYFREE
783 #   define YYFREE free
784 #   if ! defined free && ! defined EXIT_SUCCESS
785 void free (void *); /* INFRINGES ON USER NAME SPACE */
786 #   endif
787 #  endif
788 # endif
789 #endif /* !defined yyoverflow */
790 
791 #if (! defined yyoverflow \
792      && (! defined __cplusplus \
793          || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
794 
795 /* A type that is properly aligned for any stack member.  */
796 union yyalloc
797 {
798   yy_state_t yyss_alloc;
799   YYSTYPE yyvs_alloc;
800 };
801 
802 /* The size of the maximum gap between one aligned stack and the next.  */
803 # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
804 
805 /* The size of an array large to enough to hold all stacks, each with
806    N elements.  */
807 # define YYSTACK_BYTES(N) \
808      ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
809       + YYSTACK_GAP_MAXIMUM)
810 
811 # define YYCOPY_NEEDED 1
812 
813 /* Relocate STACK from its old location to the new one.  The
814    local variables YYSIZE and YYSTACKSIZE give the old and new number of
815    elements in the stack, and YYPTR gives the new location of the
816    stack.  Advance YYPTR to a properly aligned location for the next
817    stack.  */
818 # define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
819     do                                                                  \
820       {                                                                 \
821         YYPTRDIFF_T yynewbytes;                                         \
822         YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
823         Stack = &yyptr->Stack_alloc;                                    \
824         yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
825         yyptr += yynewbytes / YYSIZEOF (*yyptr);                        \
826       }                                                                 \
827     while (0)
828 
829 #endif
830 
831 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
832 /* Copy COUNT objects from SRC to DST.  The source and destination do
833    not overlap.  */
834 # ifndef YYCOPY
835 #  if defined __GNUC__ && 1 < __GNUC__
836 #   define YYCOPY(Dst, Src, Count) \
837       __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
838 #  else
839 #   define YYCOPY(Dst, Src, Count)              \
840       do                                        \
841         {                                       \
842           YYPTRDIFF_T yyi;                      \
843           for (yyi = 0; yyi < (Count); yyi++)   \
844             (Dst)[yyi] = (Src)[yyi];            \
845         }                                       \
846       while (0)
847 #  endif
848 # endif
849 #endif /* !YYCOPY_NEEDED */
850 
851 /* YYFINAL -- State number of the termination state.  */
852 #define YYFINAL  48
853 /* YYLAST -- Last index in YYTABLE.  */
854 #define YYLAST   74
855 
856 /* YYNTOKENS -- Number of terminals.  */
857 #define YYNTOKENS  29
858 /* YYNNTS -- Number of nonterminals.  */
859 #define YYNNTS  16
860 /* YYNRULES -- Number of rules.  */
861 #define YYNRULES  45
862 /* YYNSTATES -- Number of states.  */
863 #define YYNSTATES  82
864 
865 /* YYMAXUTOK -- Last valid token kind.  */
866 #define YYMAXUTOK   267
867 
868 
869 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
870    as returned by yylex, with out-of-bounds checking.  */
871 #define YYTRANSLATE(YYX)                                \
872   (0 <= (YYX) && (YYX) <= YYMAXUTOK                     \
873    ? YY_CAST (yysymbol_kind_t, yytranslate[YYX])        \
874    : YYSYMBOL_YYUNDEF)
875 
876 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
877    as returned by yylex.  */
878 static const yytype_int8 yytranslate[] =
879 {
880        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
881        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
882        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
883        2,     2,     2,    19,     2,     2,     2,    15,    24,     2,
884       13,    14,    20,    17,     2,    16,     2,    21,     2,     2,
885        2,     2,     2,     2,     2,     2,     2,     2,    28,     2,
886       22,     2,    23,    27,     2,     2,     2,     2,     2,     2,
887        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
888        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
889        2,     2,     2,     2,    25,     2,     2,     2,     2,     2,
890        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
891        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
892        2,     2,     2,     2,    26,     2,    18,     2,     2,     2,
893        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
894        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
895        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
896        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
897        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
898        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
899        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
900        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
901        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
902        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
903        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
904        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
905        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
906        5,     6,     7,     8,     9,    10,    11,    12
907 };
908 
909 #if YYDEBUG
910 /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
911 static const yytype_int16 yyrline[] =
912 {
913        0,   343,   343,   344,   345,   346,   347,   351,   352,   353,
914      357,   358,   359,   360,   361,   365,   366,   367,   368,   372,
915      373,   374,   378,   379,   380,   384,   385,   386,   387,   388,
916      392,   393,   394,   398,   399,   403,   404,   408,   409,   413,
917      414,   418,   419,   423,   424,   428
918 };
919 #endif
920 
921 /** Accessing symbol of state STATE.  */
922 #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
923 
924 #if YYDEBUG || 0
925 /* The user-facing name of the symbol whose (internal) number is
926    YYSYMBOL.  No bounds checking.  */
927 static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
928 
929 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
930    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
931 static const char *const yytname[] =
932 {
933   "\"end of file\"", "error", "\"invalid token\"", "INTEGER",
934   "IDENTIFIER", "LEFT_OP", "RIGHT_OP", "LE_OP", "GE_OP", "EQ_OP", "NE_OP",
935   "AND_OP", "OR_OP", "'('", "')'", "'%'", "'-'", "'+'", "'~'", "'!'",
936   "'*'", "'/'", "'<'", "'>'", "'&'", "'^'", "'|'", "'?'", "':'", "$accept",
937   "primary_expression", "addend", "unary_expression",
938   "multiplicative_expression", "additive_expression", "shift_expression",
939   "relational_expression", "equality_expression", "and_expression",
940   "exclusive_or_expression", "inclusive_or_expression",
941   "logical_and_expression", "logical_or_expression",
942   "conditional_expression", "expression", YY_NULLPTR
943 };
944 
945 static const char *
yysymbol_name(yysymbol_kind_t yysymbol)946 yysymbol_name (yysymbol_kind_t yysymbol)
947 {
948   return yytname[yysymbol];
949 }
950 #endif
951 
952 #define YYPACT_NINF (-28)
953 
954 #define yypact_value_is_default(Yyn) \
955   ((Yyn) == YYPACT_NINF)
956 
957 #define YYTABLE_NINF (-1)
958 
959 #define yytable_value_is_error(Yyn) \
960   0
961 
962 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
963    STATE-NUM.  */
964 static const yytype_int8 yypact[] =
965 {
966        2,   -28,   -28,     2,    10,     2,     2,     2,     2,   -28,
967      -28,     9,    23,    36,     0,    37,    -8,     7,    26,    25,
968        1,   -28,    43,    31,    44,   -28,   -28,   -28,   -28,     2,
969        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
970        2,     2,     2,     2,     2,     2,     2,     2,   -28,   -28,
971       45,   -28,   -28,   -28,     9,     9,    23,    23,    36,    36,
972       36,    36,     0,     0,    37,    -8,     7,    26,    25,    30,
973      -28,   -28,     2,    17,    21,   -28,   -28,    56,    57,   -28,
974      -28,   -28
975 };
976 
977 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
978    Performed when YYTABLE does not specify something else to do.  Zero
979    means the default is an error.  */
980 static const yytype_int8 yydefact[] =
981 {
982        0,     2,     3,     0,     0,     0,     0,     0,     0,    10,
983       15,    19,    22,    25,    30,    33,    35,    37,    39,    41,
984       43,    45,     0,     0,     0,    12,    11,    13,    14,     0,
985        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
986        0,     0,     0,     0,     0,     0,     0,     0,     1,     4,
987        0,    18,    16,    17,    21,    20,    23,    24,    28,    29,
988       26,    27,    31,    32,    34,    36,    38,    40,    42,     0,
989        9,     9,     0,     0,     0,    44,     6,     0,     0,     5,
990        7,     8
991 };
992 
993 /* YYPGOTO[NTERM-NUM].  */
994 static const yytype_int8 yypgoto[] =
995 {
996      -28,   -28,   -10,    -4,    18,    19,   -27,    15,    20,    22,
997       24,    27,    28,   -28,    -9,    -3
998 };
999 
1000 /* YYDEFGOTO[NTERM-NUM].  */
1001 static const yytype_int8 yydefgoto[] =
1002 {
1003        0,     9,    73,    10,    11,    12,    13,    14,    15,    16,
1004       17,    18,    19,    20,    21,    22
1005 };
1006 
1007 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
1008    positive, shift that token.  If negative, reduce the rule whose
1009    number is the opposite.  If YYTABLE_NINF, syntax error.  */
1010 static const yytype_int8 yytable[] =
1011 {
1012       23,    25,    26,    27,    28,     1,     2,    36,    37,    58,
1013       59,    60,    61,    46,    24,     3,    42,     4,     5,     6,
1014        7,     8,    38,    39,    29,    51,    52,    53,    47,    30,
1015       31,    76,    43,    77,    78,    79,    45,    77,    78,    32,
1016       33,    34,    35,    48,    69,    49,    40,    41,    70,    71,
1017       54,    55,    44,    56,    57,    62,    63,    50,    72,    80,
1018       81,    74,    64,    75,     0,    65,     0,     0,    66,     0,
1019        0,     0,    67,     0,    68
1020 };
1021 
1022 static const yytype_int8 yycheck[] =
1023 {
1024        3,     5,     6,     7,     8,     3,     4,     7,     8,    36,
1025       37,    38,    39,    12,     4,    13,    24,    15,    16,    17,
1026       18,    19,    22,    23,    15,    29,    30,    31,    27,    20,
1027       21,    14,    25,    16,    17,    14,    11,    16,    17,    16,
1028       17,     5,     6,     0,    47,    14,     9,    10,     3,     4,
1029       32,    33,    26,    34,    35,    40,    41,    13,    28,     3,
1030        3,    71,    42,    72,    -1,    43,    -1,    -1,    44,    -1,
1031       -1,    -1,    45,    -1,    46
1032 };
1033 
1034 /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
1035    state STATE-NUM.  */
1036 static const yytype_int8 yystos[] =
1037 {
1038        0,     3,     4,    13,    15,    16,    17,    18,    19,    30,
1039       32,    33,    34,    35,    36,    37,    38,    39,    40,    41,
1040       42,    43,    44,    44,     4,    32,    32,    32,    32,    15,
1041       20,    21,    16,    17,     5,     6,     7,     8,    22,    23,
1042        9,    10,    24,    25,    26,    11,    12,    27,     0,    14,
1043       13,    32,    32,    32,    33,    33,    34,    34,    35,    35,
1044       35,    35,    36,    36,    37,    38,    39,    40,    41,    44,
1045        3,     4,    28,    31,    31,    43,    14,    16,    17,    14,
1046        3,     3
1047 };
1048 
1049 /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM.  */
1050 static const yytype_int8 yyr1[] =
1051 {
1052        0,    29,    30,    30,    30,    30,    30,    31,    31,    31,
1053       32,    32,    32,    32,    32,    33,    33,    33,    33,    34,
1054       34,    34,    35,    35,    35,    36,    36,    36,    36,    36,
1055       37,    37,    37,    38,    38,    39,    39,    40,    40,    41,
1056       41,    42,    42,    43,    43,    44
1057 };
1058 
1059 /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM.  */
1060 static const yytype_int8 yyr2[] =
1061 {
1062        0,     2,     1,     1,     3,     6,     6,     3,     3,     0,
1063        1,     2,     2,     2,     2,     1,     3,     3,     3,     1,
1064        3,     3,     1,     3,     3,     1,     3,     3,     3,     3,
1065        1,     3,     3,     1,     3,     1,     3,     1,     3,     1,
1066        3,     1,     3,     1,     5,     1
1067 };
1068 
1069 
1070 enum { YYENOMEM = -2 };
1071 
1072 #define yyerrok         (yyerrstatus = 0)
1073 #define yyclearin       (yychar = YYEMPTY)
1074 
1075 #define YYACCEPT        goto yyacceptlab
1076 #define YYABORT         goto yyabortlab
1077 #define YYERROR         goto yyerrorlab
1078 #define YYNOMEM         goto yyexhaustedlab
1079 
1080 
1081 #define YYRECOVERING()  (!!yyerrstatus)
1082 
1083 #define YYBACKUP(Token, Value)                                    \
1084   do                                                              \
1085     if (yychar == YYEMPTY)                                        \
1086       {                                                           \
1087         yychar = (Token);                                         \
1088         yylval = (Value);                                         \
1089         YYPOPSTACK (yylen);                                       \
1090         yystate = *yyssp;                                         \
1091         goto yybackup;                                            \
1092       }                                                           \
1093     else                                                          \
1094       {                                                           \
1095         yyerror (YY_("syntax error: cannot back up")); \
1096         YYERROR;                                                  \
1097       }                                                           \
1098   while (0)
1099 
1100 /* Backward compatibility with an undocumented macro.
1101    Use YYerror or YYUNDEF. */
1102 #define YYERRCODE YYUNDEF
1103 
1104 
1105 /* Enable debugging if requested.  */
1106 #if YYDEBUG
1107 
1108 # ifndef YYFPRINTF
1109 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1110 #  define YYFPRINTF fprintf
1111 # endif
1112 
1113 # define YYDPRINTF(Args)                        \
1114 do {                                            \
1115   if (yydebug)                                  \
1116     YYFPRINTF Args;                             \
1117 } while (0)
1118 
1119 
1120 
1121 
1122 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)                    \
1123 do {                                                                      \
1124   if (yydebug)                                                            \
1125     {                                                                     \
1126       YYFPRINTF (stderr, "%s ", Title);                                   \
1127       yy_symbol_print (stderr,                                            \
1128                   Kind, Value); \
1129       YYFPRINTF (stderr, "\n");                                           \
1130     }                                                                     \
1131 } while (0)
1132 
1133 
1134 /*-----------------------------------.
1135 | Print this symbol's value on YYO.  |
1136 `-----------------------------------*/
1137 
1138 static void
yy_symbol_value_print(FILE * yyo,yysymbol_kind_t yykind,YYSTYPE const * const yyvaluep)1139 yy_symbol_value_print (FILE *yyo,
1140                        yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
1141 {
1142   FILE *yyoutput = yyo;
1143   YY_USE (yyoutput);
1144   if (!yyvaluep)
1145     return;
1146   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1147   YY_USE (yykind);
1148   YY_IGNORE_MAYBE_UNINITIALIZED_END
1149 }
1150 
1151 
1152 /*---------------------------.
1153 | Print this symbol on YYO.  |
1154 `---------------------------*/
1155 
1156 static void
yy_symbol_print(FILE * yyo,yysymbol_kind_t yykind,YYSTYPE const * const yyvaluep)1157 yy_symbol_print (FILE *yyo,
1158                  yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
1159 {
1160   YYFPRINTF (yyo, "%s %s (",
1161              yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
1162 
1163   yy_symbol_value_print (yyo, yykind, yyvaluep);
1164   YYFPRINTF (yyo, ")");
1165 }
1166 
1167 /*------------------------------------------------------------------.
1168 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1169 | TOP (included).                                                   |
1170 `------------------------------------------------------------------*/
1171 
1172 static void
yy_stack_print(yy_state_t * yybottom,yy_state_t * yytop)1173 yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
1174 {
1175   YYFPRINTF (stderr, "Stack now");
1176   for (; yybottom <= yytop; yybottom++)
1177     {
1178       int yybot = *yybottom;
1179       YYFPRINTF (stderr, " %d", yybot);
1180     }
1181   YYFPRINTF (stderr, "\n");
1182 }
1183 
1184 # define YY_STACK_PRINT(Bottom, Top)                            \
1185 do {                                                            \
1186   if (yydebug)                                                  \
1187     yy_stack_print ((Bottom), (Top));                           \
1188 } while (0)
1189 
1190 
1191 /*------------------------------------------------.
1192 | Report that the YYRULE is going to be reduced.  |
1193 `------------------------------------------------*/
1194 
1195 static void
yy_reduce_print(yy_state_t * yyssp,YYSTYPE * yyvsp,int yyrule)1196 yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
1197                  int yyrule)
1198 {
1199   int yylno = yyrline[yyrule];
1200   int yynrhs = yyr2[yyrule];
1201   int yyi;
1202   YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
1203              yyrule - 1, yylno);
1204   /* The symbols being reduced.  */
1205   for (yyi = 0; yyi < yynrhs; yyi++)
1206     {
1207       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
1208       yy_symbol_print (stderr,
1209                        YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
1210                        &yyvsp[(yyi + 1) - (yynrhs)]);
1211       YYFPRINTF (stderr, "\n");
1212     }
1213 }
1214 
1215 # define YY_REDUCE_PRINT(Rule)          \
1216 do {                                    \
1217   if (yydebug)                          \
1218     yy_reduce_print (yyssp, yyvsp, Rule); \
1219 } while (0)
1220 
1221 /* Nonzero means print parse trace.  It is left uninitialized so that
1222    multiple parsers can coexist.  */
1223 int yydebug;
1224 #else /* !YYDEBUG */
1225 # define YYDPRINTF(Args) ((void) 0)
1226 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
1227 # define YY_STACK_PRINT(Bottom, Top)
1228 # define YY_REDUCE_PRINT(Rule)
1229 #endif /* !YYDEBUG */
1230 
1231 
1232 /* YYINITDEPTH -- initial size of the parser's stacks.  */
1233 #ifndef YYINITDEPTH
1234 # define YYINITDEPTH 200
1235 #endif
1236 
1237 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1238    if the built-in stack extension method is used).
1239 
1240    Do not make this value too large; the results are undefined if
1241    YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1242    evaluated with infinite-precision integer arithmetic.  */
1243 
1244 #ifndef YYMAXDEPTH
1245 # define YYMAXDEPTH 10000
1246 #endif
1247 
1248 
1249 
1250 
1251 
1252 
1253 /*-----------------------------------------------.
1254 | Release the memory associated to this symbol.  |
1255 `-----------------------------------------------*/
1256 
1257 static void
yydestruct(const char * yymsg,yysymbol_kind_t yykind,YYSTYPE * yyvaluep)1258 yydestruct (const char *yymsg,
1259             yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
1260 {
1261   YY_USE (yyvaluep);
1262   if (!yymsg)
1263     yymsg = "Deleting";
1264   YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1265 
1266   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1267   YY_USE (yykind);
1268   YY_IGNORE_MAYBE_UNINITIALIZED_END
1269 }
1270 
1271 
1272 /* Lookahead token kind.  */
1273 int yychar;
1274 
1275 /* The semantic value of the lookahead symbol.  */
1276 YYSTYPE yylval;
1277 /* Number of syntax errors so far.  */
1278 int yynerrs;
1279 
1280 
1281 
1282 
1283 /*----------.
1284 | yyparse.  |
1285 `----------*/
1286 
1287 int
yyparse(void)1288 yyparse (void)
1289 {
1290     yy_state_fast_t yystate = 0;
1291     /* Number of tokens to shift before error messages enabled.  */
1292     int yyerrstatus = 0;
1293 
1294     /* Refer to the stacks through separate pointers, to allow yyoverflow
1295        to reallocate them elsewhere.  */
1296 
1297     /* Their size.  */
1298     YYPTRDIFF_T yystacksize = YYINITDEPTH;
1299 
1300     /* The state stack: array, bottom, top.  */
1301     yy_state_t yyssa[YYINITDEPTH];
1302     yy_state_t *yyss = yyssa;
1303     yy_state_t *yyssp = yyss;
1304 
1305     /* The semantic value stack: array, bottom, top.  */
1306     YYSTYPE yyvsa[YYINITDEPTH];
1307     YYSTYPE *yyvs = yyvsa;
1308     YYSTYPE *yyvsp = yyvs;
1309 
1310   int yyn;
1311   /* The return value of yyparse.  */
1312   int yyresult;
1313   /* Lookahead symbol kind.  */
1314   yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
1315   /* The variables used to return semantic value and location from the
1316      action routines.  */
1317   YYSTYPE yyval;
1318 
1319 
1320 
1321 #define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
1322 
1323   /* The number of symbols on the RHS of the reduced rule.
1324      Keep to zero when no symbol should be popped.  */
1325   int yylen = 0;
1326 
1327   YYDPRINTF ((stderr, "Starting parse\n"));
1328 
1329   yychar = YYEMPTY; /* Cause a token to be read.  */
1330 
1331   goto yysetstate;
1332 
1333 
1334 /*------------------------------------------------------------.
1335 | yynewstate -- push a new state, which is found in yystate.  |
1336 `------------------------------------------------------------*/
1337 yynewstate:
1338   /* In all cases, when you get here, the value and location stacks
1339      have just been pushed.  So pushing a state here evens the stacks.  */
1340   yyssp++;
1341 
1342 
1343 /*--------------------------------------------------------------------.
1344 | yysetstate -- set current state (the top of the stack) to yystate.  |
1345 `--------------------------------------------------------------------*/
1346 yysetstate:
1347   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1348   YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1349   YY_IGNORE_USELESS_CAST_BEGIN
1350   *yyssp = YY_CAST (yy_state_t, yystate);
1351   YY_IGNORE_USELESS_CAST_END
1352   YY_STACK_PRINT (yyss, yyssp);
1353 
1354   if (yyss + yystacksize - 1 <= yyssp)
1355 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1356     YYNOMEM;
1357 #else
1358     {
1359       /* Get the current used size of the three stacks, in elements.  */
1360       YYPTRDIFF_T yysize = yyssp - yyss + 1;
1361 
1362 # if defined yyoverflow
1363       {
1364         /* Give user a chance to reallocate the stack.  Use copies of
1365            these so that the &'s don't force the real ones into
1366            memory.  */
1367         yy_state_t *yyss1 = yyss;
1368         YYSTYPE *yyvs1 = yyvs;
1369 
1370         /* Each stack pointer address is followed by the size of the
1371            data in use in that stack, in bytes.  This used to be a
1372            conditional around just the two extra args, but that might
1373            be undefined if yyoverflow is a macro.  */
1374         yyoverflow (YY_("memory exhausted"),
1375                     &yyss1, yysize * YYSIZEOF (*yyssp),
1376                     &yyvs1, yysize * YYSIZEOF (*yyvsp),
1377                     &yystacksize);
1378         yyss = yyss1;
1379         yyvs = yyvs1;
1380       }
1381 # else /* defined YYSTACK_RELOCATE */
1382       /* Extend the stack our own way.  */
1383       if (YYMAXDEPTH <= yystacksize)
1384         YYNOMEM;
1385       yystacksize *= 2;
1386       if (YYMAXDEPTH < yystacksize)
1387         yystacksize = YYMAXDEPTH;
1388 
1389       {
1390         yy_state_t *yyss1 = yyss;
1391         union yyalloc *yyptr =
1392           YY_CAST (union yyalloc *,
1393                    YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1394         if (! yyptr)
1395           YYNOMEM;
1396         YYSTACK_RELOCATE (yyss_alloc, yyss);
1397         YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1398 #  undef YYSTACK_RELOCATE
1399         if (yyss1 != yyssa)
1400           YYSTACK_FREE (yyss1);
1401       }
1402 # endif
1403 
1404       yyssp = yyss + yysize - 1;
1405       yyvsp = yyvs + yysize - 1;
1406 
1407       YY_IGNORE_USELESS_CAST_BEGIN
1408       YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1409                   YY_CAST (long, yystacksize)));
1410       YY_IGNORE_USELESS_CAST_END
1411 
1412       if (yyss + yystacksize - 1 <= yyssp)
1413         YYABORT;
1414     }
1415 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1416 
1417 
1418   if (yystate == YYFINAL)
1419     YYACCEPT;
1420 
1421   goto yybackup;
1422 
1423 
1424 /*-----------.
1425 | yybackup.  |
1426 `-----------*/
1427 yybackup:
1428   /* Do appropriate processing given the current state.  Read a
1429      lookahead token if we need one and don't already have one.  */
1430 
1431   /* First try to decide what to do without reference to lookahead token.  */
1432   yyn = yypact[yystate];
1433   if (yypact_value_is_default (yyn))
1434     goto yydefault;
1435 
1436   /* Not known => get a lookahead token if don't already have one.  */
1437 
1438   /* YYCHAR is either empty, or end-of-input, or a valid lookahead.  */
1439   if (yychar == YYEMPTY)
1440     {
1441       YYDPRINTF ((stderr, "Reading a token\n"));
1442       yychar = yylex ();
1443     }
1444 
1445   if (yychar <= YYEOF)
1446     {
1447       yychar = YYEOF;
1448       yytoken = YYSYMBOL_YYEOF;
1449       YYDPRINTF ((stderr, "Now at end of input.\n"));
1450     }
1451   else if (yychar == YYerror)
1452     {
1453       /* The scanner already issued an error message, process directly
1454          to error recovery.  But do not keep the error token as
1455          lookahead, it is too special and may lead us to an endless
1456          loop in error recovery. */
1457       yychar = YYUNDEF;
1458       yytoken = YYSYMBOL_YYerror;
1459       goto yyerrlab1;
1460     }
1461   else
1462     {
1463       yytoken = YYTRANSLATE (yychar);
1464       YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1465     }
1466 
1467   /* If the proper action on seeing token YYTOKEN is to reduce or to
1468      detect an error, take that action.  */
1469   yyn += yytoken;
1470   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1471     goto yydefault;
1472   yyn = yytable[yyn];
1473   if (yyn <= 0)
1474     {
1475       if (yytable_value_is_error (yyn))
1476         goto yyerrlab;
1477       yyn = -yyn;
1478       goto yyreduce;
1479     }
1480 
1481   /* Count tokens shifted since error; after three, turn off error
1482      status.  */
1483   if (yyerrstatus)
1484     yyerrstatus--;
1485 
1486   /* Shift the lookahead token.  */
1487   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1488   yystate = yyn;
1489   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1490   *++yyvsp = yylval;
1491   YY_IGNORE_MAYBE_UNINITIALIZED_END
1492 
1493   /* Discard the shifted token.  */
1494   yychar = YYEMPTY;
1495   goto yynewstate;
1496 
1497 
1498 /*-----------------------------------------------------------.
1499 | yydefault -- do the default action for the current state.  |
1500 `-----------------------------------------------------------*/
1501 yydefault:
1502   yyn = yydefact[yystate];
1503   if (yyn == 0)
1504     goto yyerrlab;
1505   goto yyreduce;
1506 
1507 
1508 /*-----------------------------.
1509 | yyreduce -- do a reduction.  |
1510 `-----------------------------*/
1511 yyreduce:
1512   /* yyn is the number of a rule to reduce with.  */
1513   yylen = yyr2[yyn];
1514 
1515   /* If YYLEN is nonzero, implement the default value of the action:
1516      '$$ = $1'.
1517 
1518      Otherwise, the following line sets YYVAL to garbage.
1519      This behavior is undocumented and Bison
1520      users should not rely upon it.  Assigning to YYVAL
1521      unconditionally makes the parser a bit smaller, and it avoids a
1522      GCC warning that YYVAL may be used uninitialized.  */
1523   yyval = yyvsp[1-yylen];
1524 
1525 
1526   YY_REDUCE_PRINT (yyn);
1527   switch (yyn)
1528     {
1529   case 2: /* primary_expression: INTEGER  */
1530 #line 343 "./config/loongarch-parse.y"
1531                   {emit_const ((yyvsp[0].imm));}
1532 #line 1533 "config/loongarch-parse.c"
1533     break;
1534 
1535   case 3: /* primary_expression: IDENTIFIER  */
1536 #line 344 "./config/loongarch-parse.y"
1537                      {emit_const_var ((yyvsp[0].c_str));}
1538 #line 1539 "config/loongarch-parse.c"
1539     break;
1540 
1541   case 5: /* primary_expression: '%' IDENTIFIER '(' IDENTIFIER addend ')'  */
1542 #line 346 "./config/loongarch-parse.y"
1543                                                    {reloc ((yyvsp[-4].c_str), (yyvsp[-2].c_str), (yyvsp[-1].imm)); free ((yyvsp[-4].c_str)); free ((yyvsp[-2].c_str));}
1544 #line 1545 "config/loongarch-parse.c"
1545     break;
1546 
1547   case 6: /* primary_expression: '%' IDENTIFIER '(' INTEGER addend ')'  */
1548 #line 347 "./config/loongarch-parse.y"
1549                                                 {reloc ((yyvsp[-4].c_str), NULL, (yyvsp[-2].imm) + (yyvsp[-1].imm)); free ((yyvsp[-4].c_str));}
1550 #line 1551 "config/loongarch-parse.c"
1551     break;
1552 
1553   case 7: /* addend: addend '-' INTEGER  */
1554 #line 351 "./config/loongarch-parse.y"
1555                              {(yyval.imm) -= (yyvsp[0].imm);}
1556 #line 1557 "config/loongarch-parse.c"
1557     break;
1558 
1559   case 8: /* addend: addend '+' INTEGER  */
1560 #line 352 "./config/loongarch-parse.y"
1561                              {(yyval.imm) += (yyvsp[0].imm);}
1562 #line 1563 "config/loongarch-parse.c"
1563     break;
1564 
1565   case 9: /* addend: %empty  */
1566 #line 353 "./config/loongarch-parse.y"
1567           {(yyval.imm) = 0;}
1568 #line 1569 "config/loongarch-parse.c"
1569     break;
1570 
1571   case 11: /* unary_expression: '+' unary_expression  */
1572 #line 358 "./config/loongarch-parse.y"
1573                                {emit_unary ('+');}
1574 #line 1575 "config/loongarch-parse.c"
1575     break;
1576 
1577   case 12: /* unary_expression: '-' unary_expression  */
1578 #line 359 "./config/loongarch-parse.y"
1579                                {emit_unary ('-');}
1580 #line 1581 "config/loongarch-parse.c"
1581     break;
1582 
1583   case 13: /* unary_expression: '~' unary_expression  */
1584 #line 360 "./config/loongarch-parse.y"
1585                                {emit_unary ('~');}
1586 #line 1587 "config/loongarch-parse.c"
1587     break;
1588 
1589   case 14: /* unary_expression: '!' unary_expression  */
1590 #line 361 "./config/loongarch-parse.y"
1591                                {emit_unary ('!');}
1592 #line 1593 "config/loongarch-parse.c"
1593     break;
1594 
1595   case 16: /* multiplicative_expression: multiplicative_expression '*' unary_expression  */
1596 #line 366 "./config/loongarch-parse.y"
1597                                                          {emit_bin ('*');}
1598 #line 1599 "config/loongarch-parse.c"
1599     break;
1600 
1601   case 17: /* multiplicative_expression: multiplicative_expression '/' unary_expression  */
1602 #line 367 "./config/loongarch-parse.y"
1603                                                          {emit_bin ('/');}
1604 #line 1605 "config/loongarch-parse.c"
1605     break;
1606 
1607   case 18: /* multiplicative_expression: multiplicative_expression '%' unary_expression  */
1608 #line 368 "./config/loongarch-parse.y"
1609                                                          {emit_bin ('%');}
1610 #line 1611 "config/loongarch-parse.c"
1611     break;
1612 
1613   case 20: /* additive_expression: additive_expression '+' multiplicative_expression  */
1614 #line 373 "./config/loongarch-parse.y"
1615                                                             {emit_bin ('+');}
1616 #line 1617 "config/loongarch-parse.c"
1617     break;
1618 
1619   case 21: /* additive_expression: additive_expression '-' multiplicative_expression  */
1620 #line 374 "./config/loongarch-parse.y"
1621                                                             {emit_bin ('-');}
1622 #line 1623 "config/loongarch-parse.c"
1623     break;
1624 
1625   case 23: /* shift_expression: shift_expression LEFT_OP additive_expression  */
1626 #line 379 "./config/loongarch-parse.y"
1627                                                        {emit_bin (LEFT_OP);}
1628 #line 1629 "config/loongarch-parse.c"
1629     break;
1630 
1631   case 24: /* shift_expression: shift_expression RIGHT_OP additive_expression  */
1632 #line 380 "./config/loongarch-parse.y"
1633                                                         {emit_bin (RIGHT_OP);}
1634 #line 1635 "config/loongarch-parse.c"
1635     break;
1636 
1637   case 26: /* relational_expression: relational_expression '<' shift_expression  */
1638 #line 385 "./config/loongarch-parse.y"
1639                                                      {emit_bin ('<');}
1640 #line 1641 "config/loongarch-parse.c"
1641     break;
1642 
1643   case 27: /* relational_expression: relational_expression '>' shift_expression  */
1644 #line 386 "./config/loongarch-parse.y"
1645                                                      {emit_bin ('>');}
1646 #line 1647 "config/loongarch-parse.c"
1647     break;
1648 
1649   case 28: /* relational_expression: relational_expression LE_OP shift_expression  */
1650 #line 387 "./config/loongarch-parse.y"
1651                                                        {emit_bin (LE_OP);}
1652 #line 1653 "config/loongarch-parse.c"
1653     break;
1654 
1655   case 29: /* relational_expression: relational_expression GE_OP shift_expression  */
1656 #line 388 "./config/loongarch-parse.y"
1657                                                        {emit_bin (GE_OP);}
1658 #line 1659 "config/loongarch-parse.c"
1659     break;
1660 
1661   case 31: /* equality_expression: equality_expression EQ_OP relational_expression  */
1662 #line 393 "./config/loongarch-parse.y"
1663                                                           {emit_bin (EQ_OP);}
1664 #line 1665 "config/loongarch-parse.c"
1665     break;
1666 
1667   case 32: /* equality_expression: equality_expression NE_OP relational_expression  */
1668 #line 394 "./config/loongarch-parse.y"
1669                                                           {emit_bin (NE_OP);}
1670 #line 1671 "config/loongarch-parse.c"
1671     break;
1672 
1673   case 34: /* and_expression: and_expression '&' equality_expression  */
1674 #line 399 "./config/loongarch-parse.y"
1675                                                  {emit_bin ('&');}
1676 #line 1677 "config/loongarch-parse.c"
1677     break;
1678 
1679   case 36: /* exclusive_or_expression: exclusive_or_expression '^' and_expression  */
1680 #line 404 "./config/loongarch-parse.y"
1681                                                      {emit_bin ('^');}
1682 #line 1683 "config/loongarch-parse.c"
1683     break;
1684 
1685   case 38: /* inclusive_or_expression: inclusive_or_expression '|' exclusive_or_expression  */
1686 #line 409 "./config/loongarch-parse.y"
1687                                                               {emit_bin ('|');}
1688 #line 1689 "config/loongarch-parse.c"
1689     break;
1690 
1691   case 40: /* logical_and_expression: logical_and_expression AND_OP inclusive_or_expression  */
1692 #line 414 "./config/loongarch-parse.y"
1693                                                                 {emit_bin (AND_OP);}
1694 #line 1695 "config/loongarch-parse.c"
1695     break;
1696 
1697   case 42: /* logical_or_expression: logical_or_expression OR_OP logical_and_expression  */
1698 #line 419 "./config/loongarch-parse.y"
1699                                                              {emit_bin (OR_OP);}
1700 #line 1701 "config/loongarch-parse.c"
1701     break;
1702 
1703   case 44: /* conditional_expression: logical_or_expression '?' expression ':' conditional_expression  */
1704 #line 424 "./config/loongarch-parse.y"
1705                                                                           {emit_if_else ();}
1706 #line 1707 "config/loongarch-parse.c"
1707     break;
1708 
1709 
1710 #line 1711 "config/loongarch-parse.c"
1711 
1712       default: break;
1713     }
1714   /* User semantic actions sometimes alter yychar, and that requires
1715      that yytoken be updated with the new translation.  We take the
1716      approach of translating immediately before every use of yytoken.
1717      One alternative is translating here after every semantic action,
1718      but that translation would be missed if the semantic action invokes
1719      YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1720      if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
1721      incorrect destructor might then be invoked immediately.  In the
1722      case of YYERROR or YYBACKUP, subsequent parser actions might lead
1723      to an incorrect destructor call or verbose syntax error message
1724      before the lookahead is translated.  */
1725   YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
1726 
1727   YYPOPSTACK (yylen);
1728   yylen = 0;
1729 
1730   *++yyvsp = yyval;
1731 
1732   /* Now 'shift' the result of the reduction.  Determine what state
1733      that goes to, based on the state we popped back to and the rule
1734      number reduced by.  */
1735   {
1736     const int yylhs = yyr1[yyn] - YYNTOKENS;
1737     const int yyi = yypgoto[yylhs] + *yyssp;
1738     yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1739                ? yytable[yyi]
1740                : yydefgoto[yylhs]);
1741   }
1742 
1743   goto yynewstate;
1744 
1745 
1746 /*--------------------------------------.
1747 | yyerrlab -- here on detecting error.  |
1748 `--------------------------------------*/
1749 yyerrlab:
1750   /* Make sure we have latest lookahead translation.  See comments at
1751      user semantic actions for why this is necessary.  */
1752   yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
1753   /* If not already recovering from an error, report this error.  */
1754   if (!yyerrstatus)
1755     {
1756       ++yynerrs;
1757       yyerror (YY_("syntax error"));
1758     }
1759 
1760   if (yyerrstatus == 3)
1761     {
1762       /* If just tried and failed to reuse lookahead token after an
1763          error, discard it.  */
1764 
1765       if (yychar <= YYEOF)
1766         {
1767           /* Return failure if at end of input.  */
1768           if (yychar == YYEOF)
1769             YYABORT;
1770         }
1771       else
1772         {
1773           yydestruct ("Error: discarding",
1774                       yytoken, &yylval);
1775           yychar = YYEMPTY;
1776         }
1777     }
1778 
1779   /* Else will try to reuse lookahead token after shifting the error
1780      token.  */
1781   goto yyerrlab1;
1782 
1783 
1784 /*---------------------------------------------------.
1785 | yyerrorlab -- error raised explicitly by YYERROR.  |
1786 `---------------------------------------------------*/
1787 yyerrorlab:
1788   /* Pacify compilers when the user code never invokes YYERROR and the
1789      label yyerrorlab therefore never appears in user code.  */
1790   if (0)
1791     YYERROR;
1792   ++yynerrs;
1793 
1794   /* Do not reclaim the symbols of the rule whose action triggered
1795      this YYERROR.  */
1796   YYPOPSTACK (yylen);
1797   yylen = 0;
1798   YY_STACK_PRINT (yyss, yyssp);
1799   yystate = *yyssp;
1800   goto yyerrlab1;
1801 
1802 
1803 /*-------------------------------------------------------------.
1804 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
1805 `-------------------------------------------------------------*/
1806 yyerrlab1:
1807   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
1808 
1809   /* Pop stack until we find a state that shifts the error token.  */
1810   for (;;)
1811     {
1812       yyn = yypact[yystate];
1813       if (!yypact_value_is_default (yyn))
1814         {
1815           yyn += YYSYMBOL_YYerror;
1816           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
1817             {
1818               yyn = yytable[yyn];
1819               if (0 < yyn)
1820                 break;
1821             }
1822         }
1823 
1824       /* Pop the current state because it cannot handle the error token.  */
1825       if (yyssp == yyss)
1826         YYABORT;
1827 
1828 
1829       yydestruct ("Error: popping",
1830                   YY_ACCESSING_SYMBOL (yystate), yyvsp);
1831       YYPOPSTACK (1);
1832       yystate = *yyssp;
1833       YY_STACK_PRINT (yyss, yyssp);
1834     }
1835 
1836   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1837   *++yyvsp = yylval;
1838   YY_IGNORE_MAYBE_UNINITIALIZED_END
1839 
1840 
1841   /* Shift the error token.  */
1842   YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
1843 
1844   yystate = yyn;
1845   goto yynewstate;
1846 
1847 
1848 /*-------------------------------------.
1849 | yyacceptlab -- YYACCEPT comes here.  |
1850 `-------------------------------------*/
1851 yyacceptlab:
1852   yyresult = 0;
1853   goto yyreturnlab;
1854 
1855 
1856 /*-----------------------------------.
1857 | yyabortlab -- YYABORT comes here.  |
1858 `-----------------------------------*/
1859 yyabortlab:
1860   yyresult = 1;
1861   goto yyreturnlab;
1862 
1863 
1864 /*-----------------------------------------------------------.
1865 | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here.  |
1866 `-----------------------------------------------------------*/
1867 yyexhaustedlab:
1868   yyerror (YY_("memory exhausted"));
1869   yyresult = 2;
1870   goto yyreturnlab;
1871 
1872 
1873 /*----------------------------------------------------------.
1874 | yyreturnlab -- parsing is finished, clean up and return.  |
1875 `----------------------------------------------------------*/
1876 yyreturnlab:
1877   if (yychar != YYEMPTY)
1878     {
1879       /* Make sure we have latest lookahead translation.  See comments at
1880          user semantic actions for why this is necessary.  */
1881       yytoken = YYTRANSLATE (yychar);
1882       yydestruct ("Cleanup: discarding lookahead",
1883                   yytoken, &yylval);
1884     }
1885   /* Do not reclaim the symbols of the rule whose action triggered
1886      this YYABORT or YYACCEPT.  */
1887   YYPOPSTACK (yylen);
1888   YY_STACK_PRINT (yyss, yyssp);
1889   while (yyssp != yyss)
1890     {
1891       yydestruct ("Cleanup: popping",
1892                   YY_ACCESSING_SYMBOL (+*yyssp), yyvsp);
1893       YYPOPSTACK (1);
1894     }
1895 #ifndef yyoverflow
1896   if (yyss != yyssa)
1897     YYSTACK_FREE (yyss);
1898 #endif
1899 
1900   return yyresult;
1901 }
1902 
1903 #line 430 "./config/loongarch-parse.y"
1904 
1905 
1906