Debian Codegraph @

src/fcml_intel_parser_def.c

raw
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 1
59
60 /* Push parsers. */
61 #define YYPUSH 0
62
63 /* Pull parsers. */
64 #define YYPULL 1
65
66 /* Substitute the type names. */
67 #define YYSTYPE INTEL_STYPE
68 #define YYLTYPE INTEL_LTYPE
69 /* Substitute the variable and function names. */
70 #define yyparse intel_parse
71 #define yylex intel_lex
72 #define yyerror intel_error
73 #define yydebug intel_debug
74 #define yynerrs intel_nerrs
75
76 /* First part of user prologue. */
77 #line 32 "fcml_intel_parser_def.y"
78
79 #include <stdio.h>
80 #include "fcml_parser_utils.h"
81
82 /* Macro responsible for handling 'Out of memory' errors. */
83 #define HANDLE_ERRORS(x) if( !x ) { yyerror(&yylloc, pd, "Out of memory."); \
84 YYERROR; }
85
86 /* Macro responsible for adding error messages to result. */
87 #define ADD_ERROR_MSG(x) { yyerror(&yylloc, pd, x ); }
88
89 #line 90 "fcml_intel_parser_def.c"
90
91 # ifndef YY_CAST
92 # ifdef __cplusplus
93 # define YY_CAST(Type, Val) static_cast<Type> (Val)
94 # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
95 # else
96 # define YY_CAST(Type, Val) ((Type) (Val))
97 # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
98 # endif
99 # endif
100 # ifndef YY_NULLPTR
101 # if defined __cplusplus
102 # if 201103L <= __cplusplus
103 # define YY_NULLPTR nullptr
104 # else
105 # define YY_NULLPTR 0
106 # endif
107 # else
108 # define YY_NULLPTR ((void*)0)
109 # endif
110 # endif
111
112 /* Use api.header.include to #include this header
113 instead of duplicating it here. */
114 #ifndef YY_INTEL_FCML_INTEL_PARSER_DEF_H_INCLUDED
115 # define YY_INTEL_FCML_INTEL_PARSER_DEF_H_INCLUDED
116 /* Debug traces. */
117 #ifndef INTEL_DEBUG
118 # if defined YYDEBUG
119 #if YYDEBUG
120 # define INTEL_DEBUG 1
121 # else
122 # define INTEL_DEBUG 0
123 # endif
124 # else /* ! defined YYDEBUG */
125 # define INTEL_DEBUG 0
126 # endif /* ! defined YYDEBUG */
127 #endif /* ! defined INTEL_DEBUG */
128 #if INTEL_DEBUG
129 extern int intel_debug;
130 #endif
131
132 /* Token kinds. */
133 #ifndef INTEL_TOKENTYPE
134 # define INTEL_TOKENTYPE
135 enum intel_tokentype
136 {
137 INTEL_EMPTY = -2,
138 INTEL_EOF = 0, /* "end of file" */
139 INTEL_error = 256, /* error */
140 INTEL_UNDEF = 257, /* "invalid token" */
141 FCML_TK_UNEXPECTED = 258, /* FCML_TK_UNEXPECTED */
142 FCML_TK_REG_GPR = 259, /* FCML_TK_REG_GPR */
143 FCML_TK_REG_SIMD = 260, /* FCML_TK_REG_SIMD */
144 FCML_TK_REG_FPU = 261, /* FCML_TK_REG_FPU */
145 FCML_TK_REG_SEG = 262, /* FCML_TK_REG_SEG */
146 FCML_TK_REG_OPMASK = 263, /* FCML_TK_REG_OPMASK */
147 FCML_TK_REG_CR = 264, /* FCML_TK_REG_CR */
148 FCML_TK_REG_DR = 265, /* FCML_TK_REG_DR */
149 FCML_TK_REG_RIP = 266, /* FCML_TK_REG_RIP */
150 FCML_TK_DECORATOR_BCAST = 267, /* FCML_TK_DECORATOR_BCAST */
151 FCML_TK_DECORATOR_ER = 268, /* FCML_TK_DECORATOR_ER */
152 FCML_TK_DECORATOR_Z = 269, /* FCML_TK_DECORATOR_Z */
153 FCML_TK_DECORATOR_SAE = 270, /* FCML_TK_DECORATOR_SAE */
154 FCML_TK_OPMASK_REG_DECORATOR = 271, /* FCML_TK_OPMASK_REG_DECORATOR */
155 FCML_TK_INTEGER = 272, /* FCML_TK_INTEGER */
156 FCML_TK_FLOAT = 273, /* FCML_TK_FLOAT */
157 FCML_TK_SIZE_OPERATOR = 274, /* FCML_TK_SIZE_OPERATOR */
158 FCML_TK_SYMBOL = 275, /* FCML_TK_SYMBOL */
159 FCML_TK_HINTS = 276, /* FCML_TK_HINTS */
160 FCML_TK_EAO_HINTS = 277, /* FCML_TK_EAO_HINTS */
161 FCML_TK_SIB_HINT = 278, /* FCML_TK_SIB_HINT */
162 FCML_TK_PREFIX = 279, /* FCML_TK_PREFIX */
163 FCML_OP_UMINUS = 280 /* FCML_OP_UMINUS */
164 };
165 typedef enum intel_tokentype intel_token_kind_t;
166 #endif
167 /* Token kinds. */
168 #define INTEL_EMPTY -2
169 #define INTEL_EOF 0
170 #define INTEL_error 256
171 #define INTEL_UNDEF 257
172 #define FCML_TK_UNEXPECTED 258
173 #define FCML_TK_REG_GPR 259
174 #define FCML_TK_REG_SIMD 260
175 #define FCML_TK_REG_FPU 261
176 #define FCML_TK_REG_SEG 262
177 #define FCML_TK_REG_OPMASK 263
178 #define FCML_TK_REG_CR 264
179 #define FCML_TK_REG_DR 265
180 #define FCML_TK_REG_RIP 266
181 #define FCML_TK_DECORATOR_BCAST 267
182 #define FCML_TK_DECORATOR_ER 268
183 #define FCML_TK_DECORATOR_Z 269
184 #define FCML_TK_DECORATOR_SAE 270
185 #define FCML_TK_OPMASK_REG_DECORATOR 271
186 #define FCML_TK_INTEGER 272
187 #define FCML_TK_FLOAT 273
188 #define FCML_TK_SIZE_OPERATOR 274
189 #define FCML_TK_SYMBOL 275
190 #define FCML_TK_HINTS 276
191 #define FCML_TK_EAO_HINTS 277
192 #define FCML_TK_SIB_HINT 278
193 #define FCML_TK_PREFIX 279
194 #define FCML_OP_UMINUS 280
195
196 /* Value type. */
197 #if ! defined INTEL_STYPE && ! defined INTEL_STYPE_IS_DECLARED
198 union INTEL_STYPE
199 {
200 #line 125 "fcml_intel_parser_def.y"
201
202 /*Complex values.*/
203 fcml_st_ast_val_integer integer_value;
204 fcml_st_ast_val_float float_value;
205 fcml_st_register reg_value;
206 fcml_st_ast_node *ast;
207 struct {
208 fcml_string text;
209 int length;
210 } symbol;
211 fcml_st_size_operator size_operator;
212 fcml_hints hints;
213 fcml_prefixes prefixes;
214 fcml_bool bool_value;
215 fcml_int int_value;
216
217 #line 218 "fcml_intel_parser_def.c"
218
219 };
220 typedef union INTEL_STYPE INTEL_STYPE;
221 # define INTEL_STYPE_IS_TRIVIAL 1
222 # define INTEL_STYPE_IS_DECLARED 1
223 #endif
224
225 /* Location type. */
226 #if ! defined INTEL_LTYPE && ! defined INTEL_LTYPE_IS_DECLARED
227 typedef struct INTEL_LTYPE INTEL_LTYPE;
228 struct INTEL_LTYPE
229 {
230 int first_line;
231 int first_column;
232 int last_line;
233 int last_column;
234 };
235 # define INTEL_LTYPE_IS_DECLARED 1
236 # define INTEL_LTYPE_IS_TRIVIAL 1
237 #endif
238
239
240
241
242 int intel_parse (struct fcml_st_parser_data *pd);
243
244 /* "%code provides" blocks. */
245 #line 27 "fcml_intel_parser_def.y"
246
247 #define YYSTYPE INTEL_STYPE
248 #define YYLTYPE INTEL_LTYPE
249
250 #line 251 "fcml_intel_parser_def.c"
251
252 #endif /* !YY_INTEL_FCML_INTEL_PARSER_DEF_H_INCLUDED */
253 /* Symbol kind. */
254 enum yysymbol_kind_t
255 {
256 YYSYMBOL_YYEMPTY = -2,
257 YYSYMBOL_YYEOF = 0, /* "end of file" */
258 YYSYMBOL_YYerror = 1, /* error */
259 YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
260 YYSYMBOL_FCML_TK_UNEXPECTED = 3, /* FCML_TK_UNEXPECTED */
261 YYSYMBOL_FCML_TK_REG_GPR = 4, /* FCML_TK_REG_GPR */
262 YYSYMBOL_FCML_TK_REG_SIMD = 5, /* FCML_TK_REG_SIMD */
263 YYSYMBOL_FCML_TK_REG_FPU = 6, /* FCML_TK_REG_FPU */
264 YYSYMBOL_FCML_TK_REG_SEG = 7, /* FCML_TK_REG_SEG */
265 YYSYMBOL_FCML_TK_REG_OPMASK = 8, /* FCML_TK_REG_OPMASK */
266 YYSYMBOL_FCML_TK_REG_CR = 9, /* FCML_TK_REG_CR */
267 YYSYMBOL_FCML_TK_REG_DR = 10, /* FCML_TK_REG_DR */
268 YYSYMBOL_FCML_TK_REG_RIP = 11, /* FCML_TK_REG_RIP */
269 YYSYMBOL_FCML_TK_DECORATOR_BCAST = 12, /* FCML_TK_DECORATOR_BCAST */
270 YYSYMBOL_FCML_TK_DECORATOR_ER = 13, /* FCML_TK_DECORATOR_ER */
271 YYSYMBOL_FCML_TK_DECORATOR_Z = 14, /* FCML_TK_DECORATOR_Z */
272 YYSYMBOL_FCML_TK_DECORATOR_SAE = 15, /* FCML_TK_DECORATOR_SAE */
273 YYSYMBOL_FCML_TK_OPMASK_REG_DECORATOR = 16, /* FCML_TK_OPMASK_REG_DECORATOR */
274 YYSYMBOL_FCML_TK_INTEGER = 17, /* FCML_TK_INTEGER */
275 YYSYMBOL_FCML_TK_FLOAT = 18, /* FCML_TK_FLOAT */
276 YYSYMBOL_FCML_TK_SIZE_OPERATOR = 19, /* FCML_TK_SIZE_OPERATOR */
277 YYSYMBOL_FCML_TK_SYMBOL = 20, /* FCML_TK_SYMBOL */
278 YYSYMBOL_FCML_TK_HINTS = 21, /* FCML_TK_HINTS */
279 YYSYMBOL_FCML_TK_EAO_HINTS = 22, /* FCML_TK_EAO_HINTS */
280 YYSYMBOL_FCML_TK_SIB_HINT = 23, /* FCML_TK_SIB_HINT */
281 YYSYMBOL_FCML_TK_PREFIX = 24, /* FCML_TK_PREFIX */
282 YYSYMBOL_25_ = 25, /* '-' */
283 YYSYMBOL_26_ = 26, /* '+' */
284 YYSYMBOL_27_ = 27, /* '*' */
285 YYSYMBOL_28_ = 28, /* '/' */
286 YYSYMBOL_FCML_OP_UMINUS = 29, /* FCML_OP_UMINUS */
287 YYSYMBOL_30_ = 30, /* ':' */
288 YYSYMBOL_31_ = 31, /* ',' */
289 YYSYMBOL_32_ = 32, /* '[' */
290 YYSYMBOL_33_ = 33, /* ']' */
291 YYSYMBOL_34_ = 34, /* '(' */
292 YYSYMBOL_35_ = 35, /* ')' */
293 YYSYMBOL_YYACCEPT = 36, /* $accept */
294 YYSYMBOL_start = 37, /* start */
295 YYSYMBOL_instruction = 38, /* instruction */
296 YYSYMBOL_inst_prefixes = 39, /* inst_prefixes */
297 YYSYMBOL_mnemonic = 40, /* mnemonic */
298 YYSYMBOL_hint_list = 41, /* hint_list */
299 YYSYMBOL_operand_list = 42, /* operand_list */
300 YYSYMBOL_operand = 43, /* operand */
301 YYSYMBOL_effective_address = 44, /* effective_address */
302 YYSYMBOL_effective_address_components = 45, /* effective_address_components */
303 YYSYMBOL_segment_selector = 46, /* segment_selector */
304 YYSYMBOL_far_pointer = 47, /* far_pointer */
305 YYSYMBOL_exp = 48, /* exp */
306 YYSYMBOL_reg = 49 /* reg */
307 };
308 typedef enum yysymbol_kind_t yysymbol_kind_t;
309
310
311 /* Second part of user prologue. */
312 #line 142 "fcml_intel_parser_def.y"
313
314 #include "fcml_intel_lexer.h"
315 #define yyscanner ((yyscan_t)pd->scannerInfo)
316 void intel_error(YYLTYPE *yyloc, struct fcml_st_parser_data *pd,
317 const char *error );
318
319 #line 320 "fcml_intel_parser_def.c"
320
321
322 #ifdef short
323 # undef short
324 #endif
325
326 /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
327 <limits.h> and (if available) <stdint.h> are included
328 so that the code can choose integer types of a good width. */
329
330 #ifndef __PTRDIFF_MAX__
331 # include <limits.h> /* INFRINGES ON USER NAME SPACE */
332 # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
333 # include <stdint.h> /* INFRINGES ON USER NAME SPACE */
334 # define YY_STDINT_H
335 # endif
336 #endif
337
338 /* Narrow types that promote to a signed type and that can represent a
339 signed or unsigned integer of at least N bits. In tables they can
340 save space and decrease cache pressure. Promoting to a signed type
341 helps avoid bugs in integer arithmetic. */
342
343 #ifdef __INT_LEAST8_MAX__
344 typedef __INT_LEAST8_TYPE__ yytype_int8;
345 #elif defined YY_STDINT_H
346 typedef int_least8_t yytype_int8;
347 #else
348 typedef signed char yytype_int8;
349 #endif
350
351 #ifdef __INT_LEAST16_MAX__
352 typedef __INT_LEAST16_TYPE__ yytype_int16;
353 #elif defined YY_STDINT_H
354 typedef int_least16_t yytype_int16;
355 #else
356 typedef short yytype_int16;
357 #endif
358
359 /* Work around bug in HP-UX 11.23, which defines these macros
360 incorrectly for preprocessor constants. This workaround can likely
361 be removed in 2023, as HPE has promised support for HP-UX 11.23
362 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
363 <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
364 #ifdef __hpux
365 # undef UINT_LEAST8_MAX
366 # undef UINT_LEAST16_MAX
367 # define UINT_LEAST8_MAX 255
368 # define UINT_LEAST16_MAX 65535
369 #endif
370
371 #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
372 typedef __UINT_LEAST8_TYPE__ yytype_uint8;
373 #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
374 && UINT_LEAST8_MAX <= INT_MAX)
375 typedef uint_least8_t yytype_uint8;
376 #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
377 typedef unsigned char yytype_uint8;
378 #else
379 typedef short yytype_uint8;
380 #endif
381
382 #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
383 typedef __UINT_LEAST16_TYPE__ yytype_uint16;
384 #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
385 && UINT_LEAST16_MAX <= INT_MAX)
386 typedef uint_least16_t yytype_uint16;
387 #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
388 typedef unsigned short yytype_uint16;
389 #else
390 typedef int yytype_uint16;
391 #endif
392
393 #ifndef YYPTRDIFF_T
394 # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
395 # define YYPTRDIFF_T __PTRDIFF_TYPE__
396 # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
397 # elif defined PTRDIFF_MAX
398 # ifndef ptrdiff_t
399 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
400 # endif
401 # define YYPTRDIFF_T ptrdiff_t
402 # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
403 # else
404 # define YYPTRDIFF_T long
405 # define YYPTRDIFF_MAXIMUM LONG_MAX
406 # endif
407 #endif
408
409 #ifndef YYSIZE_T
410 # ifdef __SIZE_TYPE__
411 # define YYSIZE_T __SIZE_TYPE__
412 # elif defined size_t
413 # define YYSIZE_T size_t
414 # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
415 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
416 # define YYSIZE_T size_t
417 # else
418 # define YYSIZE_T unsigned
419 # endif
420 #endif
421
422 #define YYSIZE_MAXIMUM \
423 YY_CAST (YYPTRDIFF_T, \
424 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
425 ? YYPTRDIFF_MAXIMUM \
426 : YY_CAST (YYSIZE_T, -1)))
427
428 #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
429
430
431 /* Stored state numbers (used for stacks). */
432 typedef yytype_int8 yy_state_t;
433
434 /* State numbers in computations. */
435 typedef int yy_state_fast_t;
436
437 #ifndef YY_
438 # if defined YYENABLE_NLS && YYENABLE_NLS
439 # if ENABLE_NLS
440 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
441 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
442 # endif
443 # endif
444 # ifndef YY_
445 # define YY_(Msgid) Msgid
446 # endif
447 #endif
448
449
450 #ifndef YY_ATTRIBUTE_PURE
451 # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
452 # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
453 # else
454 # define YY_ATTRIBUTE_PURE
455 # endif
456 #endif
457
458 #ifndef YY_ATTRIBUTE_UNUSED
459 # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
460 # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
461 # else
462 # define YY_ATTRIBUTE_UNUSED
463 # endif
464 #endif
465
466 /* Suppress unused-variable warnings by "using" E. */
467 #if ! defined lint || defined __GNUC__
468 # define YY_USE(E) ((void) (E))
469 #else
470 # define YY_USE(E) /* empty */
471 #endif
472
473 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
474 #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
475 # if __GNUC__ * 100 + __GNUC_MINOR__ < 407
476 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
477 _Pragma ("GCC diagnostic push") \
478 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
479 # else
480 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
481 _Pragma ("GCC diagnostic push") \
482 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
483 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
484 # endif
485 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
486 _Pragma ("GCC diagnostic pop")
487 #else
488 # define YY_INITIAL_VALUE(Value) Value
489 #endif
490 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
491 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
492 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
493 #endif
494 #ifndef YY_INITIAL_VALUE
495 # define YY_INITIAL_VALUE(Value) /* Nothing. */
496 #endif
497
498 #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
499 # define YY_IGNORE_USELESS_CAST_BEGIN \
500 _Pragma ("GCC diagnostic push") \
501 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
502 # define YY_IGNORE_USELESS_CAST_END \
503 _Pragma ("GCC diagnostic pop")
504 #endif
505 #ifndef YY_IGNORE_USELESS_CAST_BEGIN
506 # define YY_IGNORE_USELESS_CAST_BEGIN
507 # define YY_IGNORE_USELESS_CAST_END
508 #endif
509
510
511 #define YY_ASSERT(E) ((void) (0 && (E)))
512
513 #if !defined yyoverflow
514
515 /* The parser invokes alloca or malloc; define the necessary symbols. */
516
517 # ifdef YYSTACK_USE_ALLOCA
518 # if YYSTACK_USE_ALLOCA
519 # ifdef __GNUC__
520 # define YYSTACK_ALLOC __builtin_alloca
521 # elif defined __BUILTIN_VA_ARG_INCR
522 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
523 # elif defined _AIX
524 # define YYSTACK_ALLOC __alloca
525 # elif defined _MSC_VER
526 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
527 # define alloca _alloca
528 # else
529 # define YYSTACK_ALLOC alloca
530 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
531 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
532 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
533 # ifndef EXIT_SUCCESS
534 # define EXIT_SUCCESS 0
535 # endif
536 # endif
537 # endif
538 # endif
539 # endif
540
541 # ifdef YYSTACK_ALLOC
542 /* Pacify GCC's 'empty if-body' warning. */
543 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
544 # ifndef YYSTACK_ALLOC_MAXIMUM
545 /* The OS might guarantee only one guard page at the bottom of the stack,
546 and a page size can be as small as 4096 bytes. So we cannot safely
547 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
548 to allow for a few compiler-allocated temporary stack slots. */
549 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
550 # endif
551 # else
552 # define YYSTACK_ALLOC YYMALLOC
553 # define YYSTACK_FREE YYFREE
554 # ifndef YYSTACK_ALLOC_MAXIMUM
555 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
556 # endif
557 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
558 && ! ((defined YYMALLOC || defined malloc) \
559 && (defined YYFREE || defined free)))
560 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
561 # ifndef EXIT_SUCCESS
562 # define EXIT_SUCCESS 0
563 # endif
564 # endif
565 # ifndef YYMALLOC
566 # define YYMALLOC malloc
567 # if ! defined malloc && ! defined EXIT_SUCCESS
568 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
569 # endif
570 # endif
571 # ifndef YYFREE
572 # define YYFREE free
573 # if ! defined free && ! defined EXIT_SUCCESS
574 void free (void *); /* INFRINGES ON USER NAME SPACE */
575 # endif
576 # endif
577 # endif
578 #endif /* !defined yyoverflow */
579
580 #if (! defined yyoverflow \
581 && (! defined __cplusplus \
582 || (defined INTEL_LTYPE_IS_TRIVIAL && INTEL_LTYPE_IS_TRIVIAL \
583 && defined INTEL_STYPE_IS_TRIVIAL && INTEL_STYPE_IS_TRIVIAL)))
584
585 /* A type that is properly aligned for any stack member. */
586 union yyalloc
587 {
588 yy_state_t yyss_alloc;
589 YYSTYPE yyvs_alloc;
590 YYLTYPE yyls_alloc;
591 };
592
593 /* The size of the maximum gap between one aligned stack and the next. */
594 # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
595
596 /* The size of an array large to enough to hold all stacks, each with
597 N elements. */
598 # define YYSTACK_BYTES(N) \
599 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \
600 + YYSIZEOF (YYLTYPE)) \
601 + 2 * YYSTACK_GAP_MAXIMUM)
602
603 # define YYCOPY_NEEDED 1
604
605 /* Relocate STACK from its old location to the new one. The
606 local variables YYSIZE and YYSTACKSIZE give the old and new number of
607 elements in the stack, and YYPTR gives the new location of the
608 stack. Advance YYPTR to a properly aligned location for the next
609 stack. */
610 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
611 do \
612 { \
613 YYPTRDIFF_T yynewbytes; \
614 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
615 Stack = &yyptr->Stack_alloc; \
616 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
617 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
618 } \
619 while (0)
620
621 #endif
622
623 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
624 /* Copy COUNT objects from SRC to DST. The source and destination do
625 not overlap. */
626 # ifndef YYCOPY
627 # if defined __GNUC__ && 1 < __GNUC__
628 # define YYCOPY(Dst, Src, Count) \
629 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
630 # else
631 # define YYCOPY(Dst, Src, Count) \
632 do \
633 { \
634 YYPTRDIFF_T yyi; \
635 for (yyi = 0; yyi < (Count); yyi++) \
636 (Dst)[yyi] = (Src)[yyi]; \
637 } \
638 while (0)
639 # endif
640 # endif
641 #endif /* !YYCOPY_NEEDED */
642
643 /* YYFINAL -- State number of the termination state. */
644 #define YYFINAL 8
645 /* YYLAST -- Last index in YYTABLE. */
646 #define YYLAST 232
647
648 /* YYNTOKENS -- Number of terminals. */
649 #define YYNTOKENS 36
650 /* YYNNTS -- Number of nonterminals. */
651 #define YYNNTS 14
652 /* YYNRULES -- Number of rules. */
653 #define YYNRULES 72
654 /* YYNSTATES -- Number of states. */
655 #define YYNSTATES 115
656
657 /* YYMAXUTOK -- Last valid token kind. */
658 #define YYMAXUTOK 280
659
660
661 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
662 as returned by yylex, with out-of-bounds checking. */
663 #define YYTRANSLATE(YYX) \
664 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
665 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
666 : YYSYMBOL_YYUNDEF)
667
668 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
669 as returned by yylex. */
670 static const yytype_int8 yytranslate[] =
671 {
672 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
673 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
674 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
675 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
676 34, 35, 27, 26, 31, 25, 2, 28, 2, 2,
677 2, 2, 2, 2, 2, 2, 2, 2, 30, 2,
678 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
679 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
680 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
681 2, 32, 2, 33, 2, 2, 2, 2, 2, 2,
682 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
683 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
684 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
685 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
686 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
687 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
688 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
689 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
690 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
691 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
692 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
693 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
694 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
695 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
696 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
697 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
698 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
699 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
700 29
701 };
702
703 #if INTEL_DEBUG
704 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
705 static const yytype_int16 yyrline[] =
706 {
707 0, 156, 156, 157, 158, 159, 162, 163, 164, 165,
708 166, 167, 170, 171, 174, 177, 178, 181, 182, 190,
709 191, 192, 193, 194, 195, 196, 197, 198, 199, 200,
710 201, 204, 205, 206, 207, 208, 211, 212, 213, 214,
711 215, 216, 217, 218, 219, 220, 221, 222, 223, 224,
712 225, 226, 227, 228, 229, 232, 235, 238, 239, 240,
713 241, 242, 243, 244, 245, 246, 250, 251, 252, 253,
714 254, 255, 256
715 };
716 #endif
717
718 /** Accessing symbol of state STATE. */
719 #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
720
721 #if INTEL_DEBUG || 0
722 /* The user-facing name of the symbol whose (internal) number is
723 YYSYMBOL. No bounds checking. */
724 static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
725
726 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
727 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
728 static const char *const yytname[] =
729 {
730 "\"end of file\"", "error", "\"invalid token\"", "FCML_TK_UNEXPECTED",
731 "FCML_TK_REG_GPR", "FCML_TK_REG_SIMD", "FCML_TK_REG_FPU",
732 "FCML_TK_REG_SEG", "FCML_TK_REG_OPMASK", "FCML_TK_REG_CR",
733 "FCML_TK_REG_DR", "FCML_TK_REG_RIP", "FCML_TK_DECORATOR_BCAST",
734 "FCML_TK_DECORATOR_ER", "FCML_TK_DECORATOR_Z", "FCML_TK_DECORATOR_SAE",
735 "FCML_TK_OPMASK_REG_DECORATOR", "FCML_TK_INTEGER", "FCML_TK_FLOAT",
736 "FCML_TK_SIZE_OPERATOR", "FCML_TK_SYMBOL", "FCML_TK_HINTS",
737 "FCML_TK_EAO_HINTS", "FCML_TK_SIB_HINT", "FCML_TK_PREFIX", "'-'", "'+'",
738 "'*'", "'/'", "FCML_OP_UMINUS", "':'", "','", "'['", "']'", "'('", "')'",
739 "$accept", "start", "instruction", "inst_prefixes", "mnemonic",
740 "hint_list", "operand_list", "operand", "effective_address",
741 "effective_address_components", "segment_selector", "far_pointer", "exp",
742 "reg", YY_NULLPTR
743 };
744
745 static const char *
746 yysymbol_name (yysymbol_kind_t yysymbol)
747 {
748 return yytname[yysymbol];
749 }
750 #endif
751
752 #define YYPACT_NINF (-31)
753
754 #define yypact_value_is_default(Yyn) \
755 ((Yyn) == YYPACT_NINF)
756
757 #define YYTABLE_NINF (-1)
758
759 #define yytable_value_is_error(Yyn) \
760 0
761
762 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
763 STATE-NUM. */
764 static const yytype_int16 yypact[] =
765 {
766 -5, -23, -31, 14, -31, 32, 83, 33, -31, -31,
767 -31, 83, -31, -31, -31, -13, -31, -31, -31, -31,
768 -31, -31, -31, -4, -31, -31, -7, 176, -7, 114,
769 -11, -31, -8, -1, -31, 34, 26, -31, 114, -11,
770 -31, -13, 176, 22, -31, -31, 37, -7, 198, 41,
771 42, 46, 20, -31, -11, 145, -31, -31, 63, 176,
772 -7, -7, -7, -7, -7, -31, 85, -11, 64, 176,
773 -7, 42, 42, 0, -31, -7, 198, 90, -31, -31,
774 -31, 76, 56, 56, -31, -31, 42, -31, -31, 77,
775 42, -7, -7, 42, 42, 55, 69, -31, -31, 42,
776 42, -7, -7, 94, -7, -7, 42, 42, 80, 42,
777 42, -7, -7, 42, 42
778 };
779
780 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
781 Performed when YYTABLE does not specify something else to do. Zero
782 means the default is an error. */
783 static const yytype_int8 yydefact[] =
784 {
785 2, 14, 12, 0, 3, 0, 6, 4, 1, 14,
786 13, 9, 66, 67, 68, 69, 70, 71, 72, 30,
787 29, 57, 58, 0, 63, 15, 0, 0, 0, 0,
788 7, 17, 21, 0, 20, 19, 25, 5, 0, 10,
789 55, 0, 0, 0, 64, 69, 38, 0, 0, 0,
790 52, 36, 0, 16, 8, 0, 35, 24, 22, 0,
791 0, 0, 0, 0, 0, 28, 26, 11, 0, 0,
792 0, 53, 54, 37, 31, 0, 0, 0, 65, 18,
793 23, 0, 59, 60, 62, 61, 56, 27, 32, 0,
794 48, 0, 0, 50, 47, 39, 0, 33, 34, 51,
795 49, 0, 0, 0, 0, 0, 46, 45, 40, 44,
796 43, 0, 0, 42, 41
797 };
798
799 /* YYPGOTO[NTERM-NUM]. */
800 static const yytype_int8 yypgoto[] =
801 {
802 -31, -31, 105, -31, 108, 103, -6, 61, -31, -30,
803 102, -31, -26, -18
804 };
805
806 /* YYDEFGOTO[NTERM-NUM]. */
807 static const yytype_int8 yydefgoto[] =
808 {
809 0, 3, 4, 5, 6, 29, 30, 31, 32, 49,
810 33, 34, 35, 36
811 };
812
813 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
814 positive, shift that token. If negative, reduce the rule whose
815 number is the opposite. If YYTABLE_NINF, syntax error. */
816 static const yytype_int8 yytable[] =
817 {
818 44, 50, 52, 41, 56, 39, 57, 7, 58, 51,
819 21, 22, 68, 24, 8, 1, 50, 40, 26, 2,
820 55, 71, 72, 54, 51, 91, 92, 28, 42, 81,
821 73, 59, 67, 50, 82, 83, 84, 85, 86, 89,
822 65, 51, 66, 50, 90, 60, 61, 62, 63, 93,
823 94, 51, 9, 9, 69, 78, 10, 2, 95, 60,
824 61, 62, 63, 70, 64, 99, 100, 60, 61, 62,
825 63, 75, 76, 77, 74, 106, 107, 80, 109, 110,
826 101, 102, 103, 62, 63, 113, 114, 12, 13, 14,
827 15, 16, 17, 18, 104, 105, 19, 88, 20, 87,
828 21, 22, 23, 24, 25, 111, 112, 96, 26, 97,
829 98, 108, 37, 11, 38, 27, 79, 28, 12, 13,
830 14, 15, 16, 17, 18, 43, 0, 19, 0, 20,
831 0, 21, 22, 23, 24, 53, 0, 0, 0, 26,
832 0, 0, 0, 0, 0, 0, 27, 0, 28, 12,
833 13, 14, 15, 16, 17, 18, 0, 0, 19, 0,
834 20, 0, 21, 22, 23, 24, 0, 0, 0, 0,
835 26, 0, 0, 0, 0, 0, 0, 27, 0, 28,
836 12, 13, 14, 45, 16, 17, 18, 46, 0, 0,
837 0, 0, 0, 21, 22, 0, 24, 0, 47, 48,
838 0, 26, 12, 13, 14, 45, 16, 17, 18, 0,
839 28, 0, 0, 0, 0, 21, 22, 0, 24, 0,
840 0, 0, 0, 26, 0, 0, 0, 0, 0, 0,
841 0, 0, 28
842 };
843
844 static const yytype_int8 yycheck[] =
845 {
846 26, 27, 28, 7, 12, 11, 14, 30, 16, 27,
847 17, 18, 42, 20, 0, 20, 42, 30, 25, 24,
848 31, 47, 48, 29, 42, 25, 26, 34, 32, 59,
849 48, 32, 38, 59, 60, 61, 62, 63, 64, 69,
850 14, 59, 16, 69, 70, 25, 26, 27, 28, 75,
851 76, 69, 20, 20, 32, 35, 24, 24, 76, 25,
852 26, 27, 28, 26, 30, 91, 92, 25, 26, 27,
853 28, 25, 26, 27, 33, 101, 102, 14, 104, 105,
854 25, 26, 27, 27, 28, 111, 112, 4, 5, 6,
855 7, 8, 9, 10, 25, 26, 13, 33, 15, 14,
856 17, 18, 19, 20, 21, 25, 26, 17, 25, 33,
857 33, 17, 7, 5, 11, 32, 55, 34, 4, 5,
858 6, 7, 8, 9, 10, 23, -1, 13, -1, 15,
859 -1, 17, 18, 19, 20, 21, -1, -1, -1, 25,
860 -1, -1, -1, -1, -1, -1, 32, -1, 34, 4,
861 5, 6, 7, 8, 9, 10, -1, -1, 13, -1,
862 15, -1, 17, 18, 19, 20, -1, -1, -1, -1,
863 25, -1, -1, -1, -1, -1, -1, 32, -1, 34,
864 4, 5, 6, 7, 8, 9, 10, 11, -1, -1,
865 -1, -1, -1, 17, 18, -1, 20, -1, 22, 23,
866 -1, 25, 4, 5, 6, 7, 8, 9, 10, -1,
867 34, -1, -1, -1, -1, 17, 18, -1, 20, -1,
868 -1, -1, -1, 25, -1, -1, -1, -1, -1, -1,
869 -1, -1, 34
870 };
871
872 /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
873 state STATE-NUM. */
874 static const yytype_int8 yystos[] =
875 {
876 0, 20, 24, 37, 38, 39, 40, 30, 0, 20,
877 24, 40, 4, 5, 6, 7, 8, 9, 10, 13,
878 15, 17, 18, 19, 20, 21, 25, 32, 34, 41,
879 42, 43, 44, 46, 47, 48, 49, 38, 41, 42,
880 30, 7, 32, 46, 48, 7, 11, 22, 23, 45,
881 48, 49, 48, 21, 42, 31, 12, 14, 16, 32,
882 25, 26, 27, 28, 30, 14, 16, 42, 45, 32,
883 26, 48, 48, 49, 33, 25, 26, 27, 35, 43,
884 14, 45, 48, 48, 48, 48, 48, 14, 33, 45,
885 48, 25, 26, 48, 48, 49, 17, 33, 33, 48,
886 48, 25, 26, 27, 25, 26, 48, 48, 17, 48,
887 48, 25, 26, 48, 48
888 };
889
890 /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
891 static const yytype_int8 yyr1[] =
892 {
893 0, 36, 37, 37, 37, 37, 38, 38, 38, 38,
894 38, 38, 39, 39, 40, 41, 41, 42, 42, 43,
895 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
896 43, 44, 44, 44, 44, 44, 45, 45, 45, 45,
897 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
898 45, 45, 45, 45, 45, 46, 47, 48, 48, 48,
899 48, 48, 48, 48, 48, 48, 49, 49, 49, 49,
900 49, 49, 49
901 };
902
903 /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
904 static const yytype_int8 yyr2[] =
905 {
906 0, 2, 0, 1, 2, 3, 1, 2, 3, 2,
907 3, 4, 1, 2, 1, 1, 2, 1, 3, 1,
908 1, 1, 2, 3, 2, 1, 2, 3, 2, 1,
909 1, 3, 4, 4, 5, 2, 1, 2, 1, 3,
910 5, 7, 7, 5, 5, 5, 5, 3, 3, 4,
911 3, 4, 1, 2, 2, 2, 3, 1, 1, 3,
912 3, 3, 3, 1, 2, 3, 1, 1, 1, 1,
913 1, 1, 1
914 };
915
916
917 enum { YYENOMEM = -2 };
918
919 #define yyerrok (yyerrstatus = 0)
920 #define yyclearin (yychar = INTEL_EMPTY)
921
922 #define YYACCEPT goto yyacceptlab
923 #define YYABORT goto yyabortlab
924 #define YYERROR goto yyerrorlab
925 #define YYNOMEM goto yyexhaustedlab
926
927
928 #define YYRECOVERING() (!!yyerrstatus)
929
930 #define YYBACKUP(Token, Value) \
931 do \
932 if (yychar == INTEL_EMPTY) \
933 { \
934 yychar = (Token); \
935 yylval = (Value); \
936 YYPOPSTACK (yylen); \
937 yystate = *yyssp; \
938 goto yybackup; \
939 } \
940 else \
941 { \
942 yyerror (&yylloc, pd, YY_("syntax error: cannot back up")); \
943 YYERROR; \
944 } \
945 while (0)
946
947 /* Backward compatibility with an undocumented macro.
948 Use INTEL_error or INTEL_UNDEF. */
949 #define YYERRCODE INTEL_UNDEF
950
951 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
952 If N is 0, then set CURRENT to the empty location which ends
953 the previous symbol: RHS[0] (always defined). */
954
955 #ifndef YYLLOC_DEFAULT
956 # define YYLLOC_DEFAULT(Current, Rhs, N) \
957 do \
958 if (N) \
959 { \
960 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
961 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
962 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
963 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
964 } \
965 else \
966 { \
967 (Current).first_line = (Current).last_line = \
968 YYRHSLOC (Rhs, 0).last_line; \
969 (Current).first_column = (Current).last_column = \
970 YYRHSLOC (Rhs, 0).last_column; \
971 } \
972 while (0)
973 #endif
974
975 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
976
977
978 /* Enable debugging if requested. */
979 #if INTEL_DEBUG
980
981 # ifndef YYFPRINTF
982 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
983 # define YYFPRINTF fprintf
984 # endif
985
986 # define YYDPRINTF(Args) \
987 do { \
988 if (yydebug) \
989 YYFPRINTF Args; \
990 } while (0)
991
992
993 /* YYLOCATION_PRINT -- Print the location on the stream.
994 This macro was not mandated originally: define only if we know
995 we won't break user code: when these are the locations we know. */
996
997 # ifndef YYLOCATION_PRINT
998
999 # if defined YY_LOCATION_PRINT
1000
1001 /* Temporary convenience wrapper in case some people defined the
1002 undocumented and private YY_LOCATION_PRINT macros. */
1003 # define YYLOCATION_PRINT(File, Loc) YY_LOCATION_PRINT(File, *(Loc))
1004
1005 # elif defined INTEL_LTYPE_IS_TRIVIAL && INTEL_LTYPE_IS_TRIVIAL
1006
1007 /* Print *YYLOCP on YYO. Private, do not rely on its existence. */
1008
1009 YY_ATTRIBUTE_UNUSED
1010 static int
1011 yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
1012 {
1013 int res = 0;
1014 int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
1015 if (0 <= yylocp->first_line)
1016 {
1017 res += YYFPRINTF (yyo, "%d", yylocp->first_line);
1018 if (0 <= yylocp->first_column)
1019 res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
1020 }
1021 if (0 <= yylocp->last_line)
1022 {
1023 if (yylocp->first_line < yylocp->last_line)
1024 {
1025 res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
1026 if (0 <= end_col)
1027 res += YYFPRINTF (yyo, ".%d", end_col);
1028 }
1029 else if (0 <= end_col && yylocp->first_column < end_col)
1030 res += YYFPRINTF (yyo, "-%d", end_col);
1031 }
1032 return res;
1033 }
1034
1035 # define YYLOCATION_PRINT yy_location_print_
1036
1037 /* Temporary convenience wrapper in case some people defined the
1038 undocumented and private YY_LOCATION_PRINT macros. */
1039 # define YY_LOCATION_PRINT(File, Loc) YYLOCATION_PRINT(File, &(Loc))
1040
1041 # else
1042
1043 # define YYLOCATION_PRINT(File, Loc) ((void) 0)
1044 /* Temporary convenience wrapper in case some people defined the
1045 undocumented and private YY_LOCATION_PRINT macros. */
1046 # define YY_LOCATION_PRINT YYLOCATION_PRINT
1047
1048 # endif
1049 # endif /* !defined YYLOCATION_PRINT */
1050
1051
1052 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
1053 do { \
1054 if (yydebug) \
1055 { \
1056 YYFPRINTF (stderr, "%s ", Title); \
1057 yy_symbol_print (stderr, \
1058 Kind, Value, Location, pd); \
1059 YYFPRINTF (stderr, "\n"); \
1060 } \
1061 } while (0)
1062
1063
1064 /*-----------------------------------.
1065 | Print this symbol's value on YYO. |
1066 `-----------------------------------*/
1067
1068 static void
1069 yy_symbol_value_print (FILE *yyo,
1070 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, struct fcml_st_parser_data *pd)
1071 {
1072 FILE *yyoutput = yyo;
1073 YY_USE (yyoutput);
1074 YY_USE (yylocationp);
1075 YY_USE (pd);
1076 if (!yyvaluep)
1077 return;
1078 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1079 switch (yykind)
1080 {
1081 case YYSYMBOL_FCML_TK_REG_GPR: /* FCML_TK_REG_GPR */
1082 #line 123 "fcml_intel_parser_def.y"
1083 { YYFPRINTF(yyoutput, "Type: %s Size: %d Reg: %d x64_exp: %d", fcml_fn_pu_reg_type_to_string( ((*yyvaluep).reg_value).type ), ((*yyvaluep).reg_value).size, ((*yyvaluep).reg_value).reg, ((*yyvaluep).reg_value).x64_exp); }
1084 #line 1085 "fcml_intel_parser_def.c"
1085 break;
1086
1087 case YYSYMBOL_FCML_TK_REG_SIMD: /* FCML_TK_REG_SIMD */
1088 #line 123 "fcml_intel_parser_def.y"
1089 { YYFPRINTF(yyoutput, "Type: %s Size: %d Reg: %d x64_exp: %d", fcml_fn_pu_reg_type_to_string( ((*yyvaluep).reg_value).type ), ((*yyvaluep).reg_value).size, ((*yyvaluep).reg_value).reg, ((*yyvaluep).reg_value).x64_exp); }
1090 #line 1091 "fcml_intel_parser_def.c"
1091 break;
1092
1093 case YYSYMBOL_FCML_TK_REG_FPU: /* FCML_TK_REG_FPU */
1094 #line 123 "fcml_intel_parser_def.y"
1095 { YYFPRINTF(yyoutput, "Type: %s Size: %d Reg: %d x64_exp: %d", fcml_fn_pu_reg_type_to_string( ((*yyvaluep).reg_value).type ), ((*yyvaluep).reg_value).size, ((*yyvaluep).reg_value).reg, ((*yyvaluep).reg_value).x64_exp); }
1096 #line 1097 "fcml_intel_parser_def.c"
1097 break;
1098
1099 case YYSYMBOL_FCML_TK_REG_SEG: /* FCML_TK_REG_SEG */
1100 #line 123 "fcml_intel_parser_def.y"
1101 { YYFPRINTF(yyoutput, "Type: %s Size: %d Reg: %d x64_exp: %d", fcml_fn_pu_reg_type_to_string( ((*yyvaluep).reg_value).type ), ((*yyvaluep).reg_value).size, ((*yyvaluep).reg_value).reg, ((*yyvaluep).reg_value).x64_exp); }
1102 #line 1103 "fcml_intel_parser_def.c"
1103 break;
1104
1105 case YYSYMBOL_FCML_TK_REG_OPMASK: /* FCML_TK_REG_OPMASK */
1106 #line 123 "fcml_intel_parser_def.y"
1107 { YYFPRINTF(yyoutput, "Type: %s Size: %d Reg: %d x64_exp: %d", fcml_fn_pu_reg_type_to_string( ((*yyvaluep).reg_value).type ), ((*yyvaluep).reg_value).size, ((*yyvaluep).reg_value).reg, ((*yyvaluep).reg_value).x64_exp); }
1108 #line 1109 "fcml_intel_parser_def.c"
1109 break;
1110
1111 case YYSYMBOL_FCML_TK_REG_CR: /* FCML_TK_REG_CR */
1112 #line 123 "fcml_intel_parser_def.y"
1113 { YYFPRINTF(yyoutput, "Type: %s Size: %d Reg: %d x64_exp: %d", fcml_fn_pu_reg_type_to_string( ((*yyvaluep).reg_value).type ), ((*yyvaluep).reg_value).size, ((*yyvaluep).reg_value).reg, ((*yyvaluep).reg_value).x64_exp); }
1114 #line 1115 "fcml_intel_parser_def.c"
1115 break;
1116
1117 case YYSYMBOL_FCML_TK_REG_DR: /* FCML_TK_REG_DR */
1118 #line 123 "fcml_intel_parser_def.y"
1119 { YYFPRINTF(yyoutput, "Type: %s Size: %d Reg: %d x64_exp: %d", fcml_fn_pu_reg_type_to_string( ((*yyvaluep).reg_value).type ), ((*yyvaluep).reg_value).size, ((*yyvaluep).reg_value).reg, ((*yyvaluep).reg_value).x64_exp); }
1120 #line 1121 "fcml_intel_parser_def.c"
1121 break;
1122
1123 case YYSYMBOL_FCML_TK_REG_RIP: /* FCML_TK_REG_RIP */
1124 #line 123 "fcml_intel_parser_def.y"
1125 { YYFPRINTF(yyoutput, "Type: %s Size: %d Reg: %d x64_exp: %d", fcml_fn_pu_reg_type_to_string( ((*yyvaluep).reg_value).type ), ((*yyvaluep).reg_value).size, ((*yyvaluep).reg_value).reg, ((*yyvaluep).reg_value).x64_exp); }
1126 #line 1127 "fcml_intel_parser_def.c"
1127 break;
1128
1129 case YYSYMBOL_FCML_TK_OPMASK_REG_DECORATOR: /* FCML_TK_OPMASK_REG_DECORATOR */
1130 #line 123 "fcml_intel_parser_def.y"
1131 { YYFPRINTF(yyoutput, "Type: %s Size: %d Reg: %d x64_exp: %d", fcml_fn_pu_reg_type_to_string( ((*yyvaluep).reg_value).type ), ((*yyvaluep).reg_value).size, ((*yyvaluep).reg_value).reg, ((*yyvaluep).reg_value).x64_exp); }
1132 #line 1133 "fcml_intel_parser_def.c"
1133 break;
1134
1135 case YYSYMBOL_FCML_TK_INTEGER: /* FCML_TK_INTEGER */
1136 #line 120 "fcml_intel_parser_def.y"
1137 { YYFPRINTF(yyoutput, "Integer: %d Overflow: %d", ((*yyvaluep).integer_value).value, ((*yyvaluep).integer_value).overflow); }
1138 #line 1139 "fcml_intel_parser_def.c"
1139 break;
1140
1141 case YYSYMBOL_FCML_TK_FLOAT: /* FCML_TK_FLOAT */
1142 #line 121 "fcml_intel_parser_def.y"
1143 { YYFPRINTF(yyoutput, "Float: %f Overflow: %d", ((*yyvaluep).float_value).value, ((*yyvaluep).float_value).overflow); }
1144 #line 1145 "fcml_intel_parser_def.c"
1145 break;
1146
1147 case YYSYMBOL_instruction: /* instruction */
1148 #line 122 "fcml_intel_parser_def.y"
1149 { YYFPRINTF(yyoutput, "AST-Type: %d", ((*yyvaluep).ast)->type); }
1150 #line 1151 "fcml_intel_parser_def.c"
1151 break;
1152
1153 case YYSYMBOL_operand_list: /* operand_list */
1154 #line 122 "fcml_intel_parser_def.y"
1155 { YYFPRINTF(yyoutput, "AST-Type: %d", ((*yyvaluep).ast)->type); }
1156 #line 1157 "fcml_intel_parser_def.c"
1157 break;
1158
1159 case YYSYMBOL_operand: /* operand */
1160 #line 122 "fcml_intel_parser_def.y"
1161 { YYFPRINTF(yyoutput, "AST-Type: %d", ((*yyvaluep).ast)->type); }
1162 #line 1163 "fcml_intel_parser_def.c"
1163 break;
1164
1165 case YYSYMBOL_effective_address: /* effective_address */
1166 #line 122 "fcml_intel_parser_def.y"
1167 { YYFPRINTF(yyoutput, "AST-Type: %d", ((*yyvaluep).ast)->type); }
1168 #line 1169 "fcml_intel_parser_def.c"
1169 break;
1170
1171 case YYSYMBOL_effective_address_components: /* effective_address_components */
1172 #line 122 "fcml_intel_parser_def.y"
1173 { YYFPRINTF(yyoutput, "AST-Type: %d", ((*yyvaluep).ast)->type); }
1174 #line 1175 "fcml_intel_parser_def.c"
1175 break;
1176
1177 case YYSYMBOL_segment_selector: /* segment_selector */
1178 #line 123 "fcml_intel_parser_def.y"
1179 { YYFPRINTF(yyoutput, "Type: %s Size: %d Reg: %d x64_exp: %d", fcml_fn_pu_reg_type_to_string( ((*yyvaluep).reg_value).type ), ((*yyvaluep).reg_value).size, ((*yyvaluep).reg_value).reg, ((*yyvaluep).reg_value).x64_exp); }
1180 #line 1181 "fcml_intel_parser_def.c"
1181 break;
1182
1183 case YYSYMBOL_far_pointer: /* far_pointer */
1184 #line 122 "fcml_intel_parser_def.y"
1185 { YYFPRINTF(yyoutput, "AST-Type: %d", ((*yyvaluep).ast)->type); }
1186 #line 1187 "fcml_intel_parser_def.c"
1187 break;
1188
1189 case YYSYMBOL_exp: /* exp */
1190 #line 122 "fcml_intel_parser_def.y"
1191 { YYFPRINTF(yyoutput, "AST-Type: %d", ((*yyvaluep).ast)->type); }
1192 #line 1193 "fcml_intel_parser_def.c"
1193 break;
1194
1195 case YYSYMBOL_reg: /* reg */
1196 #line 123 "fcml_intel_parser_def.y"
1197 { YYFPRINTF(yyoutput, "Type: %s Size: %d Reg: %d x64_exp: %d", fcml_fn_pu_reg_type_to_string( ((*yyvaluep).reg_value).type ), ((*yyvaluep).reg_value).size, ((*yyvaluep).reg_value).reg, ((*yyvaluep).reg_value).x64_exp); }
1198 #line 1199 "fcml_intel_parser_def.c"
1199 break;
1200
1201 default:
1202 break;
1203 }
1204 YY_IGNORE_MAYBE_UNINITIALIZED_END
1205 }
1206
1207
1208 /*---------------------------.
1209 | Print this symbol on YYO. |
1210 `---------------------------*/
1211
1212 static void
1213 yy_symbol_print (FILE *yyo,
1214 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, struct fcml_st_parser_data *pd)
1215 {
1216 YYFPRINTF (yyo, "%s %s (",
1217 yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
1218
1219 YYLOCATION_PRINT (yyo, yylocationp);
1220 YYFPRINTF (yyo, ": ");
1221 yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp, pd);
1222 YYFPRINTF (yyo, ")");
1223 }
1224
1225 /*------------------------------------------------------------------.
1226 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1227 | TOP (included). |
1228 `------------------------------------------------------------------*/
1229
1230 static void
1231 yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
1232 {
1233 YYFPRINTF (stderr, "Stack now");
1234 for (; yybottom <= yytop; yybottom++)
1235 {
1236 int yybot = *yybottom;
1237 YYFPRINTF (stderr, " %d", yybot);
1238 }
1239 YYFPRINTF (stderr, "\n");
1240 }
1241
1242 # define YY_STACK_PRINT(Bottom, Top) \
1243 do { \
1244 if (yydebug) \
1245 yy_stack_print ((Bottom), (Top)); \
1246 } while (0)
1247
1248
1249 /*------------------------------------------------.
1250 | Report that the YYRULE is going to be reduced. |
1251 `------------------------------------------------*/
1252
1253 static void
1254 yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp,
1255 int yyrule, struct fcml_st_parser_data *pd)
1256 {
1257 int yylno = yyrline[yyrule];
1258 int yynrhs = yyr2[yyrule];
1259 int yyi;
1260 YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
1261 yyrule - 1, yylno);
1262 /* The symbols being reduced. */
1263 for (yyi = 0; yyi < yynrhs; yyi++)
1264 {
1265 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1266 yy_symbol_print (stderr,
1267 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
1268 &yyvsp[(yyi + 1) - (yynrhs)],
1269 &(yylsp[(yyi + 1) - (yynrhs)]), pd);
1270 YYFPRINTF (stderr, "\n");
1271 }
1272 }
1273
1274 # define YY_REDUCE_PRINT(Rule) \
1275 do { \
1276 if (yydebug) \
1277 yy_reduce_print (yyssp, yyvsp, yylsp, Rule, pd); \
1278 } while (0)
1279
1280 /* Nonzero means print parse trace. It is left uninitialized so that
1281 multiple parsers can coexist. */
1282 int yydebug;
1283 #else /* !INTEL_DEBUG */
1284 # define YYDPRINTF(Args) ((void) 0)
1285 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
1286 # define YY_STACK_PRINT(Bottom, Top)
1287 # define YY_REDUCE_PRINT(Rule)
1288 #endif /* !INTEL_DEBUG */
1289
1290
1291 /* YYINITDEPTH -- initial size of the parser's stacks. */
1292 #ifndef YYINITDEPTH
1293 # define YYINITDEPTH 200
1294 #endif
1295
1296 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1297 if the built-in stack extension method is used).
1298
1299 Do not make this value too large; the results are undefined if
1300 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1301 evaluated with infinite-precision integer arithmetic. */
1302
1303 #ifndef YYMAXDEPTH
1304 # define YYMAXDEPTH 10000
1305 #endif
1306
1307
1308
1309
1310
1311
1312 /*-----------------------------------------------.
1313 | Release the memory associated to this symbol. |
1314 `-----------------------------------------------*/
1315
1316 static void
1317 yydestruct (const char *yymsg,
1318 yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, struct fcml_st_parser_data *pd)
1319 {
1320 YY_USE (yyvaluep);
1321 YY_USE (yylocationp);
1322 YY_USE (pd);
1323 if (!yymsg)
1324 yymsg = "Deleting";
1325 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1326
1327 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1328 switch (yykind)
1329 {
1330 case YYSYMBOL_instruction: /* instruction */
1331 #line 117 "fcml_intel_parser_def.y"
1332 { fcml_fn_ast_free_node(((*yyvaluep).ast)); }
1333 #line 1334 "fcml_intel_parser_def.c"
1334 break;
1335
1336 case YYSYMBOL_operand_list: /* operand_list */
1337 #line 117 "fcml_intel_parser_def.y"
1338 { fcml_fn_ast_free_node(((*yyvaluep).ast)); }
1339 #line 1340 "fcml_intel_parser_def.c"
1340 break;
1341
1342 case YYSYMBOL_operand: /* operand */
1343 #line 117 "fcml_intel_parser_def.y"
1344 { fcml_fn_ast_free_node(((*yyvaluep).ast)); }
1345 #line 1346 "fcml_intel_parser_def.c"
1346 break;
1347
1348 case YYSYMBOL_effective_address: /* effective_address */
1349 #line 117 "fcml_intel_parser_def.y"
1350 { fcml_fn_ast_free_node(((*yyvaluep).ast)); }
1351 #line 1352 "fcml_intel_parser_def.c"
1352 break;
1353
1354 case YYSYMBOL_effective_address_components: /* effective_address_components */
1355 #line 117 "fcml_intel_parser_def.y"
1356 { fcml_fn_ast_free_node(((*yyvaluep).ast)); }
1357 #line 1358 "fcml_intel_parser_def.c"
1358 break;
1359
1360 case YYSYMBOL_far_pointer: /* far_pointer */
1361 #line 117 "fcml_intel_parser_def.y"
1362 { fcml_fn_ast_free_node(((*yyvaluep).ast)); }
1363 #line 1364 "fcml_intel_parser_def.c"
1364 break;
1365
1366 case YYSYMBOL_exp: /* exp */
1367 #line 117 "fcml_intel_parser_def.y"
1368 { fcml_fn_ast_free_node(((*yyvaluep).ast)); }
1369 #line 1370 "fcml_intel_parser_def.c"
1370 break;
1371
1372 default:
1373 break;
1374 }
1375 YY_IGNORE_MAYBE_UNINITIALIZED_END
1376 }
1377
1378
1379
1380
1381
1382
1383 /*----------.
1384 | yyparse. |
1385 `----------*/
1386
1387 int
1388 yyparse (struct fcml_st_parser_data *pd)
1389 {
1390 /* Lookahead token kind. */
1391 int yychar;
1392
1393
1394 /* The semantic value of the lookahead symbol. */
1395 /* Default value used for initialization, for pacifying older GCCs
1396 or non-GCC compilers. */
1397 YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
1398 YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1399
1400 /* Location data for the lookahead symbol. */
1401 static YYLTYPE yyloc_default
1402 # if defined INTEL_LTYPE_IS_TRIVIAL && INTEL_LTYPE_IS_TRIVIAL
1403 = { 1, 1, 1, 1 }
1404 # endif
1405 ;
1406 YYLTYPE yylloc = yyloc_default;
1407
1408 /* Number of syntax errors so far. */
1409 int yynerrs = 0;
1410
1411 yy_state_fast_t yystate = 0;
1412 /* Number of tokens to shift before error messages enabled. */
1413 int yyerrstatus = 0;
1414
1415 /* Refer to the stacks through separate pointers, to allow yyoverflow
1416 to reallocate them elsewhere. */
1417
1418 /* Their size. */
1419 YYPTRDIFF_T yystacksize = YYINITDEPTH;
1420
1421 /* The state stack: array, bottom, top. */
1422 yy_state_t yyssa[YYINITDEPTH];
1423 yy_state_t *yyss = yyssa;
1424 yy_state_t *yyssp = yyss;
1425
1426 /* The semantic value stack: array, bottom, top. */
1427 YYSTYPE yyvsa[YYINITDEPTH];
1428 YYSTYPE *yyvs = yyvsa;
1429 YYSTYPE *yyvsp = yyvs;
1430
1431 /* The location stack: array, bottom, top. */
1432 YYLTYPE yylsa[YYINITDEPTH];
1433 YYLTYPE *yyls = yylsa;
1434 YYLTYPE *yylsp = yyls;
1435
1436 int yyn;
1437 /* The return value of yyparse. */
1438 int yyresult;
1439 /* Lookahead symbol kind. */
1440 yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
1441 /* The variables used to return semantic value and location from the
1442 action routines. */
1443 YYSTYPE yyval;
1444 YYLTYPE yyloc;
1445
1446 /* The locations where the error started and ended. */
1447 YYLTYPE yyerror_range[3];
1448
1449
1450
1451 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1452
1453 /* The number of symbols on the RHS of the reduced rule.
1454 Keep to zero when no symbol should be popped. */
1455 int yylen = 0;
1456
1457 YYDPRINTF ((stderr, "Starting parse\n"));
1458
1459 yychar = INTEL_EMPTY; /* Cause a token to be read. */
1460
1461
1462 /* User initialization code. */
1463 #line 149 "fcml_intel_parser_def.y"
1464 {
1465 /* Uncomment it in order to enable debugging */
1466 /* yydebug = 1; */
1467 }
1468
1469 #line 1470 "fcml_intel_parser_def.c"
1470
1471 yylsp[0] = yylloc;
1472 goto yysetstate;
1473
1474
1475 /*------------------------------------------------------------.
1476 | yynewstate -- push a new state, which is found in yystate. |
1477 `------------------------------------------------------------*/
1478 yynewstate:
1479 /* In all cases, when you get here, the value and location stacks
1480 have just been pushed. So pushing a state here evens the stacks. */
1481 yyssp++;
1482
1483
1484 /*--------------------------------------------------------------------.
1485 | yysetstate -- set current state (the top of the stack) to yystate. |
1486 `--------------------------------------------------------------------*/
1487 yysetstate:
1488 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1489 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1490 YY_IGNORE_USELESS_CAST_BEGIN
1491 *yyssp = YY_CAST (yy_state_t, yystate);
1492 YY_IGNORE_USELESS_CAST_END
1493 YY_STACK_PRINT (yyss, yyssp);
1494
1495 if (yyss + yystacksize - 1 <= yyssp)
1496 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1497 YYNOMEM;
1498 #else
1499 {
1500 /* Get the current used size of the three stacks, in elements. */
1501 YYPTRDIFF_T yysize = yyssp - yyss + 1;
1502
1503 # if defined yyoverflow
1504 {
1505 /* Give user a chance to reallocate the stack. Use copies of
1506 these so that the &'s don't force the real ones into
1507 memory. */
1508 yy_state_t *yyss1 = yyss;
1509 YYSTYPE *yyvs1 = yyvs;
1510 YYLTYPE *yyls1 = yyls;
1511
1512 /* Each stack pointer address is followed by the size of the
1513 data in use in that stack, in bytes. This used to be a
1514 conditional around just the two extra args, but that might
1515 be undefined if yyoverflow is a macro. */
1516 yyoverflow (YY_("memory exhausted"),
1517 &yyss1, yysize * YYSIZEOF (*yyssp),
1518 &yyvs1, yysize * YYSIZEOF (*yyvsp),
1519 &yyls1, yysize * YYSIZEOF (*yylsp),
1520 &yystacksize);
1521 yyss = yyss1;
1522 yyvs = yyvs1;
1523 yyls = yyls1;
1524 }
1525 # else /* defined YYSTACK_RELOCATE */
1526 /* Extend the stack our own way. */
1527 if (YYMAXDEPTH <= yystacksize)
1528 YYNOMEM;
1529 yystacksize *= 2;
1530 if (YYMAXDEPTH < yystacksize)
1531 yystacksize = YYMAXDEPTH;
1532
1533 {
1534 yy_state_t *yyss1 = yyss;
1535 union yyalloc *yyptr =
1536 YY_CAST (union yyalloc *,
1537 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1538 if (! yyptr)
1539 YYNOMEM;
1540 YYSTACK_RELOCATE (yyss_alloc, yyss);
1541 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1542 YYSTACK_RELOCATE (yyls_alloc, yyls);
1543 # undef YYSTACK_RELOCATE
1544 if (yyss1 != yyssa)
1545 YYSTACK_FREE (yyss1);
1546 }
1547 # endif
1548
1549 yyssp = yyss + yysize - 1;
1550 yyvsp = yyvs + yysize - 1;
1551 yylsp = yyls + yysize - 1;
1552
1553 YY_IGNORE_USELESS_CAST_BEGIN
1554 YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1555 YY_CAST (long, yystacksize)));
1556 YY_IGNORE_USELESS_CAST_END
1557
1558 if (yyss + yystacksize - 1 <= yyssp)
1559 YYABORT;
1560 }
1561 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1562
1563
1564 if (yystate == YYFINAL)
1565 YYACCEPT;
1566
1567 goto yybackup;
1568
1569
1570 /*-----------.
1571 | yybackup. |
1572 `-----------*/
1573 yybackup:
1574 /* Do appropriate processing given the current state. Read a
1575 lookahead token if we need one and don't already have one. */
1576
1577 /* First try to decide what to do without reference to lookahead token. */
1578 yyn = yypact[yystate];
1579 if (yypact_value_is_default (yyn))
1580 goto yydefault;
1581
1582 /* Not known => get a lookahead token if don't already have one. */
1583
1584 /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
1585 if (yychar == INTEL_EMPTY)
1586 {
1587 YYDPRINTF ((stderr, "Reading a token\n"));
1588 yychar = yylex (&yylval, &yylloc, yyscanner);
1589 }
1590
1591 if (yychar <= INTEL_EOF)
1592 {
1593 yychar = INTEL_EOF;
1594 yytoken = YYSYMBOL_YYEOF;
1595 YYDPRINTF ((stderr, "Now at end of input.\n"));
1596 }
1597 else if (yychar == INTEL_error)
1598 {
1599 /* The scanner already issued an error message, process directly
1600 to error recovery. But do not keep the error token as
1601 lookahead, it is too special and may lead us to an endless
1602 loop in error recovery. */
1603 yychar = INTEL_UNDEF;
1604 yytoken = YYSYMBOL_YYerror;
1605 yyerror_range[1] = yylloc;
1606 goto yyerrlab1;
1607 }
1608 else
1609 {
1610 yytoken = YYTRANSLATE (yychar);
1611 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1612 }
1613
1614 /* If the proper action on seeing token YYTOKEN is to reduce or to
1615 detect an error, take that action. */
1616 yyn += yytoken;
1617 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1618 goto yydefault;
1619 yyn = yytable[yyn];
1620 if (yyn <= 0)
1621 {
1622 if (yytable_value_is_error (yyn))
1623 goto yyerrlab;
1624 yyn = -yyn;
1625 goto yyreduce;
1626 }
1627
1628 /* Count tokens shifted since error; after three, turn off error
1629 status. */
1630 if (yyerrstatus)
1631 yyerrstatus--;
1632
1633 /* Shift the lookahead token. */
1634 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1635 yystate = yyn;
1636 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1637 *++yyvsp = yylval;
1638 YY_IGNORE_MAYBE_UNINITIALIZED_END
1639 *++yylsp = yylloc;
1640
1641 /* Discard the shifted token. */
1642 yychar = INTEL_EMPTY;
1643 goto yynewstate;
1644
1645
1646 /*-----------------------------------------------------------.
1647 | yydefault -- do the default action for the current state. |
1648 `-----------------------------------------------------------*/
1649 yydefault:
1650 yyn = yydefact[yystate];
1651 if (yyn == 0)
1652 goto yyerrlab;
1653 goto yyreduce;
1654
1655
1656 /*-----------------------------.
1657 | yyreduce -- do a reduction. |
1658 `-----------------------------*/
1659 yyreduce:
1660 /* yyn is the number of a rule to reduce with. */
1661 yylen = yyr2[yyn];
1662
1663 /* If YYLEN is nonzero, implement the default value of the action:
1664 '$$ = $1'.
1665
1666 Otherwise, the following line sets YYVAL to garbage.
1667 This behavior is undocumented and Bison
1668 users should not rely upon it. Assigning to YYVAL
1669 unconditionally makes the parser a bit smaller, and it avoids a
1670 GCC warning that YYVAL may be used uninitialized. */
1671 yyval = yyvsp[1-yylen];
1672
1673 /* Default location. */
1674 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1675 yyerror_range[1] = yyloc;
1676 YY_REDUCE_PRINT (yyn);
1677 switch (yyn)
1678 {
1679 case 3: /* start: instruction */
1680 #line 157 "fcml_intel_parser_def.y"
1681 { pd->tree = (yyvsp[0].ast); pd->symbol = NULL; }
1682 #line 1683 "fcml_intel_parser_def.c"
1683 break;
1684
1685 case 4: /* start: FCML_TK_SYMBOL ':' */
1686 #line 158 "fcml_intel_parser_def.y"
1687 { pd->tree = NULL; pd->symbol = fcml_fn_ast_alloc_node_define_symbol( pd->ip, (yyvsp[-1].symbol).text, (yyvsp[-1].symbol).length ); HANDLE_ERRORS( pd->symbol ); }
1688 #line 1689 "fcml_intel_parser_def.c"
1689 break;
1690
1691 case 5: /* start: FCML_TK_SYMBOL ':' instruction */
1692 #line 159 "fcml_intel_parser_def.y"
1693 { pd->tree = (yyvsp[0].ast); pd->symbol = fcml_fn_ast_alloc_node_define_symbol( pd->ip, (yyvsp[-2].symbol).text, (yyvsp[-2].symbol).length ); HANDLE_ERRORS( pd->symbol ); }
1694 #line 1695 "fcml_intel_parser_def.c"
1695 break;
1696
1697 case 6: /* instruction: mnemonic */
1698 #line 162 "fcml_intel_parser_def.y"
1699 { (yyval.ast) = fcml_fn_ast_alloc_node_instruction( 0, (yyvsp[0].symbol).text, (yyvsp[0].symbol).length, 0, NULL ); HANDLE_ERRORS((yyval.ast)); }
1700 #line 1701 "fcml_intel_parser_def.c"
1701 break;
1702
1703 case 7: /* instruction: mnemonic operand_list */
1704 #line 163 "fcml_intel_parser_def.y"
1705 { (yyval.ast) = fcml_fn_ast_alloc_node_instruction( 0, (yyvsp[-1].symbol).text, (yyvsp[-1].symbol).length, 0, (yyvsp[0].ast) ); HANDLE_ERRORS((yyval.ast)); }
1706 #line 1707 "fcml_intel_parser_def.c"
1707 break;
1708
1709 case 8: /* instruction: mnemonic hint_list operand_list */
1710 #line 164 "fcml_intel_parser_def.y"
1711 { (yyval.ast) = fcml_fn_ast_alloc_node_instruction( 0, (yyvsp[-2].symbol).text, (yyvsp[-2].symbol).length, (yyvsp[-1].hints), (yyvsp[0].ast) ); HANDLE_ERRORS((yyval.ast)); }
1712 #line 1713 "fcml_intel_parser_def.c"
1713 break;
1714
1715 case 9: /* instruction: inst_prefixes mnemonic */
1716 #line 165 "fcml_intel_parser_def.y"
1717 { (yyval.ast) = fcml_fn_ast_alloc_node_instruction( (yyvsp[-1].prefixes), (yyvsp[0].symbol).text, (yyvsp[0].symbol).length, 0, NULL ); HANDLE_ERRORS((yyval.ast)); }
1718 #line 1719 "fcml_intel_parser_def.c"
1719 break;
1720
1721 case 10: /* instruction: inst_prefixes mnemonic operand_list */
1722 #line 166 "fcml_intel_parser_def.y"
1723 { (yyval.ast) = fcml_fn_ast_alloc_node_instruction( (yyvsp[-2].prefixes), (yyvsp[-1].symbol).text, (yyvsp[-1].symbol).length, 0, (yyvsp[0].ast) ); HANDLE_ERRORS((yyval.ast)); }
1724 #line 1725 "fcml_intel_parser_def.c"
1725 break;
1726
1727 case 11: /* instruction: inst_prefixes mnemonic hint_list operand_list */
1728 #line 167 "fcml_intel_parser_def.y"
1729 { (yyval.ast) = fcml_fn_ast_alloc_node_instruction( (yyvsp[-3].prefixes), (yyvsp[-2].symbol).text, (yyvsp[-2].symbol).length, (yyvsp[-1].hints), (yyvsp[0].ast) ); HANDLE_ERRORS((yyval.ast)); }
1730 #line 1731 "fcml_intel_parser_def.c"
1731 break;
1732
1733 case 13: /* inst_prefixes: inst_prefixes FCML_TK_PREFIX */
1734 #line 171 "fcml_intel_parser_def.y"
1735 { if( (yyvsp[-1].prefixes) & (yyvsp[0].prefixes) ) { ADD_ERROR_MSG( "Doubled prefixes." ); YYERROR; } else { (yyval.prefixes) = (yyvsp[-1].prefixes) | (yyvsp[0].prefixes); } }
1736 #line 1737 "fcml_intel_parser_def.c"
1737 break;
1738
1739 case 16: /* hint_list: hint_list FCML_TK_HINTS */
1740 #line 178 "fcml_intel_parser_def.y"
1741 { (yyval.hints) = (yyvsp[-1].hints) | (yyvsp[0].hints); }
1742 #line 1743 "fcml_intel_parser_def.c"
1743 break;
1744
1745 case 17: /* operand_list: operand */
1746 #line 181 "fcml_intel_parser_def.y"
1747 { (yyval.ast) = fcml_fn_ast_alloc_node_operand_list( (yyvsp[0].ast), NULL ); HANDLE_ERRORS((yyval.ast)); }
1748 #line 1749 "fcml_intel_parser_def.c"
1749 break;
1750
1751 case 18: /* operand_list: operand_list ',' operand */
1752 #line 182 "fcml_intel_parser_def.y"
1753 { (yyval.ast) = fcml_fn_ast_alloc_node_operand_list( (yyvsp[-2].ast), (yyvsp[0].ast) ); HANDLE_ERRORS((yyval.ast)); }
1754 #line 1755 "fcml_intel_parser_def.c"
1755 break;
1756
1757 case 22: /* operand: effective_address FCML_TK_OPMASK_REG_DECORATOR */
1758 #line 193 "fcml_intel_parser_def.y"
1759 { (yyval.ast) = fcml_fn_ast_decorate_effective_address((yyvsp[-1].ast), &(yyvsp[0].reg_value), FCML_FALSE); }
1760 #line 1761 "fcml_intel_parser_def.c"
1761 break;
1762
1763 case 23: /* operand: effective_address FCML_TK_OPMASK_REG_DECORATOR FCML_TK_DECORATOR_Z */
1764 #line 194 "fcml_intel_parser_def.y"
1765 { (yyval.ast) = fcml_fn_ast_decorate_effective_address((yyvsp[-2].ast), &(yyvsp[-1].reg_value), FCML_TRUE); }
1766 #line 1767 "fcml_intel_parser_def.c"
1767 break;
1768
1769 case 24: /* operand: effective_address FCML_TK_DECORATOR_Z */
1770 #line 195 "fcml_intel_parser_def.y"
1771 { (yyval.ast) = fcml_fn_ast_decorate_effective_address((yyvsp[-1].ast), NULL, FCML_TRUE); }
1772 #line 1773 "fcml_intel_parser_def.c"
1773 break;
1774
1775 case 25: /* operand: reg */
1776 #line 196 "fcml_intel_parser_def.y"
1777 { (yyval.ast) = fcml_fn_ast_alloc_node_register( &(yyvsp[0].reg_value), NULL, FCML_FALSE ); HANDLE_ERRORS((yyval.ast)); }
1778 #line 1779 "fcml_intel_parser_def.c"
1779 break;
1780
1781 case 26: /* operand: reg FCML_TK_OPMASK_REG_DECORATOR */
1782 #line 197 "fcml_intel_parser_def.y"
1783 { (yyval.ast) = fcml_fn_ast_alloc_node_register( &(yyvsp[-1].reg_value), &(yyvsp[0].reg_value), FCML_FALSE ); HANDLE_ERRORS((yyval.ast)); }
1784 #line 1785 "fcml_intel_parser_def.c"
1785 break;
1786
1787 case 27: /* operand: reg FCML_TK_OPMASK_REG_DECORATOR FCML_TK_DECORATOR_Z */
1788 #line 198 "fcml_intel_parser_def.y"
1789 { (yyval.ast) = fcml_fn_ast_alloc_node_register( &(yyvsp[-2].reg_value), &(yyvsp[-1].reg_value), FCML_TRUE ); HANDLE_ERRORS((yyval.ast)); }
1790 #line 1791 "fcml_intel_parser_def.c"
1791 break;
1792
1793 case 28: /* operand: reg FCML_TK_DECORATOR_Z */
1794 #line 199 "fcml_intel_parser_def.y"
1795 { (yyval.ast) = fcml_fn_ast_alloc_node_register( &(yyvsp[-1].reg_value), NULL, FCML_TRUE ); HANDLE_ERRORS((yyval.ast)); }
1796 #line 1797 "fcml_intel_parser_def.c"
1797 break;
1798
1799 case 29: /* operand: FCML_TK_DECORATOR_SAE */
1800 #line 200 "fcml_intel_parser_def.y"
1801 { (yyval.ast) = fcml_fn_ast_alloc_node_virtual( FCML_TRUE, FCML_FALSE, 0 ); HANDLE_ERRORS((yyval.ast)); }
1802 #line 1803 "fcml_intel_parser_def.c"
1803 break;
1804
1805 case 30: /* operand: FCML_TK_DECORATOR_ER */
1806 #line 201 "fcml_intel_parser_def.y"
1807 { (yyval.ast) = fcml_fn_ast_alloc_node_virtual( FCML_FALSE, FCML_TRUE, (yyvsp[0].int_value) ); HANDLE_ERRORS((yyval.ast)); }
1808 #line 1809 "fcml_intel_parser_def.c"
1809 break;
1810
1811 case 31: /* effective_address: '[' effective_address_components ']' */
1812 #line 204 "fcml_intel_parser_def.y"
1813 { (yyval.ast) = (yyvsp[-1].ast); }
1814 #line 1815 "fcml_intel_parser_def.c"
1815 break;
1816
1817 case 32: /* effective_address: FCML_TK_SIZE_OPERATOR '[' effective_address_components ']' */
1818 #line 205 "fcml_intel_parser_def.y"
1819 { (yyval.ast) = fcml_fn_ast_set_effective_address_details( NULL, &(yyvsp[-3].size_operator), 0, (yyvsp[-1].ast) ); }
1820 #line 1821 "fcml_intel_parser_def.c"
1821 break;
1822
1823 case 33: /* effective_address: segment_selector '[' effective_address_components ']' */
1824 #line 206 "fcml_intel_parser_def.y"
1825 { (yyval.ast) = fcml_fn_ast_set_effective_address_details( &(yyvsp[-3].reg_value), FCML_OS_UNDEFINED, 0, (yyvsp[-1].ast) ); }
1826 #line 1827 "fcml_intel_parser_def.c"
1827 break;
1828
1829 case 34: /* effective_address: FCML_TK_SIZE_OPERATOR segment_selector '[' effective_address_components ']' */
1830 #line 207 "fcml_intel_parser_def.y"
1831 { (yyval.ast) = fcml_fn_ast_set_effective_address_details( &(yyvsp[-3].reg_value), &(yyvsp[-4].size_operator), 0, (yyvsp[-1].ast) ); }
1832 #line 1833 "fcml_intel_parser_def.c"
1833 break;
1834
1835 case 35: /* effective_address: effective_address FCML_TK_DECORATOR_BCAST */
1836 #line 208 "fcml_intel_parser_def.y"
1837 { (yyval.ast) = fcml_fn_ast_set_effective_address_details( NULL, FCML_OS_UNDEFINED, (yyvsp[0].int_value), (yyvsp[-1].ast) ); }
1838 #line 1839 "fcml_intel_parser_def.c"
1839 break;
1840
1841 case 36: /* effective_address_components: reg */
1842 #line 211 "fcml_intel_parser_def.y"
1843 { (yyval.ast) = fcml_fn_ast_alloc_node_effective_address( &(yyvsp[0].reg_value), NULL, NULL, NULL, FCML_FALSE, 0 ); }
1844 #line 1845 "fcml_intel_parser_def.c"
1845 break;
1846
1847 case 37: /* effective_address_components: FCML_TK_SIB_HINT reg */
1848 #line 212 "fcml_intel_parser_def.y"
1849 { (yyval.ast) = fcml_fn_ast_alloc_node_effective_address( &(yyvsp[0].reg_value), NULL, NULL, NULL, FCML_FALSE, (yyvsp[-1].hints) ); }
1850 #line 1851 "fcml_intel_parser_def.c"
1851 break;
1852
1853 case 38: /* effective_address_components: FCML_TK_REG_RIP */
1854 #line 213 "fcml_intel_parser_def.y"
1855 { (yyval.ast) = fcml_fn_ast_alloc_node_effective_address( &(yyvsp[0].reg_value), NULL, NULL, NULL, FCML_FALSE, 0 ); }
1856 #line 1857 "fcml_intel_parser_def.c"
1857 break;
1858
1859 case 39: /* effective_address_components: reg '+' reg */
1860 #line 214 "fcml_intel_parser_def.y"
1861 { (yyval.ast) = fcml_fn_ast_alloc_node_effective_address( &(yyvsp[-2].reg_value), &(yyvsp[0].reg_value), NULL, NULL, FCML_FALSE, 0 ); }
1862 #line 1863 "fcml_intel_parser_def.c"
1863 break;
1864
1865 case 40: /* effective_address_components: reg '+' reg '*' FCML_TK_INTEGER */
1866 #line 215 "fcml_intel_parser_def.y"
1867 { (yyval.ast) = fcml_fn_ast_alloc_node_effective_address( &(yyvsp[-4].reg_value), &(yyvsp[-2].reg_value), &(yyvsp[0].integer_value), NULL, FCML_FALSE, 0 ); }
1868 #line 1869 "fcml_intel_parser_def.c"
1869 break;
1870
1871 case 41: /* effective_address_components: reg '+' reg '*' FCML_TK_INTEGER '+' exp */
1872 #line 216 "fcml_intel_parser_def.y"
1873 { (yyval.ast) = fcml_fn_ast_alloc_node_effective_address( &(yyvsp[-6].reg_value), &(yyvsp[-4].reg_value), &(yyvsp[-2].integer_value), (yyvsp[0].ast), FCML_FALSE, 0 ); }
1874 #line 1875 "fcml_intel_parser_def.c"
1875 break;
1876
1877 case 42: /* effective_address_components: reg '+' reg '*' FCML_TK_INTEGER '-' exp */
1878 #line 217 "fcml_intel_parser_def.y"
1879 { (yyval.ast) = fcml_fn_ast_alloc_node_effective_address( &(yyvsp[-6].reg_value), &(yyvsp[-4].reg_value), &(yyvsp[-2].integer_value), (yyvsp[0].ast), FCML_TRUE, 0 ); }
1880 #line 1881 "fcml_intel_parser_def.c"
1881 break;
1882
1883 case 43: /* effective_address_components: reg '*' FCML_TK_INTEGER '+' exp */
1884 #line 218 "fcml_intel_parser_def.y"
1885 { (yyval.ast) = fcml_fn_ast_alloc_node_effective_address( NULL, &(yyvsp[-4].reg_value), &(yyvsp[-2].integer_value), (yyvsp[0].ast), FCML_FALSE, 0 ); }
1886 #line 1887 "fcml_intel_parser_def.c"
1887 break;
1888
1889 case 44: /* effective_address_components: reg '*' FCML_TK_INTEGER '-' exp */
1890 #line 219 "fcml_intel_parser_def.y"
1891 { (yyval.ast) = fcml_fn_ast_alloc_node_effective_address( NULL, &(yyvsp[-4].reg_value), &(yyvsp[-2].integer_value), (yyvsp[0].ast), FCML_TRUE, 0 ); }
1892 #line 1893 "fcml_intel_parser_def.c"
1893 break;
1894
1895 case 45: /* effective_address_components: reg '+' reg '+' exp */
1896 #line 220 "fcml_intel_parser_def.y"
1897 { (yyval.ast) = fcml_fn_ast_alloc_node_effective_address( &(yyvsp[-4].reg_value), &(yyvsp[-2].reg_value), NULL, (yyvsp[0].ast), FCML_FALSE, 0 ); }
1898 #line 1899 "fcml_intel_parser_def.c"
1899 break;
1900
1901 case 46: /* effective_address_components: reg '+' reg '-' exp */
1902 #line 221 "fcml_intel_parser_def.y"
1903 { (yyval.ast) = fcml_fn_ast_alloc_node_effective_address( &(yyvsp[-4].reg_value), &(yyvsp[-2].reg_value), NULL, (yyvsp[0].ast), FCML_TRUE, 0 ); }
1904 #line 1905 "fcml_intel_parser_def.c"
1905 break;
1906
1907 case 47: /* effective_address_components: reg '+' exp */
1908 #line 222 "fcml_intel_parser_def.y"
1909 { (yyval.ast) = fcml_fn_ast_alloc_node_effective_address( &(yyvsp[-2].reg_value), NULL, NULL, (yyvsp[0].ast), FCML_FALSE, 0 ); }
1910 #line 1911 "fcml_intel_parser_def.c"
1911 break;
1912
1913 case 48: /* effective_address_components: FCML_TK_REG_RIP '+' exp */
1914 #line 223 "fcml_intel_parser_def.y"
1915 { (yyval.ast) = fcml_fn_ast_alloc_node_effective_address( &(yyvsp[-2].reg_value), NULL, NULL, (yyvsp[0].ast), FCML_FALSE, 0 ); }
1916 #line 1917 "fcml_intel_parser_def.c"
1917 break;
1918
1919 case 49: /* effective_address_components: FCML_TK_SIB_HINT reg '+' exp */
1920 #line 224 "fcml_intel_parser_def.y"
1921 { (yyval.ast) = fcml_fn_ast_alloc_node_effective_address( &(yyvsp[-2].reg_value), NULL, NULL, (yyvsp[0].ast), FCML_FALSE, (yyvsp[-3].hints) ); }
1922 #line 1923 "fcml_intel_parser_def.c"
1923 break;
1924
1925 case 50: /* effective_address_components: reg '-' exp */
1926 #line 225 "fcml_intel_parser_def.y"
1927 { (yyval.ast) = fcml_fn_ast_alloc_node_effective_address( &(yyvsp[-2].reg_value), NULL, NULL, (yyvsp[0].ast), FCML_TRUE, 0 ); }
1928 #line 1929 "fcml_intel_parser_def.c"
1929 break;
1930
1931 case 51: /* effective_address_components: FCML_TK_SIB_HINT reg '-' exp */
1932 #line 226 "fcml_intel_parser_def.y"
1933 { (yyval.ast) = fcml_fn_ast_alloc_node_effective_address( &(yyvsp[-2].reg_value), NULL, NULL, (yyvsp[0].ast), FCML_TRUE, (yyvsp[-3].hints) ); }
1934 #line 1935 "fcml_intel_parser_def.c"
1935 break;
1936
1937 case 52: /* effective_address_components: exp */
1938 #line 227 "fcml_intel_parser_def.y"
1939 { (yyval.ast) = fcml_fn_ast_alloc_node_effective_address( NULL, NULL, NULL, (yyvsp[0].ast), FCML_FALSE, 0); }
1940 #line 1941 "fcml_intel_parser_def.c"
1941 break;
1942
1943 case 53: /* effective_address_components: FCML_TK_EAO_HINTS exp */
1944 #line 228 "fcml_intel_parser_def.y"
1945 { (yyval.ast) = fcml_fn_ast_alloc_node_effective_address( NULL, NULL, NULL, (yyvsp[0].ast), FCML_FALSE, (yyvsp[-1].hints)); }
1946 #line 1947 "fcml_intel_parser_def.c"
1947 break;
1948
1949 case 54: /* effective_address_components: FCML_TK_SIB_HINT exp */
1950 #line 229 "fcml_intel_parser_def.y"
1951 { (yyval.ast) = fcml_fn_ast_alloc_node_effective_address( NULL, NULL, NULL, (yyvsp[0].ast), FCML_FALSE, (yyvsp[-1].hints)); }
1952 #line 1953 "fcml_intel_parser_def.c"
1953 break;
1954
1955 case 55: /* segment_selector: FCML_TK_REG_SEG ':' */
1956 #line 232 "fcml_intel_parser_def.y"
1957 { (yyval.reg_value) = (yyvsp[-1].reg_value); }
1958 #line 1959 "fcml_intel_parser_def.c"
1959 break;
1960
1961 case 56: /* far_pointer: exp ':' exp */
1962 #line 235 "fcml_intel_parser_def.y"
1963 { (yyval.ast) = fcml_fn_ast_alloc_node_far_pointer( (yyvsp[-2].ast), (yyvsp[0].ast) ); HANDLE_ERRORS((yyval.ast)); }
1964 #line 1965 "fcml_intel_parser_def.c"
1965 break;
1966
1967 case 57: /* exp: FCML_TK_INTEGER */
1968 #line 238 "fcml_intel_parser_def.y"
1969 { (yyval.ast) = fcml_fn_ast_alloc_node_integer( &(yyvsp[0].integer_value) ); HANDLE_ERRORS((yyval.ast)); }
1970 #line 1971 "fcml_intel_parser_def.c"
1971 break;
1972
1973 case 58: /* exp: FCML_TK_FLOAT */
1974 #line 239 "fcml_intel_parser_def.y"
1975 { (yyval.ast) = fcml_fn_ast_alloc_node_float( &(yyvsp[0].float_value) ); HANDLE_ERRORS((yyval.ast)); }
1976 #line 1977 "fcml_intel_parser_def.c"
1977 break;
1978
1979 case 59: /* exp: exp '-' exp */
1980 #line 240 "fcml_intel_parser_def.y"
1981 { (yyval.ast) = fcml_fn_ast_alloc_node_exp( FCML_EN_EXN_SUB, (yyvsp[-2].ast), (yyvsp[0].ast) ); HANDLE_ERRORS((yyval.ast)); }
1982 #line 1983 "fcml_intel_parser_def.c"
1983 break;
1984
1985 case 60: /* exp: exp '+' exp */
1986 #line 241 "fcml_intel_parser_def.y"
1987 { (yyval.ast) = fcml_fn_ast_alloc_node_exp( FCML_EN_EXN_ADD, (yyvsp[-2].ast), (yyvsp[0].ast) ); HANDLE_ERRORS((yyval.ast)); }
1988 #line 1989 "fcml_intel_parser_def.c"
1989 break;
1990
1991 case 61: /* exp: exp '/' exp */
1992 #line 242 "fcml_intel_parser_def.y"
1993 { (yyval.ast) = fcml_fn_ast_alloc_node_exp( FCML_EN_EXN_DIV, (yyvsp[-2].ast), (yyvsp[0].ast) ); HANDLE_ERRORS((yyval.ast)); }
1994 #line 1995 "fcml_intel_parser_def.c"
1995 break;
1996
1997 case 62: /* exp: exp '*' exp */
1998 #line 243 "fcml_intel_parser_def.y"
1999 { (yyval.ast) = fcml_fn_ast_alloc_node_exp( FCML_EN_EXN_MUL, (yyvsp[-2].ast), (yyvsp[0].ast) ); HANDLE_ERRORS((yyval.ast)); }
2000 #line 2001 "fcml_intel_parser_def.c"
2001 break;
2002
2003 case 63: /* exp: FCML_TK_SYMBOL */
2004 #line 244 "fcml_intel_parser_def.y"
2005 { (yyval.ast) = fcml_fn_ast_alloc_node_use_symbol( (yyvsp[0].symbol).text, (yyvsp[0].symbol).length ); HANDLE_ERRORS((yyval.ast)); }
2006 #line 2007 "fcml_intel_parser_def.c"
2007 break;
2008
2009 case 64: /* exp: '-' exp */
2010 #line 245 "fcml_intel_parser_def.y"
2011 { (yyval.ast) = fcml_fn_ast_alloc_node_uminus( (yyvsp[0].ast) ); HANDLE_ERRORS((yyval.ast)); }
2012 #line 2013 "fcml_intel_parser_def.c"
2013 break;
2014
2015 case 65: /* exp: '(' exp ')' */
2016 #line 246 "fcml_intel_parser_def.y"
2017 { (yyval.ast) = (yyvsp[-1].ast); }
2018 #line 2019 "fcml_intel_parser_def.c"
2019 break;
2020
2021
2022 #line 2023 "fcml_intel_parser_def.c"
2023
2024 default: break;
2025 }
2026 /* User semantic actions sometimes alter yychar, and that requires
2027 that yytoken be updated with the new translation. We take the
2028 approach of translating immediately before every use of yytoken.
2029 One alternative is translating here after every semantic action,
2030 but that translation would be missed if the semantic action invokes
2031 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2032 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2033 incorrect destructor might then be invoked immediately. In the
2034 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2035 to an incorrect destructor call or verbose syntax error message
2036 before the lookahead is translated. */
2037 YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
2038
2039 YYPOPSTACK (yylen);
2040 yylen = 0;
2041
2042 *++yyvsp = yyval;
2043 *++yylsp = yyloc;
2044
2045 /* Now 'shift' the result of the reduction. Determine what state
2046 that goes to, based on the state we popped back to and the rule
2047 number reduced by. */
2048 {
2049 const int yylhs = yyr1[yyn] - YYNTOKENS;
2050 const int yyi = yypgoto[yylhs] + *yyssp;
2051 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
2052 ? yytable[yyi]
2053 : yydefgoto[yylhs]);
2054 }
2055
2056 goto yynewstate;
2057
2058
2059 /*--------------------------------------.
2060 | yyerrlab -- here on detecting error. |
2061 `--------------------------------------*/
2062 yyerrlab:
2063 /* Make sure we have latest lookahead translation. See comments at
2064 user semantic actions for why this is necessary. */
2065 yytoken = yychar == INTEL_EMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
2066 /* If not already recovering from an error, report this error. */
2067 if (!yyerrstatus)
2068 {
2069 ++yynerrs;
2070 yyerror (&yylloc, pd, YY_("syntax error"));
2071 }
2072
2073 yyerror_range[1] = yylloc;
2074 if (yyerrstatus == 3)
2075 {
2076 /* If just tried and failed to reuse lookahead token after an
2077 error, discard it. */
2078
2079 if (yychar <= INTEL_EOF)
2080 {
2081 /* Return failure if at end of input. */
2082 if (yychar == INTEL_EOF)
2083 YYABORT;
2084 }
2085 else
2086 {
2087 yydestruct ("Error: discarding",
2088 yytoken, &yylval, &yylloc, pd);
2089 yychar = INTEL_EMPTY;
2090 }
2091 }
2092
2093 /* Else will try to reuse lookahead token after shifting the error
2094 token. */
2095 goto yyerrlab1;
2096
2097
2098 /*---------------------------------------------------.
2099 | yyerrorlab -- error raised explicitly by YYERROR. |
2100 `---------------------------------------------------*/
2101 yyerrorlab:
2102 /* Pacify compilers when the user code never invokes YYERROR and the
2103 label yyerrorlab therefore never appears in user code. */
2104 if (0)
2105 YYERROR;
2106 ++yynerrs;
2107
2108 /* Do not reclaim the symbols of the rule whose action triggered
2109 this YYERROR. */
2110 YYPOPSTACK (yylen);
2111 yylen = 0;
2112 YY_STACK_PRINT (yyss, yyssp);
2113 yystate = *yyssp;
2114 goto yyerrlab1;
2115
2116
2117 /*-------------------------------------------------------------.
2118 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2119 `-------------------------------------------------------------*/
2120 yyerrlab1:
2121 yyerrstatus = 3; /* Each real token shifted decrements this. */
2122
2123 /* Pop stack until we find a state that shifts the error token. */
2124 for (;;)
2125 {
2126 yyn = yypact[yystate];
2127 if (!yypact_value_is_default (yyn))
2128 {
2129 yyn += YYSYMBOL_YYerror;
2130 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
2131 {
2132 yyn = yytable[yyn];
2133 if (0 < yyn)
2134 break;
2135 }
2136 }
2137
2138 /* Pop the current state because it cannot handle the error token. */
2139 if (yyssp == yyss)
2140 YYABORT;
2141
2142 yyerror_range[1] = *yylsp;
2143 yydestruct ("Error: popping",
2144 YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp, pd);
2145 YYPOPSTACK (1);
2146 yystate = *yyssp;
2147 YY_STACK_PRINT (yyss, yyssp);
2148 }
2149
2150 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2151 *++yyvsp = yylval;
2152 YY_IGNORE_MAYBE_UNINITIALIZED_END
2153
2154 yyerror_range[2] = yylloc;
2155 ++yylsp;
2156 YYLLOC_DEFAULT (*yylsp, yyerror_range, 2);
2157
2158 /* Shift the error token. */
2159 YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
2160
2161 yystate = yyn;
2162 goto yynewstate;
2163
2164
2165 /*-------------------------------------.
2166 | yyacceptlab -- YYACCEPT comes here. |
2167 `-------------------------------------*/
2168 yyacceptlab:
2169 yyresult = 0;
2170 goto yyreturnlab;
2171
2172
2173 /*-----------------------------------.
2174 | yyabortlab -- YYABORT comes here. |
2175 `-----------------------------------*/
2176 yyabortlab:
2177 yyresult = 1;
2178 goto yyreturnlab;
2179
2180
2181 /*-----------------------------------------------------------.
2182 | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
2183 `-----------------------------------------------------------*/
2184 yyexhaustedlab:
2185 yyerror (&yylloc, pd, YY_("memory exhausted"));
2186 yyresult = 2;
2187 goto yyreturnlab;
2188
2189
2190 /*----------------------------------------------------------.
2191 | yyreturnlab -- parsing is finished, clean up and return. |
2192 `----------------------------------------------------------*/
2193 yyreturnlab:
2194 if (yychar != INTEL_EMPTY)
2195 {
2196 /* Make sure we have latest lookahead translation. See comments at
2197 user semantic actions for why this is necessary. */
2198 yytoken = YYTRANSLATE (yychar);
2199 yydestruct ("Cleanup: discarding lookahead",
2200 yytoken, &yylval, &yylloc, pd);
2201 }
2202 /* Do not reclaim the symbols of the rule whose action triggered
2203 this YYABORT or YYACCEPT. */
2204 YYPOPSTACK (yylen);
2205 YY_STACK_PRINT (yyss, yyssp);
2206 while (yyssp != yyss)
2207 {
2208 yydestruct ("Cleanup: popping",
2209 YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp, pd);
2210 YYPOPSTACK (1);
2211 }
2212 #ifndef yyoverflow
2213 if (yyss != yyssa)
2214 YYSTACK_FREE (yyss);
2215 #endif
2216
2217 return yyresult;
2218 }
2219
2220 #line 259 "fcml_intel_parser_def.y"
2221