ugBASIC 1.18
An isomorphic BASIC language compiler for retrocomputers
Loading...
Searching...
No Matches
ugbc.embed.tab.c
Go to the documentation of this file.
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/* Substitute the variable and function names. */
68#define yyparse embedparse
69#define yylex embedlex
70#define yyerror embederror
71#define yydebug embeddebug
72#define yynerrs embednerrs
73#define yylval embedlval
74#define yychar embedchar
75#define yylloc embedlloc
76
77/* First part of user prologue. */
78#line 1 "src/ugbc.embed.y"
79
80
81#include "../src/ugbc.h"
82
84int embederror(Environment *, const char *);
87
90
91int embedwrap() { return 1; }
92
93#include <math.h>
94
95char *str_replace( char *orig, char *rep, char *with ) {
96 char *result; // the return string
97 char *ins; // the next insert point
98 char *tmp; // varies
99 int len_rep; // length of rep (the string to remove)
100 int len_with; // length of with (the string to replace rep with)
101 int len_front; // distance between rep and end of last rep
102 int count; // number of replacements
103
104 // sanity checks and initialization
105 if (!orig || !rep)
106 return NULL;
107 len_rep = strlen(rep);
108 if (len_rep == 0)
109 return NULL; // empty rep causes infinite loop during count
110 if (!with)
111 with = "";
112 len_with = strlen(with);
113
114 // count the number of replacements needed
115 ins = orig;
116 for (count = 0; tmp = strstr(ins, rep); ++count) {
117 ins = tmp + len_rep;
118 }
119
120 tmp = result = malloc(strlen(orig) + (len_with - len_rep) * count + 1);
121
122 if (!result)
123 return NULL;
124
125 // first time through the loop, all the variable are set correctly
126 // from here on,
127 // tmp points to the end of the result string
128 // ins points to the next occurrence of rep in orig
129 // orig points to the remainder of orig after "end of rep"
130 while (count--) {
131 ins = strstr(orig, rep);
132 len_front = ins - orig;
133 tmp = strncpy(tmp, orig, len_front) + len_front;
134 tmp = strcopy(tmp, with) + len_with;
135 orig += len_front + len_rep; // move to next "end of rep"
136 }
137 strcopy(tmp, orig);
138 return result;
139}
140
141#define configure_get_value_single( hardware, parameter, name, field ) \
142 if ( !valued && strcmp( p1, #hardware ) == 0 && strcmp( p3, #parameter ) == 0 && strcmp( p5, #name ) == 0 ) { \
143 value = ((struct _Environment *)_environment)->configureParameters.hardware.parameter.field; \
144 valued = 1; \
145 }
146
147#define configure_get_value( hardware, parameter ) \
148 configure_get_value_single( hardware, parameter, value, value ) \
149 configure_get_value_single( hardware, parameter, static, statically ) \
150 configure_get_value_single( hardware, parameter, dynamic, dynamically )
151
152
153#line 154 "src-generated/ugbc.embed.tab.c"
154
155# ifndef YY_CAST
156# ifdef __cplusplus
157# define YY_CAST(Type, Val) static_cast<Type> (Val)
158# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
159# else
160# define YY_CAST(Type, Val) ((Type) (Val))
161# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
162# endif
163# endif
164# ifndef YY_NULLPTR
165# if defined __cplusplus
166# if 201103L <= __cplusplus
167# define YY_NULLPTR nullptr
168# else
169# define YY_NULLPTR 0
170# endif
171# else
172# define YY_NULLPTR ((void*)0)
173# endif
174# endif
175
176#include "ugbc.embed.tab.h"
177/* Symbol kind. */
179{
181 YYSYMBOL_YYEOF = 0, /* "end of file" */
182 YYSYMBOL_YYerror = 1, /* error */
183 YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
184 YYSYMBOL_OP = 3, /* OP */
185 YYSYMBOL_CP = 4, /* CP */
186 YYSYMBOL_OP_AT = 5, /* OP_AT */
187 YYSYMBOL_OP_EQUAL = 6, /* OP_EQUAL */
188 YYSYMBOL_OP_DISEQUAL = 7, /* OP_DISEQUAL */
189 YYSYMBOL_OP_AND = 8, /* OP_AND */
190 YYSYMBOL_OP_OR = 9, /* OP_OR */
191 YYSYMBOL_OP_NOT = 10, /* OP_NOT */
192 YYSYMBOL_OP_POINT = 11, /* OP_POINT */
193 YYSYMBOL_OP_LT = 12, /* OP_LT */
194 YYSYMBOL_OP_LTE = 13, /* OP_LTE */
195 YYSYMBOL_OP_GT = 14, /* OP_GT */
196 YYSYMBOL_OP_GTE = 15, /* OP_GTE */
197 YYSYMBOL_OP_COMMA = 16, /* OP_COMMA */
198 YYSYMBOL_OP_TAB = 17, /* OP_TAB */
199 YYSYMBOL_OP_PIPE = 18, /* OP_PIPE */
200 YYSYMBOL_IF = 19, /* IF */
201 YYSYMBOL_ELSE = 20, /* ELSE */
202 YYSYMBOL_ELSEIF = 21, /* ELSEIF */
203 YYSYMBOL_ENDIF = 22, /* ENDIF */
204 YYSYMBOL_EMIT = 23, /* EMIT */
205 YYSYMBOL_AS = 24, /* AS */
206 YYSYMBOL_NewLine = 25, /* NewLine */
207 YYSYMBOL_ATARI = 26, /* ATARI */
208 YYSYMBOL_ATARIXL = 27, /* ATARIXL */
209 YYSYMBOL_C128 = 28, /* C128 */
210 YYSYMBOL_C128Z = 29, /* C128Z */
211 YYSYMBOL_C64 = 30, /* C64 */
212 YYSYMBOL_C64REU = 31, /* C64REU */
213 YYSYMBOL_GB = 32, /* GB */
214 YYSYMBOL_VIC20 = 33, /* VIC20 */
215 YYSYMBOL_ZX = 34, /* ZX */
216 YYSYMBOL_COLECO = 35, /* COLECO */
217 YYSYMBOL_SC3000 = 36, /* SC3000 */
218 YYSYMBOL_SG1000 = 37, /* SG1000 */
219 YYSYMBOL_MSX = 38, /* MSX */
220 YYSYMBOL_MSX1 = 39, /* MSX1 */
221 YYSYMBOL_DRAGON = 40, /* DRAGON */
222 YYSYMBOL_DRAGON32 = 41, /* DRAGON32 */
223 YYSYMBOL_DRAGON64 = 42, /* DRAGON64 */
224 YYSYMBOL_PC1403 = 43, /* PC1403 */
225 YYSYMBOL_PC128OP = 44, /* PC128OP */
226 YYSYMBOL_MO5 = 45, /* MO5 */
227 YYSYMBOL_CPC = 46, /* CPC */
228 YYSYMBOL_COCO = 47, /* COCO */
229 YYSYMBOL_VZ200 = 48, /* VZ200 */
230 YYSYMBOL_COCO1 = 49, /* COCO1 */
231 YYSYMBOL_COCO2 = 50, /* COCO2 */
232 YYSYMBOL_COCO3 = 51, /* COCO3 */
233 YYSYMBOL_MACRO = 52, /* MACRO */
234 YYSYMBOL_ENDMACRO = 53, /* ENDMACRO */
235 YYSYMBOL_INLINE = 54, /* INLINE */
236 YYSYMBOL_BIN = 55, /* BIN */
237 YYSYMBOL_PRG = 56, /* PRG */
238 YYSYMBOL_XEX = 57, /* XEX */
239 YYSYMBOL_K7O = 58, /* K7O */
240 YYSYMBOL_K7N = 59, /* K7N */
241 YYSYMBOL_K7 = 60, /* K7 */
242 YYSYMBOL_TAP = 61, /* TAP */
243 YYSYMBOL_ROM = 62, /* ROM */
244 YYSYMBOL_D64 = 63, /* D64 */
245 YYSYMBOL_DSK = 64, /* DSK */
246 YYSYMBOL_ATR = 65, /* ATR */
247 YYSYMBOL_REU = 66, /* REU */
248 YYSYMBOL_TO8 = 67, /* TO8 */
249 YYSYMBOL_PCCGA = 68, /* PCCGA */
250 YYSYMBOL_SDDRIVE = 69, /* SDDRIVE */
251 YYSYMBOL_Identifier = 70, /* Identifier */
252 YYSYMBOL_Content = 71, /* Content */
253 YYSYMBOL_Value = 72, /* Value */
254 YYSYMBOL_Integer = 73, /* Integer */
255 YYSYMBOL_String = 74, /* String */
256 YYSYMBOL_YYACCEPT = 75, /* $accept */
257 YYSYMBOL_output = 76, /* output */
258 YYSYMBOL_target = 77, /* target */
259 YYSYMBOL_const_expr = 78, /* const_expr */
260 YYSYMBOL_const_factor = 79, /* const_factor */
261 YYSYMBOL_macro_parameter = 80, /* macro_parameter */
262 YYSYMBOL_macro_parameters = 81, /* macro_parameters */
263 YYSYMBOL_macro_value = 82, /* macro_value */
264 YYSYMBOL_macro_values = 83, /* macro_values */
265 YYSYMBOL_embed2 = 84, /* embed2 */
266 YYSYMBOL_85_1 = 85, /* $@1 */
267 YYSYMBOL_86_2 = 86, /* $@2 */
268 YYSYMBOL_embed = 87 /* embed */
269};
271
272
273
274
275#ifdef short
276# undef short
277#endif
278
279/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
280 <limits.h> and (if available) <stdint.h> are included
281 so that the code can choose integer types of a good width. */
282
283#ifndef __PTRDIFF_MAX__
284# include <limits.h> /* INFRINGES ON USER NAME SPACE */
285# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
286# include <stdint.h> /* INFRINGES ON USER NAME SPACE */
287# define YY_STDINT_H
288# endif
289#endif
290
291/* Narrow types that promote to a signed type and that can represent a
292 signed or unsigned integer of at least N bits. In tables they can
293 save space and decrease cache pressure. Promoting to a signed type
294 helps avoid bugs in integer arithmetic. */
295
296#ifdef __INT_LEAST8_MAX__
297typedef __INT_LEAST8_TYPE__ yytype_int8;
298#elif defined YY_STDINT_H
299typedef int_least8_t yytype_int8;
300#else
301typedef signed char yytype_int8;
302#endif
303
304#ifdef __INT_LEAST16_MAX__
305typedef __INT_LEAST16_TYPE__ yytype_int16;
306#elif defined YY_STDINT_H
307typedef int_least16_t yytype_int16;
308#else
309typedef short yytype_int16;
310#endif
311
312/* Work around bug in HP-UX 11.23, which defines these macros
313 incorrectly for preprocessor constants. This workaround can likely
314 be removed in 2023, as HPE has promised support for HP-UX 11.23
315 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
316 <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
317#ifdef __hpux
318# undef UINT_LEAST8_MAX
319# undef UINT_LEAST16_MAX
320# define UINT_LEAST8_MAX 255
321# define UINT_LEAST16_MAX 65535
322#endif
323
324#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
325typedef __UINT_LEAST8_TYPE__ yytype_uint8;
326#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
327 && UINT_LEAST8_MAX <= INT_MAX)
328typedef uint_least8_t yytype_uint8;
329#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
330typedef unsigned char yytype_uint8;
331#else
332typedef short yytype_uint8;
333#endif
334
335#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
336typedef __UINT_LEAST16_TYPE__ yytype_uint16;
337#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
338 && UINT_LEAST16_MAX <= INT_MAX)
339typedef uint_least16_t yytype_uint16;
340#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
341typedef unsigned short yytype_uint16;
342#else
343typedef int yytype_uint16;
344#endif
345
346#ifndef YYPTRDIFF_T
347# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
348# define YYPTRDIFF_T __PTRDIFF_TYPE__
349# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
350# elif defined PTRDIFF_MAX
351# ifndef ptrdiff_t
352# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
353# endif
354# define YYPTRDIFF_T ptrdiff_t
355# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
356# else
357# define YYPTRDIFF_T long
358# define YYPTRDIFF_MAXIMUM LONG_MAX
359# endif
360#endif
361
362#ifndef YYSIZE_T
363# ifdef __SIZE_TYPE__
364# define YYSIZE_T __SIZE_TYPE__
365# elif defined size_t
366# define YYSIZE_T size_t
367# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
368# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
369# define YYSIZE_T size_t
370# else
371# define YYSIZE_T unsigned
372# endif
373#endif
374
375#define YYSIZE_MAXIMUM \
376 YY_CAST (YYPTRDIFF_T, \
377 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
378 ? YYPTRDIFF_MAXIMUM \
379 : YY_CAST (YYSIZE_T, -1)))
380
381#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
382
383
384/* Stored state numbers (used for stacks). */
386
387/* State numbers in computations. */
388typedef int yy_state_fast_t;
389
390#ifndef YY_
391# if defined YYENABLE_NLS && YYENABLE_NLS
392# if ENABLE_NLS
393# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
394# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
395# endif
396# endif
397# ifndef YY_
398# define YY_(Msgid) Msgid
399# endif
400#endif
401
402
403#ifndef YY_ATTRIBUTE_PURE
404# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
405# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
406# else
407# define YY_ATTRIBUTE_PURE
408# endif
409#endif
410
411#ifndef YY_ATTRIBUTE_UNUSED
412# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
413# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
414# else
415# define YY_ATTRIBUTE_UNUSED
416# endif
417#endif
418
419/* Suppress unused-variable warnings by "using" E. */
420#if ! defined lint || defined __GNUC__
421# define YY_USE(E) ((void) (E))
422#else
423# define YY_USE(E) /* empty */
424#endif
425
426/* Suppress an incorrect diagnostic about yylval being uninitialized. */
427#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
428# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
429# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
430 _Pragma ("GCC diagnostic push") \
431 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
432# else
433# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
434 _Pragma ("GCC diagnostic push") \
435 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
436 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
437# endif
438# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
439 _Pragma ("GCC diagnostic pop")
440#else
441# define YY_INITIAL_VALUE(Value) Value
442#endif
443#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
444# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
445# define YY_IGNORE_MAYBE_UNINITIALIZED_END
446#endif
447#ifndef YY_INITIAL_VALUE
448# define YY_INITIAL_VALUE(Value) /* Nothing. */
449#endif
450
451#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
452# define YY_IGNORE_USELESS_CAST_BEGIN \
453 _Pragma ("GCC diagnostic push") \
454 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
455# define YY_IGNORE_USELESS_CAST_END \
456 _Pragma ("GCC diagnostic pop")
457#endif
458#ifndef YY_IGNORE_USELESS_CAST_BEGIN
459# define YY_IGNORE_USELESS_CAST_BEGIN
460# define YY_IGNORE_USELESS_CAST_END
461#endif
462
463
464#define YY_ASSERT(E) ((void) (0 && (E)))
465
466#if 1
467
468/* The parser invokes alloca or malloc; define the necessary symbols. */
469
470# ifdef YYSTACK_USE_ALLOCA
471# if YYSTACK_USE_ALLOCA
472# ifdef __GNUC__
473# define YYSTACK_ALLOC __builtin_alloca
474# elif defined __BUILTIN_VA_ARG_INCR
475# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
476# elif defined _AIX
477# define YYSTACK_ALLOC __alloca
478# elif defined _MSC_VER
479# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
480# define alloca _alloca
481# else
482# define YYSTACK_ALLOC alloca
483# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
484# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
485 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
486# ifndef EXIT_SUCCESS
487# define EXIT_SUCCESS 0
488# endif
489# endif
490# endif
491# endif
492# endif
493
494# ifdef YYSTACK_ALLOC
495 /* Pacify GCC's 'empty if-body' warning. */
496# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
497# ifndef YYSTACK_ALLOC_MAXIMUM
498 /* The OS might guarantee only one guard page at the bottom of the stack,
499 and a page size can be as small as 4096 bytes. So we cannot safely
500 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
501 to allow for a few compiler-allocated temporary stack slots. */
502# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
503# endif
504# else
505# define YYSTACK_ALLOC YYMALLOC
506# define YYSTACK_FREE YYFREE
507# ifndef YYSTACK_ALLOC_MAXIMUM
508# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
509# endif
510# if (defined __cplusplus && ! defined EXIT_SUCCESS \
511 && ! ((defined YYMALLOC || defined malloc) \
512 && (defined YYFREE || defined free)))
513# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
514# ifndef EXIT_SUCCESS
515# define EXIT_SUCCESS 0
516# endif
517# endif
518# ifndef YYMALLOC
519# define YYMALLOC malloc
520# if ! defined malloc && ! defined EXIT_SUCCESS
521void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
522# endif
523# endif
524# ifndef YYFREE
525# define YYFREE free
526# if ! defined free && ! defined EXIT_SUCCESS
527void free (void *); /* INFRINGES ON USER NAME SPACE */
528# endif
529# endif
530# endif
531#endif /* 1 */
532
533#if (! defined yyoverflow \
534 && (! defined __cplusplus \
535 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
536 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
537
538/* A type that is properly aligned for any stack member. */
545
546/* The size of the maximum gap between one aligned stack and the next. */
547# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
548
549/* The size of an array large to enough to hold all stacks, each with
550 N elements. */
551# define YYSTACK_BYTES(N) \
552 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \
553 + YYSIZEOF (YYLTYPE)) \
554 + 2 * YYSTACK_GAP_MAXIMUM)
555
556# define YYCOPY_NEEDED 1
557
558/* Relocate STACK from its old location to the new one. The
559 local variables YYSIZE and YYSTACKSIZE give the old and new number of
560 elements in the stack, and YYPTR gives the new location of the
561 stack. Advance YYPTR to a properly aligned location for the next
562 stack. */
563# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
564 do \
565 { \
566 YYPTRDIFF_T yynewbytes; \
567 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
568 Stack = &yyptr->Stack_alloc; \
569 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
570 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
571 } \
572 while (0)
573
574#endif
575
576#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
577/* Copy COUNT objects from SRC to DST. The source and destination do
578 not overlap. */
579# ifndef YYCOPY
580# if defined __GNUC__ && 1 < __GNUC__
581# define YYCOPY(Dst, Src, Count) \
582 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
583# else
584# define YYCOPY(Dst, Src, Count) \
585 do \
586 { \
587 YYPTRDIFF_T yyi; \
588 for (yyi = 0; yyi < (Count); yyi++) \
589 (Dst)[yyi] = (Src)[yyi]; \
590 } \
591 while (0)
592# endif
593# endif
594#endif /* !YYCOPY_NEEDED */
595
596/* YYFINAL -- State number of the termination state. */
597#define YYFINAL 14
598/* YYLAST -- Last index in YYTABLE. */
599#define YYLAST 106
600
601/* YYNTOKENS -- Number of terminals. */
602#define YYNTOKENS 75
603/* YYNNTS -- Number of nonterminals. */
604#define YYNNTS 13
605/* YYNRULES -- Number of rules. */
606#define YYNRULES 83
607/* YYNSTATES -- Number of states. */
608#define YYNSTATES 114
609
610/* YYMAXUTOK -- Last valid token kind. */
611#define YYMAXUTOK 329
612
613
614/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
615 as returned by yylex, with out-of-bounds checking. */
616#define YYTRANSLATE(YYX) \
617 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
618 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
619 : YYSYMBOL_YYUNDEF)
620
621/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
622 as returned by yylex. */
623static const yytype_int8 yytranslate[] =
624{
625 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
626 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
627 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
628 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
629 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
630 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
631 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
632 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
633 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
634 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
635 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
636 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
637 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
638 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
639 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
640 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
641 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
642 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
643 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
644 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
645 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
646 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
647 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
648 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
649 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
650 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
651 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
652 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
653 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
654 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
655 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
656 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
657 65, 66, 67, 68, 69, 70, 71, 72, 73, 74
658};
659
660#if YYDEBUG
661/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
662static const yytype_int16 yyrline[] =
663{
664 0, 110, 110, 113, 116, 119, 122, 125, 128, 131,
665 134, 137, 140, 143, 146, 151, 159, 167, 175, 183,
666 191, 199, 207, 215, 223, 231, 239, 247, 255, 263,
667 271, 279, 287, 295, 303, 311, 319, 327, 335, 343,
668 351, 359, 369, 372, 376, 380, 384, 388, 392, 396,
669 400, 407, 411, 415, 419, 423, 427, 445, 591, 693,
670 703, 704, 705, 708, 715, 716, 717, 720, 731, 739,
671 749, 759, 764, 784, 816, 845, 844, 863, 876, 888,
672 888, 937, 943, 944
673};
674#endif
675
677#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
678
679#if 1
680/* The user-facing name of the symbol whose (internal) number is
681 YYSYMBOL. No bounds checking. */
682static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
683
684/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
685 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
686static const char *const yytname[] =
687{
688 "\"end of file\"", "error", "\"invalid token\"", "OP", "CP", "OP_AT",
689 "OP_EQUAL", "OP_DISEQUAL", "OP_AND", "OP_OR", "OP_NOT", "OP_POINT",
690 "OP_LT", "OP_LTE", "OP_GT", "OP_GTE", "OP_COMMA", "OP_TAB", "OP_PIPE",
691 "IF", "ELSE", "ELSEIF", "ENDIF", "EMIT", "AS", "NewLine", "ATARI",
692 "ATARIXL", "C128", "C128Z", "C64", "C64REU", "GB", "VIC20", "ZX",
693 "COLECO", "SC3000", "SG1000", "MSX", "MSX1", "DRAGON", "DRAGON32",
694 "DRAGON64", "PC1403", "PC128OP", "MO5", "CPC", "COCO", "VZ200", "COCO1",
695 "COCO2", "COCO3", "MACRO", "ENDMACRO", "INLINE", "BIN", "PRG", "XEX",
696 "K7O", "K7N", "K7", "TAP", "ROM", "D64", "DSK", "ATR", "REU", "TO8",
697 "PCCGA", "SDDRIVE", "Identifier", "Content", "Value", "Integer",
698 "String", "$accept", "output", "target", "const_expr", "const_factor",
699 "macro_parameter", "macro_parameters", "macro_value", "macro_values",
700 "embed2", "$@1", "$@2", "embed", YY_NULLPTR
701};
702
703static const char *
704yysymbol_name (yysymbol_kind_t yysymbol)
705{
706 return yytname[yysymbol];
707}
708#endif
709
710#define YYPACT_NINF (-63)
711
712#define yypact_value_is_default(Yyn) \
713 ((Yyn) == YYPACT_NINF)
714
715#define YYTABLE_NINF (-1)
716
717#define yytable_value_is_error(Yyn) \
718 0
719
720/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
721 STATE-NUM. */
722static const yytype_int8 yypact[] =
723{
724 -2, 52, -63, -21, 6, -3, -14, -3, -63, -62,
725 -61, -63, -60, -63, -63, -3, -3, -63, -63, -63,
726 -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
727 -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
728 -63, -63, -63, -63, -63, -63, -63, -63, -63, -63,
729 -63, -63, -63, -63, -63, -63, -63, 0, -63, -63,
730 -63, -63, 86, -3, -63, -10, -63, -63, 9, -63,
731 -54, -3, -3, -3, -3, -3, -3, -3, -3, -63,
732 -53, -52, -51, -50, -63, 10, -63, -63, -63, -63,
733 -63, -63, -63, -63, -9, -63, -63, 33, -63, -63,
734 34, -63, -19, 7, 11, -51, -50, -63, 56, -63,
735 -63, -63, 12, -63
736};
737
738/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
739 Performed when YYTABLE does not specify something else to do. Zero
740 means the default is an error. */
741static const yytype_int8 yydefact[] =
742{
743 81, 0, 78, 82, 0, 0, 68, 0, 71, 0,
744 0, 77, 0, 83, 1, 0, 0, 15, 16, 17,
745 18, 19, 20, 21, 22, 23, 25, 26, 27, 29,
746 34, 35, 36, 28, 37, 39, 40, 30, 41, 31,
747 32, 33, 2, 3, 4, 5, 6, 7, 8, 9,
748 10, 11, 12, 14, 38, 24, 13, 58, 51, 53,
749 52, 67, 42, 0, 70, 0, 75, 79, 0, 55,
750 0, 0, 0, 0, 0, 0, 0, 0, 0, 69,
751 0, 0, 60, 64, 54, 57, 45, 46, 43, 44,
752 47, 48, 49, 50, 0, 74, 59, 61, 76, 63,
753 65, 80, 0, 0, 0, 60, 64, 56, 0, 73,
754 62, 66, 0, 72
755};
756
757/* YYPGOTO[NTERM-NUM]. */
758static const yytype_int8 yypgoto[] =
759{
760 -63, -63, -63, 5, 13, -63, -29, -63, -23, -63,
761 -63, -63, -63
762};
763
764/* YYDEFGOTO[NTERM-NUM]. */
765static const yytype_int8 yydefgoto[] =
766{
767 0, 59, 60, 61, 62, 97, 98, 100, 101, 3,
768 82, 83, 4
769};
770
771/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
772 positive, shift that token. If negative, reduce the rule whose
773 number is the opposite. If YYTABLE_NINF, syntax error. */
774static const yytype_int8 yytable[] =
775{
776 15, 80, 103, 1, 13, 63, 14, 16, 65, 66,
777 67, 70, 64, 84, 81, 104, 85, 94, 95, 96,
778 68, 102, 99, 17, 18, 19, 20, 21, 22, 69,
779 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
780 33, 34, 35, 36, 37, 38, 39, 40, 41, 105,
781 106, 107, 42, 43, 44, 45, 46, 47, 48, 49,
782 50, 51, 52, 53, 54, 55, 56, 57, 79, 2,
783 58, 5, 6, 7, 8, 9, 110, 108, 88, 89,
784 112, 109, 113, 111, 86, 87, 0, 0, 90, 91,
785 92, 93, 71, 72, 73, 74, 0, 0, 75, 76,
786 77, 78, 0, 0, 10, 11, 12
787};
788
789static const yytype_int8 yycheck[] =
790{
791 3, 11, 11, 5, 25, 19, 0, 10, 70, 70,
792 70, 11, 7, 4, 24, 24, 70, 70, 70, 70,
793 15, 11, 72, 26, 27, 28, 29, 30, 31, 16,
794 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
795 43, 44, 45, 46, 47, 48, 49, 50, 51, 16,
796 16, 70, 55, 56, 57, 58, 59, 60, 61, 62,
797 63, 64, 65, 66, 67, 68, 69, 70, 63, 71,
798 73, 19, 20, 21, 22, 23, 105, 70, 73, 74,
799 24, 70, 70, 106, 71, 72, -1, -1, 75, 76,
800 77, 78, 6, 7, 8, 9, -1, -1, 12, 13,
801 14, 15, -1, -1, 52, 53, 54
802};
803
804/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
805 state STATE-NUM. */
806static const yytype_int8 yystos[] =
807{
808 0, 5, 71, 84, 87, 19, 20, 21, 22, 23,
809 52, 53, 54, 25, 0, 3, 10, 26, 27, 28,
810 29, 30, 31, 33, 34, 35, 36, 37, 38, 39,
811 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
812 50, 51, 55, 56, 57, 58, 59, 60, 61, 62,
813 63, 64, 65, 66, 67, 68, 69, 70, 73, 76,
814 77, 78, 79, 19, 78, 70, 70, 70, 78, 79,
815 11, 6, 7, 8, 9, 12, 13, 14, 15, 78,
816 11, 24, 85, 86, 4, 70, 79, 79, 78, 78,
817 79, 79, 79, 79, 70, 70, 70, 80, 81, 72,
818 82, 83, 11, 11, 24, 16, 16, 70, 70, 70,
819 81, 83, 24, 70
820};
821
822/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
823static const yytype_int8 yyr1[] =
824{
825 0, 75, 76, 76, 76, 76, 76, 76, 76, 76,
826 76, 76, 76, 76, 76, 77, 77, 77, 77, 77,
827 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
828 77, 77, 77, 77, 77, 77, 77, 77, 77, 77,
829 77, 77, 78, 78, 78, 78, 78, 78, 78, 78,
830 78, 79, 79, 79, 79, 79, 79, 79, 79, 80,
831 81, 81, 81, 82, 83, 83, 83, 84, 84, 84,
832 84, 84, 84, 84, 84, 85, 84, 84, 84, 86,
833 84, 84, 87, 87
834};
835
836/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
837static const yytype_int8 yyr2[] =
838{
839 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
840 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
841 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
842 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
843 1, 1, 1, 3, 3, 3, 3, 3, 3, 3,
844 3, 1, 1, 1, 3, 2, 5, 3, 1, 1,
845 0, 1, 3, 1, 0, 1, 3, 3, 2, 4,
846 3, 2, 9, 7, 5, 0, 5, 2, 1, 0,
847 5, 0, 1, 2
848};
849
850
851enum { YYENOMEM = -2 };
852
853#define yyerrok (yyerrstatus = 0)
854#define yyclearin (yychar = YYEMPTY)
855
856#define YYACCEPT goto yyacceptlab
857#define YYABORT goto yyabortlab
858#define YYERROR goto yyerrorlab
859#define YYNOMEM goto yyexhaustedlab
860
861
862#define YYRECOVERING() (!!yyerrstatus)
863
864#define YYBACKUP(Token, Value) \
865 do \
866 if (yychar == YYEMPTY) \
867 { \
868 yychar = (Token); \
869 yylval = (Value); \
870 YYPOPSTACK (yylen); \
871 yystate = *yyssp; \
872 goto yybackup; \
873 } \
874 else \
875 { \
876 yyerror (_environment, YY_("syntax error: cannot back up")); \
877 YYERROR; \
878 } \
879 while (0)
880
881/* Backward compatibility with an undocumented macro.
882 Use YYerror or YYUNDEF. */
883#define YYERRCODE YYUNDEF
884
885/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
886 If N is 0, then set CURRENT to the empty location which ends
887 the previous symbol: RHS[0] (always defined). */
888
889#ifndef YYLLOC_DEFAULT
890# define YYLLOC_DEFAULT(Current, Rhs, N) \
891 do \
892 if (N) \
893 { \
894 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
895 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
896 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
897 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
898 } \
899 else \
900 { \
901 (Current).first_line = (Current).last_line = \
902 YYRHSLOC (Rhs, 0).last_line; \
903 (Current).first_column = (Current).last_column = \
904 YYRHSLOC (Rhs, 0).last_column; \
905 } \
906 while (0)
907#endif
908
909#define YYRHSLOC(Rhs, K) ((Rhs)[K])
910
911
912/* Enable debugging if requested. */
913#if YYDEBUG
914
915# ifndef YYFPRINTF
916# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
917# define YYFPRINTF fprintf
918# endif
919
920# define YYDPRINTF(Args) \
921do { \
922 if (yydebug) \
923 YYFPRINTF Args; \
924} while (0)
925
926
927/* YYLOCATION_PRINT -- Print the location on the stream.
928 This macro was not mandated originally: define only if we know
929 we won't break user code: when these are the locations we know. */
930
931# ifndef YYLOCATION_PRINT
932
933# if defined YY_LOCATION_PRINT
934
935 /* Temporary convenience wrapper in case some people defined the
936 undocumented and private YY_LOCATION_PRINT macros. */
937# define YYLOCATION_PRINT(File, Loc) YY_LOCATION_PRINT(File, *(Loc))
938
939# elif defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
940
941/* Print *YYLOCP on YYO. Private, do not rely on its existence. */
942
944static int
945yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
946{
947 int res = 0;
948 int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
949 if (0 <= yylocp->first_line)
950 {
951 res += YYFPRINTF (yyo, "%d", yylocp->first_line);
952 if (0 <= yylocp->first_column)
953 res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
954 }
955 if (0 <= yylocp->last_line)
956 {
957 if (yylocp->first_line < yylocp->last_line)
958 {
959 res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
960 if (0 <= end_col)
961 res += YYFPRINTF (yyo, ".%d", end_col);
962 }
963 else if (0 <= end_col && yylocp->first_column < end_col)
964 res += YYFPRINTF (yyo, "-%d", end_col);
965 }
966 return res;
967}
968
969# define YYLOCATION_PRINT yy_location_print_
970
971 /* Temporary convenience wrapper in case some people defined the
972 undocumented and private YY_LOCATION_PRINT macros. */
973# define YY_LOCATION_PRINT(File, Loc) YYLOCATION_PRINT(File, &(Loc))
974
975# else
976
977# define YYLOCATION_PRINT(File, Loc) ((void) 0)
978 /* Temporary convenience wrapper in case some people defined the
979 undocumented and private YY_LOCATION_PRINT macros. */
980# define YY_LOCATION_PRINT YYLOCATION_PRINT
981
982# endif
983# endif /* !defined YYLOCATION_PRINT */
984
985
986# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
987do { \
988 if (yydebug) \
989 { \
990 YYFPRINTF (stderr, "%s ", Title); \
991 yy_symbol_print (stderr, \
992 Kind, Value, Location, _environment); \
993 YYFPRINTF (stderr, "\n"); \
994 } \
995} while (0)
996
997
998/*-----------------------------------.
999| Print this symbol's value on YYO. |
1000`-----------------------------------*/
1001
1002static void
1003yy_symbol_value_print (FILE *yyo,
1004 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, void * _environment)
1005{
1006 FILE *yyoutput = yyo;
1007 YY_USE (yyoutput);
1008 YY_USE (yylocationp);
1009 YY_USE (_environment);
1010 if (!yyvaluep)
1011 return;
1013 YY_USE (yykind);
1015}
1016
1017
1018/*---------------------------.
1019| Print this symbol on YYO. |
1020`---------------------------*/
1021
1022static void
1023yy_symbol_print (FILE *yyo,
1024 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, void * _environment)
1025{
1026 YYFPRINTF (yyo, "%s %s (",
1027 yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
1028
1029 YYLOCATION_PRINT (yyo, yylocationp);
1030 YYFPRINTF (yyo, ": ");
1031 yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp, _environment);
1032 YYFPRINTF (yyo, ")");
1033}
1034
1035/*------------------------------------------------------------------.
1036| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1037| TOP (included). |
1038`------------------------------------------------------------------*/
1039
1040static void
1041yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
1042{
1043 YYFPRINTF (stderr, "Stack now");
1044 for (; yybottom <= yytop; yybottom++)
1045 {
1046 int yybot = *yybottom;
1047 YYFPRINTF (stderr, " %d", yybot);
1048 }
1049 YYFPRINTF (stderr, "\n");
1050}
1051
1052# define YY_STACK_PRINT(Bottom, Top) \
1053do { \
1054 if (yydebug) \
1055 yy_stack_print ((Bottom), (Top)); \
1056} while (0)
1057
1058
1059/*------------------------------------------------.
1060| Report that the YYRULE is going to be reduced. |
1061`------------------------------------------------*/
1062
1063static void
1064yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp,
1065 int yyrule, void * _environment)
1066{
1067 int yylno = yyrline[yyrule];
1068 int yynrhs = yyr2[yyrule];
1069 int yyi;
1070 YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
1071 yyrule - 1, yylno);
1072 /* The symbols being reduced. */
1073 for (yyi = 0; yyi < yynrhs; yyi++)
1074 {
1075 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1076 yy_symbol_print (stderr,
1077 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
1078 &yyvsp[(yyi + 1) - (yynrhs)],
1079 &(yylsp[(yyi + 1) - (yynrhs)]), _environment);
1080 YYFPRINTF (stderr, "\n");
1081 }
1082}
1083
1084# define YY_REDUCE_PRINT(Rule) \
1085do { \
1086 if (yydebug) \
1087 yy_reduce_print (yyssp, yyvsp, yylsp, Rule, _environment); \
1088} while (0)
1089
1090/* Nonzero means print parse trace. It is left uninitialized so that
1091 multiple parsers can coexist. */
1092int yydebug;
1093#else /* !YYDEBUG */
1094# define YYDPRINTF(Args) ((void) 0)
1095# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
1096# define YY_STACK_PRINT(Bottom, Top)
1097# define YY_REDUCE_PRINT(Rule)
1098#endif /* !YYDEBUG */
1099
1100
1101/* YYINITDEPTH -- initial size of the parser's stacks. */
1102#ifndef YYINITDEPTH
1103# define YYINITDEPTH 200
1104#endif
1105
1106/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1107 if the built-in stack extension method is used).
1108
1109 Do not make this value too large; the results are undefined if
1110 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1111 evaluated with infinite-precision integer arithmetic. */
1112
1113#ifndef YYMAXDEPTH
1114# define YYMAXDEPTH 10000
1115#endif
1116
1117
1118/* Context of a parse error. */
1125
1126/* Put in YYARG at most YYARGN of the expected tokens given the
1127 current YYCTX, and return the number of tokens stored in YYARG. If
1128 YYARG is null, return the number of expected tokens (guaranteed to
1129 be less than YYNTOKENS). Return YYENOMEM on memory exhaustion.
1130 Return 0 if there are more than YYARGN expected tokens, yet fill
1131 YYARG up to YYARGN. */
1132static int
1133yypcontext_expected_tokens (const yypcontext_t *yyctx,
1134 yysymbol_kind_t yyarg[], int yyargn)
1135{
1136 /* Actual size of YYARG. */
1137 int yycount = 0;
1138 int yyn = yypact[+*yyctx->yyssp];
1139 if (!yypact_value_is_default (yyn))
1140 {
1141 /* Start YYX at -YYN if negative to avoid negative indexes in
1142 YYCHECK. In other words, skip the first -YYN actions for
1143 this state because they are default actions. */
1144 int yyxbegin = yyn < 0 ? -yyn : 0;
1145 /* Stay within bounds of both yycheck and yytname. */
1146 int yychecklim = YYLAST - yyn + 1;
1147 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1148 int yyx;
1149 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1150 if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror
1151 && !yytable_value_is_error (yytable[yyx + yyn]))
1152 {
1153 if (!yyarg)
1154 ++yycount;
1155 else if (yycount == yyargn)
1156 return 0;
1157 else
1158 yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx);
1159 }
1160 }
1161 if (yyarg && yycount == 0 && 0 < yyargn)
1162 yyarg[0] = YYSYMBOL_YYEMPTY;
1163 return yycount;
1164}
1165
1166
1167
1168
1169#ifndef yystrlen
1170# if defined __GLIBC__ && defined _STRING_H
1171# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
1172# else
1173/* Return the length of YYSTR. */
1174static YYPTRDIFF_T
1175yystrlen (const char *yystr)
1176{
1177 YYPTRDIFF_T yylen;
1178 for (yylen = 0; yystr[yylen]; yylen++)
1179 continue;
1180 return yylen;
1181}
1182# endif
1183#endif
1184
1185#ifndef yystpcpy
1186# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1187# define yystpcpy stpcpy
1188# else
1189/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1190 YYDEST. */
1191static char *
1192yystpcpy (char *yydest, const char *yysrc)
1193{
1194 char *yyd = yydest;
1195 const char *yys = yysrc;
1196
1197 while ((*yyd++ = *yys++) != '\0')
1198 continue;
1199
1200 return yyd - 1;
1201}
1202# endif
1203#endif
1204
1205#ifndef yytnamerr
1206/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1207 quotes and backslashes, so that it's suitable for yyerror. The
1208 heuristic is that double-quoting is unnecessary unless the string
1209 contains an apostrophe, a comma, or backslash (other than
1210 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1211 null, do not copy; instead, return the length of what the result
1212 would have been. */
1213static YYPTRDIFF_T
1214yytnamerr (char *yyres, const char *yystr)
1215{
1216 if (*yystr == '"')
1217 {
1218 YYPTRDIFF_T yyn = 0;
1219 char const *yyp = yystr;
1220 for (;;)
1221 switch (*++yyp)
1222 {
1223 case '\'':
1224 case ',':
1225 goto do_not_strip_quotes;
1226
1227 case '\\':
1228 if (*++yyp != '\\')
1229 goto do_not_strip_quotes;
1230 else
1231 goto append;
1232
1233 append:
1234 default:
1235 if (yyres)
1236 yyres[yyn] = *yyp;
1237 yyn++;
1238 break;
1239
1240 case '"':
1241 if (yyres)
1242 yyres[yyn] = '\0';
1243 return yyn;
1244 }
1245 do_not_strip_quotes: ;
1246 }
1247
1248 if (yyres)
1249 return yystpcpy (yyres, yystr) - yyres;
1250 else
1251 return yystrlen (yystr);
1252}
1253#endif
1254
1255
1256static int
1257yy_syntax_error_arguments (const yypcontext_t *yyctx,
1258 yysymbol_kind_t yyarg[], int yyargn)
1259{
1260 /* Actual size of YYARG. */
1261 int yycount = 0;
1262 /* There are many possibilities here to consider:
1263 - If this state is a consistent state with a default action, then
1264 the only way this function was invoked is if the default action
1265 is an error action. In that case, don't check for expected
1266 tokens because there are none.
1267 - The only way there can be no lookahead present (in yychar) is if
1268 this state is a consistent state with a default action. Thus,
1269 detecting the absence of a lookahead is sufficient to determine
1270 that there is no unexpected or expected token to report. In that
1271 case, just report a simple "syntax error".
1272 - Don't assume there isn't a lookahead just because this state is a
1273 consistent state with a default action. There might have been a
1274 previous inconsistent state, consistent state with a non-default
1275 action, or user semantic action that manipulated yychar.
1276 - Of course, the expected token list depends on states to have
1277 correct lookahead information, and it depends on the parser not
1278 to perform extra reductions after fetching a lookahead from the
1279 scanner and before detecting a syntax error. Thus, state merging
1280 (from LALR or IELR) and default reductions corrupt the expected
1281 token list. However, the list is correct for canonical LR with
1282 one exception: it will still contain any token that will not be
1283 accepted due to an error action in a later state.
1284 */
1285 if (yyctx->yytoken != YYSYMBOL_YYEMPTY)
1286 {
1287 int yyn;
1288 if (yyarg)
1289 yyarg[yycount] = yyctx->yytoken;
1290 ++yycount;
1291 yyn = yypcontext_expected_tokens (yyctx,
1292 yyarg ? yyarg + 1 : yyarg, yyargn - 1);
1293 if (yyn == YYENOMEM)
1294 return YYENOMEM;
1295 else
1296 yycount += yyn;
1297 }
1298 return yycount;
1299}
1300
1301/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1302 about the unexpected token YYTOKEN for the state stack whose top is
1303 YYSSP.
1304
1305 Return 0 if *YYMSG was successfully written. Return -1 if *YYMSG is
1306 not large enough to hold the message. In that case, also set
1307 *YYMSG_ALLOC to the required number of bytes. Return YYENOMEM if the
1308 required number of bytes is too large to store. */
1309static int
1310yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
1311 const yypcontext_t *yyctx)
1312{
1313 enum { YYARGS_MAX = 5 };
1314 /* Internationalized format string. */
1315 const char *yyformat = YY_NULLPTR;
1316 /* Arguments of yyformat: reported tokens (one for the "unexpected",
1317 one per "expected"). */
1318 yysymbol_kind_t yyarg[YYARGS_MAX];
1319 /* Cumulated lengths of YYARG. */
1320 YYPTRDIFF_T yysize = 0;
1321
1322 /* Actual size of YYARG. */
1323 int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX);
1324 if (yycount == YYENOMEM)
1325 return YYENOMEM;
1326
1327 switch (yycount)
1328 {
1329#define YYCASE_(N, S) \
1330 case N: \
1331 yyformat = S; \
1332 break
1333 default: /* Avoid compiler warnings. */
1334 YYCASE_(0, YY_("syntax error"));
1335 YYCASE_(1, YY_("syntax error, unexpected %s"));
1336 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1337 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1338 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1339 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1340#undef YYCASE_
1341 }
1342
1343 /* Compute error message size. Don't count the "%s"s, but reserve
1344 room for the terminator. */
1345 yysize = yystrlen (yyformat) - 2 * yycount + 1;
1346 {
1347 int yyi;
1348 for (yyi = 0; yyi < yycount; ++yyi)
1349 {
1350 YYPTRDIFF_T yysize1
1351 = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]);
1352 if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1353 yysize = yysize1;
1354 else
1355 return YYENOMEM;
1356 }
1357 }
1358
1359 if (*yymsg_alloc < yysize)
1360 {
1361 *yymsg_alloc = 2 * yysize;
1362 if (! (yysize <= *yymsg_alloc
1363 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1364 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1365 return -1;
1366 }
1367
1368 /* Avoid sprintf, as that infringes on the user's name space.
1369 Don't have undefined behavior even if the translation
1370 produced a string with the wrong number of "%s"s. */
1371 {
1372 char *yyp = *yymsg;
1373 int yyi = 0;
1374 while ((*yyp = *yyformat) != '\0')
1375 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1376 {
1377 yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]);
1378 yyformat += 2;
1379 }
1380 else
1381 {
1382 ++yyp;
1383 ++yyformat;
1384 }
1385 }
1386 return 0;
1387}
1388
1389
1390/*-----------------------------------------------.
1391| Release the memory associated to this symbol. |
1392`-----------------------------------------------*/
1393
1394static void
1395yydestruct (const char *yymsg,
1396 yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, void * _environment)
1397{
1398 YY_USE (yyvaluep);
1399 YY_USE (yylocationp);
1400 YY_USE (_environment);
1401 if (!yymsg)
1402 yymsg = "Deleting";
1403 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1404
1406 YY_USE (yykind);
1408}
1409
1410
1411/* Lookahead token kind. */
1413
1414/* The semantic value of the lookahead symbol. */
1416/* Location data for the lookahead symbol. */
1418# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1419 = { 1, 1, 1, 1 }
1420# endif
1421;
1422/* Number of syntax errors so far. */
1424
1425
1426
1427
1428/*----------.
1429| yyparse. |
1430`----------*/
1431
1432int
1433yyparse (void * _environment)
1434{
1435 yy_state_fast_t yystate = 0;
1436 /* Number of tokens to shift before error messages enabled. */
1437 int yyerrstatus = 0;
1438
1439 /* Refer to the stacks through separate pointers, to allow yyoverflow
1440 to reallocate them elsewhere. */
1441
1442 /* Their size. */
1443 YYPTRDIFF_T yystacksize = YYINITDEPTH;
1444
1445 /* The state stack: array, bottom, top. */
1446 yy_state_t yyssa[YYINITDEPTH];
1447 yy_state_t *yyss = yyssa;
1448 yy_state_t *yyssp = yyss;
1449
1450 /* The semantic value stack: array, bottom, top. */
1451 YYSTYPE yyvsa[YYINITDEPTH];
1452 YYSTYPE *yyvs = yyvsa;
1453 YYSTYPE *yyvsp = yyvs;
1454
1455 /* The location stack: array, bottom, top. */
1456 YYLTYPE yylsa[YYINITDEPTH];
1457 YYLTYPE *yyls = yylsa;
1458 YYLTYPE *yylsp = yyls;
1459
1460 int yyn;
1461 /* The return value of yyparse. */
1462 int yyresult;
1463 /* Lookahead symbol kind. */
1465 /* The variables used to return semantic value and location from the
1466 action routines. */
1467 YYSTYPE yyval;
1468 YYLTYPE yyloc;
1469
1470 /* The locations where the error started and ended. */
1471 YYLTYPE yyerror_range[3];
1472
1473 /* Buffer for error messages, and its allocated size. */
1474 char yymsgbuf[128];
1475 char *yymsg = yymsgbuf;
1476 YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
1477
1478#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1479
1480 /* The number of symbols on the RHS of the reduced rule.
1481 Keep to zero when no symbol should be popped. */
1482 int yylen = 0;
1483
1484 YYDPRINTF ((stderr, "Starting parse\n"));
1485
1486 yychar = YYEMPTY; /* Cause a token to be read. */
1487
1488 yylsp[0] = yylloc;
1489 goto yysetstate;
1490
1491
1492/*------------------------------------------------------------.
1493| yynewstate -- push a new state, which is found in yystate. |
1494`------------------------------------------------------------*/
1495yynewstate:
1496 /* In all cases, when you get here, the value and location stacks
1497 have just been pushed. So pushing a state here evens the stacks. */
1498 yyssp++;
1499
1500
1501/*--------------------------------------------------------------------.
1502| yysetstate -- set current state (the top of the stack) to yystate. |
1503`--------------------------------------------------------------------*/
1504yysetstate:
1505 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1506 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1508 *yyssp = YY_CAST (yy_state_t, yystate);
1510 YY_STACK_PRINT (yyss, yyssp);
1511
1512 if (yyss + yystacksize - 1 <= yyssp)
1513#if !defined yyoverflow && !defined YYSTACK_RELOCATE
1514 YYNOMEM;
1515#else
1516 {
1517 /* Get the current used size of the three stacks, in elements. */
1518 YYPTRDIFF_T yysize = yyssp - yyss + 1;
1519
1520# if defined yyoverflow
1521 {
1522 /* Give user a chance to reallocate the stack. Use copies of
1523 these so that the &'s don't force the real ones into
1524 memory. */
1525 yy_state_t *yyss1 = yyss;
1526 YYSTYPE *yyvs1 = yyvs;
1527 YYLTYPE *yyls1 = yyls;
1528
1529 /* Each stack pointer address is followed by the size of the
1530 data in use in that stack, in bytes. This used to be a
1531 conditional around just the two extra args, but that might
1532 be undefined if yyoverflow is a macro. */
1533 yyoverflow (YY_("memory exhausted"),
1534 &yyss1, yysize * YYSIZEOF (*yyssp),
1535 &yyvs1, yysize * YYSIZEOF (*yyvsp),
1536 &yyls1, yysize * YYSIZEOF (*yylsp),
1537 &yystacksize);
1538 yyss = yyss1;
1539 yyvs = yyvs1;
1540 yyls = yyls1;
1541 }
1542# else /* defined YYSTACK_RELOCATE */
1543 /* Extend the stack our own way. */
1544 if (YYMAXDEPTH <= yystacksize)
1545 YYNOMEM;
1546 yystacksize *= 2;
1547 if (YYMAXDEPTH < yystacksize)
1548 yystacksize = YYMAXDEPTH;
1549
1550 {
1551 yy_state_t *yyss1 = yyss;
1552 union yyalloc *yyptr =
1553 YY_CAST (union yyalloc *,
1554 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1555 if (! yyptr)
1556 YYNOMEM;
1557 YYSTACK_RELOCATE (yyss_alloc, yyss);
1558 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1559 YYSTACK_RELOCATE (yyls_alloc, yyls);
1560# undef YYSTACK_RELOCATE
1561 if (yyss1 != yyssa)
1562 YYSTACK_FREE (yyss1);
1563 }
1564# endif
1565
1566 yyssp = yyss + yysize - 1;
1567 yyvsp = yyvs + yysize - 1;
1568 yylsp = yyls + yysize - 1;
1569
1571 YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1572 YY_CAST (long, yystacksize)));
1574
1575 if (yyss + yystacksize - 1 <= yyssp)
1576 YYABORT;
1577 }
1578#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1579
1580
1581 if (yystate == YYFINAL)
1582 YYACCEPT;
1583
1584 goto yybackup;
1585
1586
1587/*-----------.
1588| yybackup. |
1589`-----------*/
1590yybackup:
1591 /* Do appropriate processing given the current state. Read a
1592 lookahead token if we need one and don't already have one. */
1593
1594 /* First try to decide what to do without reference to lookahead token. */
1595 yyn = yypact[yystate];
1596 if (yypact_value_is_default (yyn))
1597 goto yydefault;
1598
1599 /* Not known => get a lookahead token if don't already have one. */
1600
1601 /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
1602 if (yychar == YYEMPTY)
1603 {
1604 YYDPRINTF ((stderr, "Reading a token\n"));
1605 yychar = yylex ();
1606 }
1607
1608 if (yychar <= YYEOF)
1609 {
1610 yychar = YYEOF;
1611 yytoken = YYSYMBOL_YYEOF;
1612 YYDPRINTF ((stderr, "Now at end of input.\n"));
1613 }
1614 else if (yychar == YYerror)
1615 {
1616 /* The scanner already issued an error message, process directly
1617 to error recovery. But do not keep the error token as
1618 lookahead, it is too special and may lead us to an endless
1619 loop in error recovery. */
1620 yychar = YYUNDEF;
1621 yytoken = YYSYMBOL_YYerror;
1622 yyerror_range[1] = yylloc;
1623 goto yyerrlab1;
1624 }
1625 else
1626 {
1627 yytoken = YYTRANSLATE (yychar);
1628 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1629 }
1630
1631 /* If the proper action on seeing token YYTOKEN is to reduce or to
1632 detect an error, take that action. */
1633 yyn += yytoken;
1634 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1635 goto yydefault;
1636 yyn = yytable[yyn];
1637 if (yyn <= 0)
1638 {
1639 if (yytable_value_is_error (yyn))
1640 goto yyerrlab;
1641 yyn = -yyn;
1642 goto yyreduce;
1643 }
1644
1645 /* Count tokens shifted since error; after three, turn off error
1646 status. */
1647 if (yyerrstatus)
1648 yyerrstatus--;
1649
1650 /* Shift the lookahead token. */
1651 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1652 yystate = yyn;
1654 *++yyvsp = yylval;
1656 *++yylsp = yylloc;
1657
1658 /* Discard the shifted token. */
1659 yychar = YYEMPTY;
1660 goto yynewstate;
1661
1662
1663/*-----------------------------------------------------------.
1664| yydefault -- do the default action for the current state. |
1665`-----------------------------------------------------------*/
1666yydefault:
1667 yyn = yydefact[yystate];
1668 if (yyn == 0)
1669 goto yyerrlab;
1670 goto yyreduce;
1671
1672
1673/*-----------------------------.
1674| yyreduce -- do a reduction. |
1675`-----------------------------*/
1676yyreduce:
1677 /* yyn is the number of a rule to reduce with. */
1678 yylen = yyr2[yyn];
1679
1680 /* If YYLEN is nonzero, implement the default value of the action:
1681 '$$ = $1'.
1682
1683 Otherwise, the following line sets YYVAL to garbage.
1684 This behavior is undocumented and Bison
1685 users should not rely upon it. Assigning to YYVAL
1686 unconditionally makes the parser a bit smaller, and it avoids a
1687 GCC warning that YYVAL may be used uninitialized. */
1688 yyval = yyvsp[1-yylen];
1689
1690 /* Default location. */
1691 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1692 yyerror_range[1] = yyloc;
1693 YY_REDUCE_PRINT (yyn);
1694 switch (yyn)
1695 {
1696 case 2: /* output: BIN */
1697#line 110 "src/ugbc.embed.y"
1698 {
1699 (yyval.integer) = OUTPUT_FILE_TYPE_BIN;
1700 }
1701#line 1702 "src-generated/ugbc.embed.tab.c"
1702 break;
1703
1704 case 3: /* output: PRG */
1705#line 113 "src/ugbc.embed.y"
1706 {
1707 (yyval.integer) = OUTPUT_FILE_TYPE_PRG;
1708 }
1709#line 1710 "src-generated/ugbc.embed.tab.c"
1710 break;
1711
1712 case 4: /* output: XEX */
1713#line 116 "src/ugbc.embed.y"
1714 {
1715 (yyval.integer) = OUTPUT_FILE_TYPE_XEX;
1716 }
1717#line 1718 "src-generated/ugbc.embed.tab.c"
1718 break;
1719
1720 case 5: /* output: K7O */
1721#line 119 "src/ugbc.embed.y"
1722 {
1724 }
1725#line 1726 "src-generated/ugbc.embed.tab.c"
1726 break;
1727
1728 case 6: /* output: K7N */
1729#line 122 "src/ugbc.embed.y"
1730 {
1732 }
1733#line 1734 "src-generated/ugbc.embed.tab.c"
1734 break;
1735
1736 case 7: /* output: K7 */
1737#line 125 "src/ugbc.embed.y"
1738 {
1740 }
1741#line 1742 "src-generated/ugbc.embed.tab.c"
1742 break;
1743
1744 case 8: /* output: TAP */
1745#line 128 "src/ugbc.embed.y"
1746 {
1747 (yyval.integer) = OUTPUT_FILE_TYPE_TAP;
1748 }
1749#line 1750 "src-generated/ugbc.embed.tab.c"
1750 break;
1751
1752 case 9: /* output: ROM */
1753#line 131 "src/ugbc.embed.y"
1754 {
1755 (yyval.integer) = OUTPUT_FILE_TYPE_ROM;
1756 }
1757#line 1758 "src-generated/ugbc.embed.tab.c"
1758 break;
1759
1760 case 10: /* output: D64 */
1761#line 134 "src/ugbc.embed.y"
1762 {
1763 (yyval.integer) = OUTPUT_FILE_TYPE_D64;
1764 }
1765#line 1766 "src-generated/ugbc.embed.tab.c"
1766 break;
1767
1768 case 11: /* output: DSK */
1769#line 137 "src/ugbc.embed.y"
1770 {
1771 (yyval.integer) = OUTPUT_FILE_TYPE_DSK;
1772 }
1773#line 1774 "src-generated/ugbc.embed.tab.c"
1774 break;
1775
1776 case 12: /* output: ATR */
1777#line 140 "src/ugbc.embed.y"
1778 {
1779 (yyval.integer) = OUTPUT_FILE_TYPE_ATR;
1780 }
1781#line 1782 "src-generated/ugbc.embed.tab.c"
1782 break;
1783
1784 case 13: /* output: SDDRIVE */
1785#line 143 "src/ugbc.embed.y"
1786 {
1788 }
1789#line 1790 "src-generated/ugbc.embed.tab.c"
1790 break;
1791
1792 case 14: /* output: REU */
1793#line 146 "src/ugbc.embed.y"
1794 {
1795 (yyval.integer) = OUTPUT_FILE_TYPE_REU;
1796 }
1797#line 1798 "src-generated/ugbc.embed.tab.c"
1798 break;
1799
1800 case 15: /* target: ATARI */
1801#line 151 "src/ugbc.embed.y"
1802 {
1803 #ifdef __atari__
1804 (yyval.integer) = 1;
1805 #else
1806 (yyval.integer) = 0;
1807 #endif
1808 }
1809#line 1810 "src-generated/ugbc.embed.tab.c"
1810 break;
1811
1812 case 16: /* target: ATARIXL */
1813#line 159 "src/ugbc.embed.y"
1814 {
1815 #ifdef __atarixl__
1816 (yyval.integer) = 1;
1817 #else
1818 (yyval.integer) = 0;
1819 #endif
1820 }
1821#line 1822 "src-generated/ugbc.embed.tab.c"
1822 break;
1823
1824 case 17: /* target: C128 */
1825#line 167 "src/ugbc.embed.y"
1826 {
1827 #ifdef __c128__
1828 (yyval.integer) = 1;
1829 #else
1830 (yyval.integer) = 0;
1831 #endif
1832 }
1833#line 1834 "src-generated/ugbc.embed.tab.c"
1834 break;
1835
1836 case 18: /* target: C128Z */
1837#line 175 "src/ugbc.embed.y"
1838 {
1839 #ifdef __c128z__
1840 (yyval.integer) = 1;
1841 #else
1842 (yyval.integer) = 0;
1843 #endif
1844 }
1845#line 1846 "src-generated/ugbc.embed.tab.c"
1846 break;
1847
1848 case 19: /* target: C64 */
1849#line 183 "src/ugbc.embed.y"
1850 {
1851 #ifdef __c64__
1852 (yyval.integer) = 1;
1853 #else
1854 (yyval.integer) = 0;
1855 #endif
1856 }
1857#line 1858 "src-generated/ugbc.embed.tab.c"
1858 break;
1859
1860 case 20: /* target: C64REU */
1861#line 191 "src/ugbc.embed.y"
1862 {
1863 #ifdef __c64reu__
1864 (yyval.integer) = 1;
1865 #else
1866 (yyval.integer) = 0;
1867 #endif
1868 }
1869#line 1870 "src-generated/ugbc.embed.tab.c"
1870 break;
1871
1872 case 21: /* target: VIC20 */
1873#line 199 "src/ugbc.embed.y"
1874 {
1875 #ifdef __vic20__
1876 (yyval.integer) = 1;
1877 #else
1878 (yyval.integer) = 0;
1879 #endif
1880 }
1881#line 1882 "src-generated/ugbc.embed.tab.c"
1882 break;
1883
1884 case 22: /* target: ZX */
1885#line 207 "src/ugbc.embed.y"
1886 {
1887 #ifdef __zx__
1888 (yyval.integer) = 1;
1889 #else
1890 (yyval.integer) = 0;
1891 #endif
1892 }
1893#line 1894 "src-generated/ugbc.embed.tab.c"
1894 break;
1895
1896 case 23: /* target: COLECO */
1897#line 215 "src/ugbc.embed.y"
1898 {
1899 #ifdef __coleco__
1900 (yyval.integer) = 1;
1901 #else
1902 (yyval.integer) = 0;
1903 #endif
1904 }
1905#line 1906 "src-generated/ugbc.embed.tab.c"
1906 break;
1907
1908 case 24: /* target: PCCGA */
1909#line 223 "src/ugbc.embed.y"
1910 {
1911 #ifdef __pccga__
1912 (yyval.integer) = 1;
1913 #else
1914 (yyval.integer) = 0;
1915 #endif
1916 }
1917#line 1918 "src-generated/ugbc.embed.tab.c"
1918 break;
1919
1920 case 25: /* target: SC3000 */
1921#line 231 "src/ugbc.embed.y"
1922 {
1923 #ifdef __sc3000__
1924 (yyval.integer) = 1;
1925 #else
1926 (yyval.integer) = 0;
1927 #endif
1928 }
1929#line 1930 "src-generated/ugbc.embed.tab.c"
1930 break;
1931
1932 case 26: /* target: SG1000 */
1933#line 239 "src/ugbc.embed.y"
1934 {
1935 #ifdef __sg1000__
1936 (yyval.integer) = 1;
1937 #else
1938 (yyval.integer) = 0;
1939 #endif
1940 }
1941#line 1942 "src-generated/ugbc.embed.tab.c"
1942 break;
1943
1944 case 27: /* target: MSX */
1945#line 247 "src/ugbc.embed.y"
1946 {
1947 #ifdef __msx1__
1948 (yyval.integer) = 1;
1949 #else
1950 (yyval.integer) = 0;
1951 #endif
1952 }
1953#line 1954 "src-generated/ugbc.embed.tab.c"
1954 break;
1955
1956 case 28: /* target: PC1403 */
1957#line 255 "src/ugbc.embed.y"
1958 {
1959 #ifdef __pc1403__
1960 (yyval.integer) = 1;
1961 #else
1962 (yyval.integer) = 0;
1963 #endif
1964 }
1965#line 1966 "src-generated/ugbc.embed.tab.c"
1966 break;
1967
1968 case 29: /* target: MSX1 */
1969#line 263 "src/ugbc.embed.y"
1970 {
1971 #ifdef __msx1__
1972 (yyval.integer) = 1;
1973 #else
1974 (yyval.integer) = 0;
1975 #endif
1976 }
1977#line 1978 "src-generated/ugbc.embed.tab.c"
1978 break;
1979
1980 case 30: /* target: COCO */
1981#line 271 "src/ugbc.embed.y"
1982 {
1983 #if defined(__coco__) || defined(__cocob__)
1984 (yyval.integer) = 1;
1985 #else
1986 (yyval.integer) = 0;
1987 #endif
1988 }
1989#line 1990 "src-generated/ugbc.embed.tab.c"
1990 break;
1991
1992 case 31: /* target: COCO1 */
1993#line 279 "src/ugbc.embed.y"
1994 {
1995 #if defined(__coco__) || defined(__cocob__)
1996 (yyval.integer) = 1;
1997 #else
1998 (yyval.integer) = 0;
1999 #endif
2000 }
2001#line 2002 "src-generated/ugbc.embed.tab.c"
2002 break;
2003
2004 case 32: /* target: COCO2 */
2005#line 287 "src/ugbc.embed.y"
2006 {
2007 #if defined(__coco__) || defined(__cocob__)
2008 (yyval.integer) = 1;
2009 #else
2010 (yyval.integer) = 0;
2011 #endif
2012 }
2013#line 2014 "src-generated/ugbc.embed.tab.c"
2014 break;
2015
2016 case 33: /* target: COCO3 */
2017#line 295 "src/ugbc.embed.y"
2018 {
2019 #if defined(__coco3__) || defined(__coco3b__)
2020 (yyval.integer) = 1;
2021 #else
2022 (yyval.integer) = 0;
2023 #endif
2024 }
2025#line 2026 "src-generated/ugbc.embed.tab.c"
2026 break;
2027
2028 case 34: /* target: DRAGON */
2029#line 303 "src/ugbc.embed.y"
2030 {
2031 #if defined(__d32__) || defined(__d64__) || defined(__d32b__) || defined(__d64b__)
2032 (yyval.integer) = 1;
2033 #else
2034 (yyval.integer) = 0;
2035 #endif
2036 }
2037#line 2038 "src-generated/ugbc.embed.tab.c"
2038 break;
2039
2040 case 35: /* target: DRAGON32 */
2041#line 311 "src/ugbc.embed.y"
2042 {
2043 #if defined(__d32__) || defined(__d32b__)
2044 (yyval.integer) = 1;
2045 #else
2046 (yyval.integer) = 0;
2047 #endif
2048 }
2049#line 2050 "src-generated/ugbc.embed.tab.c"
2050 break;
2051
2052 case 36: /* target: DRAGON64 */
2053#line 319 "src/ugbc.embed.y"
2054 {
2055 #if defined(__d64__) || defined(__d64b__)
2056 (yyval.integer) = 1;
2057 #else
2058 (yyval.integer) = 0;
2059 #endif
2060 }
2061#line 2062 "src-generated/ugbc.embed.tab.c"
2062 break;
2063
2064 case 37: /* target: PC128OP */
2065#line 327 "src/ugbc.embed.y"
2066 {
2067 #ifdef __pc128op__
2068 (yyval.integer) = 1;
2069 #else
2070 (yyval.integer) = 0;
2071 #endif
2072 }
2073#line 2074 "src-generated/ugbc.embed.tab.c"
2074 break;
2075
2076 case 38: /* target: TO8 */
2077#line 335 "src/ugbc.embed.y"
2078 {
2079 #ifdef __to8__
2080 (yyval.integer) = 1;
2081 #else
2082 (yyval.integer) = 0;
2083 #endif
2084 }
2085#line 2086 "src-generated/ugbc.embed.tab.c"
2086 break;
2087
2088 case 39: /* target: MO5 */
2089#line 343 "src/ugbc.embed.y"
2090 {
2091 #ifdef __mo5__
2092 (yyval.integer) = 1;
2093 #else
2094 (yyval.integer) = 0;
2095 #endif
2096 }
2097#line 2098 "src-generated/ugbc.embed.tab.c"
2098 break;
2099
2100 case 40: /* target: CPC */
2101#line 351 "src/ugbc.embed.y"
2102 {
2103 #ifdef __cpc__
2104 (yyval.integer) = 1;
2105 #else
2106 (yyval.integer) = 0;
2107 #endif
2108 }
2109#line 2110 "src-generated/ugbc.embed.tab.c"
2110 break;
2111
2112 case 41: /* target: VZ200 */
2113#line 359 "src/ugbc.embed.y"
2114 {
2115 #ifdef __vz200__
2116 (yyval.integer) = 1;
2117 #else
2118 (yyval.integer) = 0;
2119 #endif
2120 }
2121#line 2122 "src-generated/ugbc.embed.tab.c"
2122 break;
2123
2124 case 42: /* const_expr: const_factor */
2125#line 369 "src/ugbc.embed.y"
2126 {
2127 // printf( "const_factor = %d\n", $1 );
2128 }
2129#line 2130 "src-generated/ugbc.embed.tab.c"
2130 break;
2131
2132 case 43: /* const_expr: const_factor OP_AND const_expr */
2133#line 372 "src/ugbc.embed.y"
2134 {
2135 // printf( "%d AND %d\n", $1, $3 );
2136 (yyval.integer) = ( (yyvsp[-2].integer) && (yyvsp[0].integer) );
2137 }
2138#line 2139 "src-generated/ugbc.embed.tab.c"
2139 break;
2140
2141 case 44: /* const_expr: const_factor OP_OR const_expr */
2142#line 376 "src/ugbc.embed.y"
2143 {
2144 // printf( "%d OR %d\n", $1, $3 );
2145 (yyval.integer) = ( (yyvsp[-2].integer) || (yyvsp[0].integer) );
2146 }
2147#line 2148 "src-generated/ugbc.embed.tab.c"
2148 break;
2149
2150 case 45: /* const_expr: const_factor OP_EQUAL const_factor */
2151#line 380 "src/ugbc.embed.y"
2152 {
2153 // printf( "%d == %d\n", $1, $3 );
2154 (yyval.integer) = ( (yyvsp[-2].integer) == (yyvsp[0].integer) );
2155 }
2156#line 2157 "src-generated/ugbc.embed.tab.c"
2157 break;
2158
2159 case 46: /* const_expr: const_factor OP_DISEQUAL const_factor */
2160#line 384 "src/ugbc.embed.y"
2161 {
2162 // printf( "%d != %d\n", $1, $3 );
2163 (yyval.integer) = ( (yyvsp[-2].integer) != (yyvsp[0].integer) );
2164 }
2165#line 2166 "src-generated/ugbc.embed.tab.c"
2166 break;
2167
2168 case 47: /* const_expr: const_factor OP_LT const_factor */
2169#line 388 "src/ugbc.embed.y"
2170 {
2171 // printf( "%d != %d\n", $1, $3 );
2172 (yyval.integer) = ( (yyvsp[-2].integer) < (yyvsp[0].integer) );
2173 }
2174#line 2175 "src-generated/ugbc.embed.tab.c"
2175 break;
2176
2177 case 48: /* const_expr: const_factor OP_LTE const_factor */
2178#line 392 "src/ugbc.embed.y"
2179 {
2180 // printf( "%d != %d\n", $1, $3 );
2181 (yyval.integer) = ( (yyvsp[-2].integer) <= (yyvsp[0].integer) );
2182 }
2183#line 2184 "src-generated/ugbc.embed.tab.c"
2184 break;
2185
2186 case 49: /* const_expr: const_factor OP_GT const_factor */
2187#line 396 "src/ugbc.embed.y"
2188 {
2189 // printf( "%d != %d\n", $1, $3 );
2190 (yyval.integer) = ( (yyvsp[-2].integer) > (yyvsp[0].integer) );
2191 }
2192#line 2193 "src-generated/ugbc.embed.tab.c"
2193 break;
2194
2195 case 50: /* const_expr: const_factor OP_GTE const_factor */
2196#line 400 "src/ugbc.embed.y"
2197 {
2198 // printf( "%d != %d\n", $1, $3 );
2199 (yyval.integer) = ( (yyvsp[-2].integer) >= (yyvsp[0].integer) );
2200 }
2201#line 2202 "src-generated/ugbc.embed.tab.c"
2202 break;
2203
2204 case 51: /* const_factor: Integer */
2205#line 407 "src/ugbc.embed.y"
2206 {
2207 // printf( "# %d\n", $1 );
2208 (yyval.integer) = (yyvsp[0].integer);
2209 }
2210#line 2211 "src-generated/ugbc.embed.tab.c"
2211 break;
2212
2213 case 52: /* const_factor: target */
2214#line 411 "src/ugbc.embed.y"
2215 {
2216 // printf( "(%d)\n", $2 );
2217 (yyval.integer) = (yyvsp[0].integer);
2218 }
2219#line 2220 "src-generated/ugbc.embed.tab.c"
2220 break;
2221
2222 case 53: /* const_factor: output */
2223#line 415 "src/ugbc.embed.y"
2224 {
2225 // printf( "output = (%d)\n", $1 );
2226 (yyval.integer) = (yyvsp[0].integer);
2227 }
2228#line 2229 "src-generated/ugbc.embed.tab.c"
2229 break;
2230
2231 case 54: /* const_factor: OP const_expr CP */
2232#line 419 "src/ugbc.embed.y"
2233 {
2234 // printf( "(%d)\n", $2 );
2235 (yyval.integer) = (yyvsp[-1].integer);
2236 }
2237#line 2238 "src-generated/ugbc.embed.tab.c"
2238 break;
2239
2240 case 55: /* const_factor: OP_NOT const_factor */
2241#line 423 "src/ugbc.embed.y"
2242 {
2243 // printf( "NOT %d\n", $2 );
2244 (yyval.integer) = ( ! (yyvsp[0].integer) );
2245 }
2246#line 2247 "src-generated/ugbc.embed.tab.c"
2247 break;
2248
2249 case 56: /* const_factor: Identifier OP_POINT Identifier OP_POINT Identifier */
2250#line 427 "src/ugbc.embed.y"
2251 {
2252
2253 int valued = 0;
2254 int value = 0;
2255 char * p1 = (yyvsp[-4].string);
2256 char * p3 = (yyvsp[-2].string);
2257 char * p5 = (yyvsp[0].string);
2258 configure_get_value( gmc, slot );
2259 configure_get_value( sn76489, address );
2260 if ( valued ) {
2261 // printf( "%s.%s.%s = %d\n", p1, p3, p5, value );
2262 (yyval.integer) = value;
2263 } else {
2264 // printf( "%s.%s.%s = 0 (unvalued)\n", p1, p3, p5 );
2265 (yyval.integer) = 0;
2266 }
2267 // printf( "%s.%s == %d\n", $1, $3, $$ );
2268 }
2269#line 2270 "src-generated/ugbc.embed.tab.c"
2270 break;
2271
2272 case 57: /* const_factor: Identifier OP_POINT Identifier */
2273#line 445 "src/ugbc.embed.y"
2274 {
2275 if ( strcmp( (yyvsp[-2].string), "vestigialConfig" ) == 0 ) {
2276 if ( strcmp( (yyvsp[0].string), "screenModeUnique" ) == 0 ) {
2277 (yyval.integer) = ((struct _Environment *)_environment)->vestigialConfig.screenModeUnique && ( count_screen_mode_selected( _environment ) < 2 );
2278 } else if ( strcmp( (yyvsp[0].string), "doubleBufferSelected" ) == 0 ) {
2279 (yyval.integer) = ((struct _Environment *)_environment)->vestigialConfig.doubleBufferSelected;
2280 } else if ( strcmp( (yyvsp[0].string), "doubleBuffer" ) == 0 ) {
2281 (yyval.integer) = ( ((struct _Environment *)_environment)->vestigialConfig.doubleBuffer ) || ( ((struct _Environment *)_environment)->doubleBufferEnabled );
2282 } else if ( strcmp( (yyvsp[0].string), "palettePreserve" ) == 0 ) {
2283 (yyval.integer) = ((struct _Environment *)_environment)->vestigialConfig.palettePreserve;
2284 } else if ( strcmp( (yyvsp[0].string), "rchack_acme_1172" ) == 0 ) {
2285 (yyval.integer) = ((struct _Environment *)_environment)->vestigialConfig.rchack_acme_1172;
2286 } else if ( strcmp( (yyvsp[0].string), "rchack_cocon_1163" ) == 0 ) {
2287 (yyval.integer) = ((struct _Environment *)_environment)->vestigialConfig.rchack_cocon_1163;
2288 } else if ( strcmp( (yyvsp[0].string), "rchack_pick_the_star_1163" ) == 0 ) {
2289 (yyval.integer) = ((struct _Environment *)_environment)->vestigialConfig.rchack_pick_the_star_1163;
2290 } else if ( strcmp( (yyvsp[0].string), "rchack_4gravity_1163" ) == 0 ) {
2291 (yyval.integer) = ((struct _Environment *)_environment)->vestigialConfig.rchack_4gravity_1163;
2292 } else if ( strcmp( (yyvsp[0].string), "rchack_4gravity_1164" ) == 0 ) {
2293 (yyval.integer) = ((struct _Environment *)_environment)->vestigialConfig.rchack_4gravity_1164;
2294 } else if ( strcmp( (yyvsp[0].string), "clsImplicit" ) == 0 ) {
2295 (yyval.integer) = ((struct _Environment *)_environment)->vestigialConfig.clsImplicit;
2296 } else {
2297 (yyval.integer) = 0;
2298 }
2299 } else if ( strcmp( (yyvsp[-2].string), "bankAccessOptimization" ) == 0 ) {
2300 if ( strcmp( (yyvsp[0].string), "read1" ) == 0 ) {
2301 (yyval.integer) = ((struct _Environment *)_environment)->bankAccessOptimization.read1;
2302 } else if ( strcmp( (yyvsp[0].string), "read2" ) == 0 ) {
2303 (yyval.integer) = ((struct _Environment *)_environment)->bankAccessOptimization.read2;
2304 } else if ( strcmp( (yyvsp[0].string), "read4" ) == 0 ) {
2305 (yyval.integer) = ((struct _Environment *)_environment)->bankAccessOptimization.read4;
2306 } else if ( strcmp( (yyvsp[0].string), "readn" ) == 0 ) {
2307 (yyval.integer) = ((struct _Environment *)_environment)->bankAccessOptimization.readn;
2308 } else if ( strcmp( (yyvsp[0].string), "write1" ) == 0 ) {
2309 (yyval.integer) = ((struct _Environment *)_environment)->bankAccessOptimization.read1;
2310 } else if ( strcmp( (yyvsp[0].string), "write2" ) == 0 ) {
2311 (yyval.integer) = ((struct _Environment *)_environment)->bankAccessOptimization.read2;
2312 } else if ( strcmp( (yyvsp[0].string), "write4" ) == 0 ) {
2313 (yyval.integer) = ((struct _Environment *)_environment)->bankAccessOptimization.read4;
2314 } else if ( strcmp( (yyvsp[0].string), "writen" ) == 0 ) {
2315 (yyval.integer) = ((struct _Environment *)_environment)->bankAccessOptimization.readn;
2316 } else {
2317 (yyval.integer) = 0;
2318 }
2319 } else if ( strcmp( (yyvsp[-2].string), "fontConfig" ) == 0 ) {
2320 if ( strcmp( (yyvsp[0].string), "schema" ) == 0 ) {
2321 (yyval.integer) = ((struct _Environment *)_environment)->fontConfig.schema;
2322 } else {
2323 (yyval.integer) = 0;
2324 }
2325 } else if ( strcmp( (yyvsp[-2].string), "numberConfig" ) == 0 ) {
2326 if ( strcmp( (yyvsp[0].string), "maxBytes" ) == 0 ) {
2327 (yyval.integer) = ((struct _Environment *)_environment)->numberConfig.maxBytes;
2328 } else if ( strcmp( (yyvsp[0].string), "maxDigits" ) == 0 ) {
2329 (yyval.integer) = ((struct _Environment *)_environment)->numberConfig.maxDigits;
2330 } else {
2331 (yyval.integer) = 0;
2332 }
2333 } else if ( strcmp( (yyvsp[-2].string), "joystickConfig" ) == 0 ) {
2334 if ( strcmp( (yyvsp[0].string), "retries" ) == 0 ) {
2335 (yyval.integer) = ((struct _Environment *)_environment)->joystickConfig.retries;
2336 } else if ( strcmp( (yyvsp[0].string), "values" ) == 0 ) {
2337 (yyval.integer) = ((struct _Environment *)_environment)->joystickConfig.values;
2338 } else if ( strcmp( (yyvsp[0].string), "sync" ) == 0 ) {
2339 (yyval.integer) = ((struct _Environment *)_environment)->joystickConfig.sync;
2340 } else {
2341 (yyval.integer) = 0;
2342 }
2343 } else if ( strcmp( (yyvsp[-2].string), "keyboardConfig" ) == 0 ) {
2344 if ( strcmp( (yyvsp[0].string), "latency" ) == 0 ) {
2345 (yyval.integer) = ((struct _Environment *)_environment)->keyboardConfig.latency;
2346 } else if ( strcmp( (yyvsp[0].string), "delay" ) == 0 ) {
2347 (yyval.integer) = ((struct _Environment *)_environment)->keyboardConfig.delay;
2348 } else if ( strcmp( (yyvsp[0].string), "release" ) == 0 ) {
2349 (yyval.integer) = ((struct _Environment *)_environment)->keyboardConfig.release;
2350 } else if ( strcmp( (yyvsp[0].string), "sync" ) == 0 ) {
2351 (yyval.integer) = ((struct _Environment *)_environment)->keyboardConfig.sync;
2352 } else {
2353 (yyval.integer) = 0;
2354 }
2355 } else if ( strcmp( (yyvsp[-2].string), "multiplexingSpriteConfig" ) == 0 ) {
2356 if ( strcmp( (yyvsp[0].string), "async" ) == 0 ) {
2357 (yyval.integer) = ((struct _Environment *)_environment)->multiplexingSpriteConfig.async;
2358 } else {
2359 (yyval.integer) = 0;
2360 }
2361 } else if ( strcmp( (yyvsp[-2].string), "descriptors" ) == 0 ) {
2362 if ( ((struct _Environment *)_environment)->descriptors ) {
2363 if ( strcmp( (yyvsp[0].string), "firstFree" ) == 0 ) {
2364 (yyval.integer) = ((struct _Environment *)_environment)->descriptors->firstFree;
2365 } else {
2366 (yyval.integer) = 0;
2367 }
2368 } else {
2369 (yyval.integer) = 0;
2370 }
2371 } else if ( strcmp( (yyvsp[-2].string), "deployed" ) == 0 ) {
2372 if ( strcmp( (yyvsp[0].string), "dload" ) == 0 ) {
2373 (yyval.integer) = ((struct _Environment *)_environment)->deployed.dload;
2374 } else if ( strcmp( (yyvsp[0].string), "dsave" ) == 0 ) {
2375 (yyval.integer) = ((struct _Environment *)_environment)->deployed.dsave;
2376 } else if ( strcmp( (yyvsp[0].string), "dcommon" ) == 0 ) {
2377 (yyval.integer) = ((struct _Environment *)_environment)->deployed.dcommon;
2378 } else if ( strcmp( (yyvsp[0].string), "msprites" ) == 0 ) {
2379 (yyval.integer) = ((struct _Environment *)_environment)->deployed.msprite;
2380 } else if ( strcmp( (yyvsp[0].string), "flash" ) == 0 ) {
2381 (yyval.integer) = ((struct _Environment *)_environment)->deployed.flash;
2382 } else if ( strcmp( (yyvsp[0].string), "timer" ) == 0 ) {
2383 (yyval.integer) = ((struct _Environment *)_environment)->deployed.timer;
2384 } else if ( strcmp( (yyvsp[0].string), "music" ) == 0 ) {
2385 (yyval.integer) = ((struct _Environment *)_environment)->deployed.music;
2386 } else if ( strcmp( (yyvsp[0].string), "sidstartup" ) == 0 ) {
2387 (yyval.integer) = ((struct _Environment *)_environment)->deployed.sidstartup;
2388 } else if ( strcmp( (yyvsp[0].string), "sidplayer" ) == 0 ) {
2389 (yyval.integer) = ((struct _Environment *)_environment)->deployed.sidplayer;
2390 } else if ( strcmp( (yyvsp[0].string), "pokeystartup" ) == 0 ) {
2391 (yyval.integer) = ((struct _Environment *)_environment)->deployed.pokeystartup;
2392 } else if ( strcmp( (yyvsp[0].string), "ay8910startup" ) == 0 ) {
2393 (yyval.integer) = ((struct _Environment *)_environment)->deployed.ay8910startup;
2394 } else if ( strcmp( (yyvsp[0].string), "sn76489startup" ) == 0 ) {
2395 (yyval.integer) = ((struct _Environment *)_environment)->deployed.sn76489startup;
2396 } else if ( strcmp( (yyvsp[0].string), "sn76489mstartup" ) == 0 ) {
2397 (yyval.integer) = ((struct _Environment *)_environment)->deployed.sn76489startup;
2398 } else if ( strcmp( (yyvsp[0].string), "sn76489zstartup" ) == 0 ) {
2399 (yyval.integer) = ((struct _Environment *)_environment)->deployed.sn76489startup;
2400 } else if ( strcmp( (yyvsp[0].string), "keyboard" ) == 0 ) {
2401 (yyval.integer) = ((struct _Environment *)_environment)->deployed.keyboard;
2402 } else if ( strcmp( (yyvsp[0].string), "scancode" ) == 0 ) {
2403 (yyval.integer) = ((struct _Environment *)_environment)->deployed.scancode;
2404 } else if ( strcmp( (yyvsp[0].string), "serial" ) == 0 ) {
2405 (yyval.integer) = ((struct _Environment *)_environment)->deployed.serial;
2406 } else if ( strcmp( (yyvsp[0].string), "fade" ) == 0 ) {
2407 (yyval.integer) = ((struct _Environment *)_environment)->deployed.fade;
2408 } else if ( strcmp( (yyvsp[0].string), "joystick" ) == 0 ) {
2409 (yyval.integer) = ((struct _Environment *)_environment)->deployed.joystick;
2410 } else if ( strcmp( (yyvsp[0].string), "fp" ) == 0 ) {
2411 (yyval.integer) = ((struct _Environment *)_environment)->deployed.fp_vars;
2412 } else {
2413 (yyval.integer) = 0;
2414 }
2415 } else {
2416 (yyval.integer) = 0;
2417 }
2418 // printf( "%s.%s == %d\n", $1, $3, $$ );
2419 }
2420#line 2421 "src-generated/ugbc.embed.tab.c"
2421 break;
2422
2423 case 58: /* const_factor: Identifier */
2424#line 591 "src/ugbc.embed.y"
2425 {
2426 // printf( "*%s*\n", $1 );
2427
2428 if ( strcmp( (yyvsp[0].string), "expansionBanks" ) == 0 ) {
2429 (yyval.integer) = ((struct _Environment *)_environment)->expansionBanks ? 1 : 0;
2430 } else if ( strcmp( (yyvsp[0].string), "tenLinerRulesEnforced" ) == 0 ) {
2431 (yyval.integer) = ((struct _Environment *)_environment)->tenLinerRulesEnforced;
2432 } else if ( strcmp( (yyvsp[0].string), "currentMode" ) == 0 ) {
2433 (yyval.integer) = ((struct _Environment *)_environment)->currentMode;
2434 } else if ( strcmp( (yyvsp[0].string), "outputFileType" ) == 0 ) {
2435 (yyval.integer) = ((struct _Environment *)_environment)->outputFileType;
2436 } else if ( strcmp( (yyvsp[0].string), "residentDetectionEnabled" ) == 0 ) {
2437 (yyval.integer) = ((struct _Environment *)_environment)->residentDetectionEnabled;
2438 } else if ( strcmp( (yyvsp[0].string), "keyboardFullSupport" ) == 0 ) {
2439 (yyval.integer) = ((struct _Environment *)_environment)->keyboardFullSupport;
2440 } else if ( strcmp( (yyvsp[0].string), "transparencyUsed" ) == 0 ) {
2441 (yyval.integer) = ((struct _Environment *)_environment)->transparencyUsed;
2442 } else if ( strcmp( (yyvsp[0].string), "transparencyCoarse" ) == 0 ) {
2443 (yyval.integer) = ((struct _Environment *)_environment)->transparencyCoarse;
2444 } else if ( strcmp( (yyvsp[0].string), "printSafe" ) == 0 ) {
2445 (yyval.integer) = ((struct _Environment *)_environment)->printSafe;
2446 } else if ( strcmp( (yyvsp[0].string), "putImageSafe" ) == 0 ) {
2447 (yyval.integer) = ((struct _Environment *)_environment)->putImageSafe;
2448 } else if ( strcmp( (yyvsp[0].string), "getImageSafe" ) == 0 ) {
2449 (yyval.integer) = ((struct _Environment *)_environment)->getImageSafe;
2450 } else if ( strcmp( (yyvsp[0].string), "stackStartAddress" ) == 0 ) {
2451 (yyval.integer) = ((struct _Environment *)_environment)->stackStartAddress;
2452 } else if ( strcmp( (yyvsp[0].string), "stackSize" ) == 0 ) {
2453 (yyval.integer) = ((struct _Environment *)_environment)->stackSize;
2454 } else if ( strcmp( (yyvsp[0].string), "dynamicConsole" ) == 0 ) {
2455 (yyval.integer) = ((struct _Environment *)_environment)->dynamicConsole;
2456 } else if ( strcmp( (yyvsp[0].string), "horizontalScrollOff" ) == 0 ) {
2457 (yyval.integer) = ((struct _Environment *)_environment)->horizontalScrollOff;
2458 } else if ( strcmp( (yyvsp[0].string), "descriptors" ) == 0 ) {
2459 if ( ((struct _Environment *)_environment)->descriptors ) {
2460 (yyval.integer) = 1;
2461 } else {
2462 (yyval.integer) = 0;
2463 }
2464 } else if ( strcmp( (yyvsp[0].string), "dataSegment" ) == 0 ) {
2465 // printf( "dataSegment = %p\n", ((struct _Environment *)_environment)->dataSegment );
2466 if ( ((struct _Environment *)_environment)->dataSegment ) {
2467 (yyval.integer) = 1;
2468 } else {
2469 (yyval.integer) = 0;
2470 }
2471 } else if ( strcmp( (yyvsp[0].string), "lmarginAtariBasicEnabled" ) == 0 ) {
2472 if ( ((struct _Environment *)_environment)->lmarginAtariBasicEnabled ) {
2473 (yyval.integer) = 1;
2474 } else {
2475 (yyval.integer) = 0;
2476 }
2477 } else if ( strcmp( (yyvsp[0].string), "optionClip" ) == 0 ) {
2478 if ( ((struct _Environment *)_environment)->optionClip ) {
2479 (yyval.integer) = 1;
2480 } else {
2481 (yyval.integer) = 0;
2482 }
2483 } else if ( strcmp( (yyvsp[0].string), "sysCallUsed" ) == 0 ) {
2484 if ( ((struct _Environment *)_environment)->sysCallUsed ) {
2485 (yyval.integer) = 1;
2486 } else {
2487 (yyval.integer) = 0;
2488 }
2489 } else if ( strcmp( (yyvsp[0].string), "enableRle" ) == 0 ) {
2490 if ( ((struct _Environment *)_environment)->enableRle ) {
2491 (yyval.integer) = 1;
2492 } else {
2493 (yyval.integer) = 0;
2494 }
2495 } else if ( strcmp( (yyvsp[0].string), "verticalOverlapRequired" ) == 0 ) {
2496 if ( ((struct _Environment *)_environment)->verticalOverlapRequired ) {
2497 (yyval.integer) = 1;
2498 } else {
2499 (yyval.integer) = 0;
2500 }
2501 } else if ( strcmp( (yyvsp[0].string), "horizontalOverlapRequired" ) == 0 ) {
2502 if ( ((struct _Environment *)_environment)->horizontalOverlapRequired ) {
2503 (yyval.integer) = 1;
2504 } else {
2505 (yyval.integer) = 0;
2506 }
2507 } else if ( strcmp( (yyvsp[0].string), "clsSlow" ) == 0 ) {
2508 (yyval.integer) = ((struct _Environment *)_environment)->clsSlow;
2509 } else if ( strcmp( (yyvsp[0].string), "scaleX" ) == 0 ) {
2510 (yyval.integer) = ((struct _Environment *)_environment)->scaleX;
2511 } else if ( strcmp( (yyvsp[0].string), "scaleY" ) == 0 ) {
2512 (yyval.integer) = ((struct _Environment *)_environment)->scaleY;
2513 } else if ( strcmp( (yyvsp[0].string), "offsetX" ) == 0 ) {
2514 (yyval.integer) = ((struct _Environment *)_environment)->offsetX;
2515 } else if ( strcmp( (yyvsp[0].string), "offsetY" ) == 0 ) {
2516 (yyval.integer) = ((struct _Environment *)_environment)->offsetY;
2517 } else if ( strcmp( (yyvsp[0].string), "copperList" ) == 0 ) {
2518 (yyval.integer) = ( ((struct _Environment *)_environment)->copperList != NULL ) ? 1 : 0;
2519 } else {
2520 (yyval.integer) = 0;
2521 }
2522 // printf( "%s == %d\n", $1, $$ );
2523 }
2524#line 2525 "src-generated/ugbc.embed.tab.c"
2525 break;
2526
2527 case 59: /* macro_parameter: Identifier */
2528#line 693 "src/ugbc.embed.y"
2529 {
2530 Macro * currentMacro = ((struct _Environment *)_environment)->embedResult.currentMacro;
2531 if ( currentMacro ) {
2532 currentMacro->parameters[currentMacro->parameterCount++] = strdup( (yyvsp[0].string) );
2533 if ( currentMacro->parameterCount == MAX_TEMPORARY_STORAGE ) {
2534 CRITICAL_MACRO_TOO_MUCH_PARAMETERS( currentMacro->name, (yyvsp[0].string) );
2535 }
2536 }
2537 }
2538#line 2539 "src-generated/ugbc.embed.tab.c"
2539 break;
2540
2541 case 63: /* macro_value: Value */
2542#line 708 "src/ugbc.embed.y"
2543 {
2544 ((struct _Environment *)_environment)->embedResult.values[((struct _Environment *)_environment)->embedResult.valueCount++] = strdup( (yyvsp[0].string) );
2545 if ( ((struct _Environment *)_environment)->embedResult.valueCount == MAX_TEMPORARY_STORAGE ) {
2546 CRITICAL_MACRO_TOO_MUCH_VALUES( ((struct _Environment *)_environment)->embedResult.currentMacro->name, (yyvsp[0].string) );
2547 }
2548 }
2549#line 2550 "src-generated/ugbc.embed.tab.c"
2550 break;
2551
2552 case 67: /* embed2: OP_AT IF const_expr */
2553#line 720 "src/ugbc.embed.y"
2554 {
2555 // printf( "--- IF ---\n" );
2556
2557 ((struct _Environment *)_environment)->embedResult.conditional = 1;
2558 if ( (yyvsp[0].integer) ) {
2559 ((struct _Environment *)_environment)->embedResult.excluded[((struct _Environment *)_environment)->embedResult.current] = 0;
2560 } else {
2561 ((struct _Environment *)_environment)->embedResult.excluded[((struct _Environment *)_environment)->embedResult.current] = 1;
2562 }
2563 ++((struct _Environment *)_environment)->embedResult.current;
2564 }
2565#line 2566 "src-generated/ugbc.embed.tab.c"
2566 break;
2567
2568 case 68: /* embed2: OP_AT ELSE */
2569#line 731 "src/ugbc.embed.y"
2570 {
2571 ((struct _Environment *)_environment)->embedResult.conditional = 1;
2572 if ( ((struct _Environment *)_environment)->embedResult.excluded[((struct _Environment *)_environment)->embedResult.current-1] ) {
2573 ((struct _Environment *)_environment)->embedResult.excluded[((struct _Environment *)_environment)->embedResult.current-1] = 0;
2574 } else {
2575 ((struct _Environment *)_environment)->embedResult.excluded[((struct _Environment *)_environment)->embedResult.current-1] = 1;
2576 }
2577 }
2578#line 2579 "src-generated/ugbc.embed.tab.c"
2579 break;
2580
2581 case 69: /* embed2: OP_AT ELSE IF const_expr */
2582#line 739 "src/ugbc.embed.y"
2583 {
2584 ((struct _Environment *)_environment)->embedResult.conditional = 1;
2585 if ( ((struct _Environment *)_environment)->embedResult.excluded[((struct _Environment *)_environment)->embedResult.current-1] ) {
2586 if ( (yyvsp[0].integer) ) {
2587 ((struct _Environment *)_environment)->embedResult.excluded[((struct _Environment *)_environment)->embedResult.current-1] = 0;
2588 } else {
2589 ((struct _Environment *)_environment)->embedResult.excluded[((struct _Environment *)_environment)->embedResult.current-1] = 1;
2590 }
2591 }
2592 }
2593#line 2594 "src-generated/ugbc.embed.tab.c"
2594 break;
2595
2596 case 70: /* embed2: OP_AT ELSEIF const_expr */
2597#line 749 "src/ugbc.embed.y"
2598 {
2599 ((struct _Environment *)_environment)->embedResult.conditional = 1;
2600 if ( ((struct _Environment *)_environment)->embedResult.excluded[((struct _Environment *)_environment)->embedResult.current-1] ) {
2601 if ( (yyvsp[0].integer) ) {
2602 ((struct _Environment *)_environment)->embedResult.excluded[((struct _Environment *)_environment)->embedResult.current-1] = 0;
2603 } else {
2604 ((struct _Environment *)_environment)->embedResult.excluded[((struct _Environment *)_environment)->embedResult.current-1] = 1;
2605 }
2606 }
2607 }
2608#line 2609 "src-generated/ugbc.embed.tab.c"
2609 break;
2610
2611 case 71: /* embed2: OP_AT ENDIF */
2612#line 759 "src/ugbc.embed.y"
2613 {
2614 ((struct _Environment *)_environment)->embedResult.conditional = 1;
2615 ((struct _Environment *)_environment)->embedResult.excluded[((struct _Environment *)_environment)->embedResult.current-1] = 0;
2616 --((struct _Environment *)_environment)->embedResult.current;
2617 }
2618#line 2619 "src-generated/ugbc.embed.tab.c"
2619 break;
2620
2621 case 72: /* embed2: OP_AT EMIT Identifier OP_POINT Identifier OP_POINT Identifier AS Identifier */
2622#line 764 "src/ugbc.embed.y"
2623 {
2624
2625 int i;
2626 for( i=0; i<((struct _Environment *)_environment)->embedResult.current; ++i ) {\
2627 if ( ((struct _Environment *)_environment)->embedResult.excluded[i] )
2628 break;
2629 }
2630
2631 if ( i>=((struct _Environment *)_environment)->embedResult.current ) {
2632 int valued = 0;
2633 int value = 0;
2634 char * p1 = (yyvsp[-6].string);
2635 char * p3 = (yyvsp[-4].string);
2636 char * p5 = (yyvsp[-2].string);
2637 configure_get_value( gmc, slot );
2638 configure_get_value( sn76489, address );
2639 vars_emit_constant_integer( _environment, (yyvsp[0].string), value );
2640 ((struct _Environment *)_environment)->embedResult.conditional = 1;
2641 }
2642 }
2643#line 2644 "src-generated/ugbc.embed.tab.c"
2644 break;
2645
2646 case 73: /* embed2: OP_AT EMIT Identifier OP_POINT Identifier AS Identifier */
2647#line 784 "src/ugbc.embed.y"
2648 {
2649
2650 if ( strcmp( (yyvsp[-4].string), "joystickConfig" ) == 0 ) {
2651 if ( strcmp( (yyvsp[-2].string), "retries" ) == 0 ) {
2652 vars_emit_constant_integer( _environment, (yyvsp[0].string), ((struct _Environment *)_environment)->joystickConfig.retries );
2653 } else if ( strcmp( (yyvsp[-2].string), "values" ) == 0 ) {
2654 vars_emit_constant_integer( _environment, (yyvsp[0].string), ((struct _Environment *)_environment)->joystickConfig.values );
2655 }
2656 } else if ( strcmp( (yyvsp[-4].string), "keyboardConfig" ) == 0 ) {
2657 if ( strcmp( (yyvsp[-2].string), "latency" ) == 0 ) {
2658 vars_emit_constant_integer( _environment, (yyvsp[0].string), ((struct _Environment *)_environment)->keyboardConfig.latency );
2659 } else if ( strcmp( (yyvsp[-2].string), "delay" ) == 0 ) {
2660 vars_emit_constant_integer( _environment, (yyvsp[0].string), ((struct _Environment *)_environment)->keyboardConfig.delay );
2661 } else if ( strcmp( (yyvsp[-2].string), "release" ) == 0 ) {
2662 vars_emit_constant_integer( _environment, (yyvsp[0].string), ((struct _Environment *)_environment)->keyboardConfig.release );
2663 }
2664 } else if ( strcmp( (yyvsp[-4].string), "numberConfig" ) == 0 ) {
2665 if ( strcmp( (yyvsp[-2].string), "maxBytes" ) == 0 ) {
2666 vars_emit_constant_integer( _environment, (yyvsp[0].string), ((struct _Environment *)_environment)->numberConfig.maxBytes );
2667 } else if ( strcmp( (yyvsp[-2].string), "maxDigits" ) == 0 ) {
2668 vars_emit_constant_integer( _environment, (yyvsp[0].string), ((struct _Environment *)_environment)->numberConfig.maxDigits );
2669 }
2670 } else if ( strcmp( (yyvsp[-4].string), "descriptors" ) == 0 ) {
2671 if ( ((struct _Environment *)_environment)->descriptors ) {
2672 if ( strcmp( (yyvsp[-2].string), "firstFree" ) == 0 ) {
2673 vars_emit_constant_integer( _environment, (yyvsp[0].string), ((struct _Environment *)_environment)->descriptors->firstFree );
2674 }
2675 }
2676 }
2677
2678 ((struct _Environment *)_environment)->embedResult.conditional = 1;
2679 }
2680#line 2681 "src-generated/ugbc.embed.tab.c"
2681 break;
2682
2683 case 74: /* embed2: OP_AT EMIT Identifier AS Identifier */
2684#line 816 "src/ugbc.embed.y"
2685 {
2686 if ( strcmp( (yyvsp[-2].string), "frameBufferStart" ) == 0 ) {
2687 vars_emit_constant_integer( _environment, (yyvsp[0].string), ((struct _Environment *)_environment)->frameBufferStart );
2688 } else if ( strcmp( (yyvsp[-2].string), "frameBufferStart2" ) == 0 ) {
2689 vars_emit_constant_integer( _environment, (yyvsp[0].string), ((struct _Environment *)_environment)->frameBufferStart2 );
2690 } else if ( strcmp( (yyvsp[-2].string), "waitSpriteUpdateFlag" ) == 0 ) {
2691 if ( ((struct _Environment *)_environment)->multiplexingSpriteConfig.async ) {
2692 vars_emit_constant_integer( _environment, (yyvsp[0].string), 0 );
2693 } else {
2694 vars_emit_constant_integer( _environment, (yyvsp[0].string), 0xff );
2695 }
2696 } else if ( strcmp( (yyvsp[-2].string), "horizontalScrollOff" ) == 0 ) {
2697 vars_emit_constant_integer( _environment, (yyvsp[0].string), ((struct _Environment *)_environment)->horizontalScrollOff );
2698 } else if ( strcmp( (yyvsp[-2].string), "scaleX" ) == 0 ) {
2699 vars_emit_constant_integer( _environment, (yyvsp[0].string), ((struct _Environment *)_environment)->scaleX );
2700 } else if ( strcmp( (yyvsp[-2].string), "stackSize" ) == 0 ) {
2701 vars_emit_constant_integer( _environment, (yyvsp[0].string), ((struct _Environment *)_environment)->stackSize );
2702 } else if ( strcmp( (yyvsp[-2].string), "stackStartAddress" ) == 0 ) {
2703 vars_emit_constant_integer( _environment, (yyvsp[0].string), ((struct _Environment *)_environment)->stackStartAddress );
2704 } else if ( strcmp( (yyvsp[-2].string), "scaleY" ) == 0 ) {
2705 vars_emit_constant_integer( _environment, (yyvsp[0].string), ((struct _Environment *)_environment)->scaleY );
2706 } else if ( strcmp( (yyvsp[-2].string), "offsetX" ) == 0 ) {
2707 vars_emit_constant_integer( _environment, (yyvsp[0].string), ((struct _Environment *)_environment)->offsetX );
2708 } else if ( strcmp( (yyvsp[-2].string), "offsetY" ) == 0 ) {
2709 vars_emit_constant_integer( _environment, (yyvsp[0].string), ((struct _Environment *)_environment)->offsetY );
2710 }
2711 ((struct _Environment *)_environment)->embedResult.conditional = 1;
2712 }
2713#line 2714 "src-generated/ugbc.embed.tab.c"
2714 break;
2715
2716 case 75: /* $@1: %empty */
2717#line 845 "src/ugbc.embed.y"
2718 {
2719
2720 int i;
2721 for( i=0; i<((struct _Environment *)_environment)->embedResult.current; ++i ) {
2722 if ( ((struct _Environment *)_environment)->embedResult.excluded[i] )
2723 break;
2724 }
2725 if ( i>= ((struct _Environment *)_environment)->embedResult.current ) {
2726 // printf( "%d @MACRO %s\n", ((struct _Environment *)_environment)->embedResult.current, $3 );
2727
2728 ((struct _Environment *)_environment)->embedResult.currentMacro = malloc( sizeof( Macro ) );
2729 memset( ((struct _Environment *)_environment)->embedResult.currentMacro, 0, sizeof( Macro ) );
2730 Macro * currentMacro = ((struct _Environment *)_environment)->embedResult.currentMacro;
2731 currentMacro->name = strdup( (yyvsp[0].string) );
2732 }
2733 }
2734#line 2735 "src-generated/ugbc.embed.tab.c"
2735 break;
2736
2737 case 76: /* embed2: OP_AT MACRO Identifier $@1 macro_parameters */
2738#line 860 "src/ugbc.embed.y"
2739 {
2740 ((struct _Environment *)_environment)->embedResult.conditional = 1;
2741 }
2742#line 2743 "src-generated/ugbc.embed.tab.c"
2743 break;
2744
2745 case 77: /* embed2: OP_AT ENDMACRO */
2746#line 864 "src/ugbc.embed.y"
2747 {
2748 // printf( "@ENDMACRO\n" );
2749
2750 Macro * currentMacro = ((struct _Environment *)_environment)->embedResult.currentMacro;
2751 if ( currentMacro ) {
2752 Macro * macro = ((struct _Environment *)_environment)->embedResult.macro;
2753 currentMacro->next = macro;
2754 ((struct _Environment *)_environment)->embedResult.macro = currentMacro;
2755 ((struct _Environment *)_environment)->embedResult.currentMacro = NULL;
2756 }
2757 ((struct _Environment *)_environment)->embedResult.conditional = 1;
2758 }
2759#line 2760 "src-generated/ugbc.embed.tab.c"
2760 break;
2761
2762 case 78: /* embed2: Content */
2763#line 876 "src/ugbc.embed.y"
2764 {
2765 // printf( " MACRO CONTENT = %s\n", $1 );
2766
2767 Macro * currentMacro = ((struct _Environment *)_environment)->embedResult.currentMacro;
2768 if ( currentMacro ) {
2769 currentMacro->lines[currentMacro->lineCount++] = strdup( (yyvsp[0].string) );
2770 if ( currentMacro->lineCount == MAX_TEMPORARY_STORAGE ) {
2771 CRITICAL_MACRO_TOO_MUCH_LINES( currentMacro->name );
2772 }
2773 }
2774 ((struct _Environment *)_environment)->embedResult.conditional = 1;
2775 }
2776#line 2777 "src-generated/ugbc.embed.tab.c"
2777 break;
2778
2779 case 79: /* $@2: %empty */
2780#line 888 "src/ugbc.embed.y"
2781 {
2782
2783 // printf( "@INLINE %s\n", $3 );
2784
2785 Macro * macro = ((struct _Environment *)_environment)->embedResult.macro;
2786 if ( ! macro ) {
2787 CRITICAL_MACRO_UNDEFINED( (yyvsp[0].string) );
2788 }
2789 while( macro ) {
2790 if ( strcmp( macro->name, (yyvsp[0].string) ) == 0 ) {
2791 break;
2792 }
2793 macro = macro->next;
2794 }
2795 if ( ! macro ) {
2796 CRITICAL_MACRO_UNDEFINED( (yyvsp[0].string) );
2797 }
2798 ((struct _Environment *)_environment)->embedResult.currentMacro = macro;
2799 ((struct _Environment *)_environment)->embedResult.lineCount = 0;
2800 ((struct _Environment *)_environment)->embedResult.valueCount = 0;
2801 }
2802#line 2803 "src-generated/ugbc.embed.tab.c"
2803 break;
2804
2805 case 80: /* embed2: OP_AT INLINE Identifier $@2 macro_values */
2806#line 908 "src/ugbc.embed.y"
2807 {
2808
2810
2811 Macro * currentMacro = ((struct _Environment *)_environment)->embedResult.currentMacro;
2812 if ( ((struct _Environment *)_environment)->embedResult.valueCount != currentMacro->parameterCount ) {
2813 CRITICAL_MACRO_MISMATCH_PARAMETER_VALUES( currentMacro->name );
2814 }
2815
2816 int j=0;
2817 for( j=0; j<currentMacro->lineCount; ++j ) {
2818 char * line = currentMacro->lines[j];
2819 int k=0;
2820 for( k=0; k<currentMacro->parameterCount; ++k ) {
2821 char * nextLine = str_replace( line, currentMacro->parameters[k], ((struct _Environment *)_environment)->embedResult.values[k] );
2822 if ( nextLine ) {
2823 line = nextLine;
2824 }
2825 }
2826 char * nextLine = str_replace( line, "label", label );
2827 if ( nextLine ) {
2828 line = nextLine;
2829 }
2830 ((struct _Environment *)_environment)->embedResult.lines[((struct _Environment *)_environment)->embedResult.lineCount++] = line;
2831 ((Environment *)_environment)->producedAssemblyLines += assemblyLineIsAComment( line ) ? 0 : 1; \
2832 }
2833 ((struct _Environment *)_environment)->embedResult.currentMacro = NULL;
2834 // printf( " lineCount = %d\n", ((struct _Environment *)_environment)->embedResult.lineCount );
2835 }
2836#line 2837 "src-generated/ugbc.embed.tab.c"
2837 break;
2838
2839 case 81: /* embed2: %empty */
2840#line 937 "src/ugbc.embed.y"
2841 {
2842 return 0;
2843 }
2844#line 2845 "src-generated/ugbc.embed.tab.c"
2845 break;
2846
2847
2848#line 2849 "src-generated/ugbc.embed.tab.c"
2849
2850 default: break;
2851 }
2852 /* User semantic actions sometimes alter yychar, and that requires
2853 that yytoken be updated with the new translation. We take the
2854 approach of translating immediately before every use of yytoken.
2855 One alternative is translating here after every semantic action,
2856 but that translation would be missed if the semantic action invokes
2857 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2858 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2859 incorrect destructor might then be invoked immediately. In the
2860 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2861 to an incorrect destructor call or verbose syntax error message
2862 before the lookahead is translated. */
2863 YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
2864
2865 YYPOPSTACK (yylen);
2866 yylen = 0;
2867
2868 *++yyvsp = yyval;
2869 *++yylsp = yyloc;
2870
2871 /* Now 'shift' the result of the reduction. Determine what state
2872 that goes to, based on the state we popped back to and the rule
2873 number reduced by. */
2874 {
2875 const int yylhs = yyr1[yyn] - YYNTOKENS;
2876 const int yyi = yypgoto[yylhs] + *yyssp;
2877 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
2878 ? yytable[yyi]
2879 : yydefgoto[yylhs]);
2880 }
2881
2882 goto yynewstate;
2883
2884
2885/*--------------------------------------.
2886| yyerrlab -- here on detecting error. |
2887`--------------------------------------*/
2888yyerrlab:
2889 /* Make sure we have latest lookahead translation. See comments at
2890 user semantic actions for why this is necessary. */
2892 /* If not already recovering from an error, report this error. */
2893 if (!yyerrstatus)
2894 {
2895 ++yynerrs;
2896 {
2897 yypcontext_t yyctx
2898 = {yyssp, yytoken, &yylloc};
2899 char const *yymsgp = YY_("syntax error");
2900 int yysyntax_error_status;
2901 yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx);
2902 if (yysyntax_error_status == 0)
2903 yymsgp = yymsg;
2904 else if (yysyntax_error_status == -1)
2905 {
2906 if (yymsg != yymsgbuf)
2907 YYSTACK_FREE (yymsg);
2908 yymsg = YY_CAST (char *,
2909 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
2910 if (yymsg)
2911 {
2912 yysyntax_error_status
2913 = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx);
2914 yymsgp = yymsg;
2915 }
2916 else
2917 {
2918 yymsg = yymsgbuf;
2919 yymsg_alloc = sizeof yymsgbuf;
2920 yysyntax_error_status = YYENOMEM;
2921 }
2922 }
2923 yyerror (_environment, yymsgp);
2924 if (yysyntax_error_status == YYENOMEM)
2925 YYNOMEM;
2926 }
2927 }
2928
2929 yyerror_range[1] = yylloc;
2930 if (yyerrstatus == 3)
2931 {
2932 /* If just tried and failed to reuse lookahead token after an
2933 error, discard it. */
2934
2935 if (yychar <= YYEOF)
2936 {
2937 /* Return failure if at end of input. */
2938 if (yychar == YYEOF)
2939 YYABORT;
2940 }
2941 else
2942 {
2943 yydestruct ("Error: discarding",
2944 yytoken, &yylval, &yylloc, _environment);
2945 yychar = YYEMPTY;
2946 }
2947 }
2948
2949 /* Else will try to reuse lookahead token after shifting the error
2950 token. */
2951 goto yyerrlab1;
2952
2953
2954/*---------------------------------------------------.
2955| yyerrorlab -- error raised explicitly by YYERROR. |
2956`---------------------------------------------------*/
2957yyerrorlab:
2958 /* Pacify compilers when the user code never invokes YYERROR and the
2959 label yyerrorlab therefore never appears in user code. */
2960 if (0)
2961 YYERROR;
2962 ++yynerrs;
2963
2964 /* Do not reclaim the symbols of the rule whose action triggered
2965 this YYERROR. */
2966 YYPOPSTACK (yylen);
2967 yylen = 0;
2968 YY_STACK_PRINT (yyss, yyssp);
2969 yystate = *yyssp;
2970 goto yyerrlab1;
2971
2972
2973/*-------------------------------------------------------------.
2974| yyerrlab1 -- common code for both syntax error and YYERROR. |
2975`-------------------------------------------------------------*/
2976yyerrlab1:
2977 yyerrstatus = 3; /* Each real token shifted decrements this. */
2978
2979 /* Pop stack until we find a state that shifts the error token. */
2980 for (;;)
2981 {
2982 yyn = yypact[yystate];
2983 if (!yypact_value_is_default (yyn))
2984 {
2985 yyn += YYSYMBOL_YYerror;
2986 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
2987 {
2988 yyn = yytable[yyn];
2989 if (0 < yyn)
2990 break;
2991 }
2992 }
2993
2994 /* Pop the current state because it cannot handle the error token. */
2995 if (yyssp == yyss)
2996 YYABORT;
2997
2998 yyerror_range[1] = *yylsp;
2999 yydestruct ("Error: popping",
3000 YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp, _environment);
3001 YYPOPSTACK (1);
3002 yystate = *yyssp;
3003 YY_STACK_PRINT (yyss, yyssp);
3004 }
3005
3007 *++yyvsp = yylval;
3009
3010 yyerror_range[2] = yylloc;
3011 ++yylsp;
3012 YYLLOC_DEFAULT (*yylsp, yyerror_range, 2);
3013
3014 /* Shift the error token. */
3015 YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
3016
3017 yystate = yyn;
3018 goto yynewstate;
3019
3020
3021/*-------------------------------------.
3022| yyacceptlab -- YYACCEPT comes here. |
3023`-------------------------------------*/
3024yyacceptlab:
3025 yyresult = 0;
3026 goto yyreturnlab;
3027
3028
3029/*-----------------------------------.
3030| yyabortlab -- YYABORT comes here. |
3031`-----------------------------------*/
3032yyabortlab:
3033 yyresult = 1;
3034 goto yyreturnlab;
3035
3036
3037/*-----------------------------------------------------------.
3038| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
3039`-----------------------------------------------------------*/
3040yyexhaustedlab:
3041 yyerror (_environment, YY_("memory exhausted"));
3042 yyresult = 2;
3043 goto yyreturnlab;
3044
3045
3046/*----------------------------------------------------------.
3047| yyreturnlab -- parsing is finished, clean up and return. |
3048`----------------------------------------------------------*/
3049yyreturnlab:
3050 if (yychar != YYEMPTY)
3051 {
3052 /* Make sure we have latest lookahead translation. See comments at
3053 user semantic actions for why this is necessary. */
3054 yytoken = YYTRANSLATE (yychar);
3055 yydestruct ("Cleanup: discarding lookahead",
3056 yytoken, &yylval, &yylloc, _environment);
3057 }
3058 /* Do not reclaim the symbols of the rule whose action triggered
3059 this YYABORT or YYACCEPT. */
3060 YYPOPSTACK (yylen);
3061 YY_STACK_PRINT (yyss, yyssp);
3062 while (yyssp != yyss)
3063 {
3064 yydestruct ("Cleanup: popping",
3065 YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp, _environment);
3066 YYPOPSTACK (1);
3067 }
3068#ifndef yyoverflow
3069 if (yyss != yyssa)
3070 YYSTACK_FREE (yyss);
3071#endif
3072 if (yymsg != yymsgbuf)
3073 YYSTACK_FREE (yymsg);
3074 return yyresult;
3075}
3076
3077#line 946 "src/ugbc.embed.y"
3078
3079
3080int embederror (Environment * _ignored, const char *s) /* Called by embedparse on error */
3081{
3082 printf( "*** LINE2: %s\n", _ignored->embedResult.line );
3083 printf( "*** ERROR2: %s at %d column %d (%d)\n", s, 0, (embedcolno+1), (yyposno+1));
3084
3085 exit(0);
3086}
3087
void vars_emit_constant_integer(Environment *_environment, char *_name, int _value)
Definition _vars.c:46
int assemblyLineIsAComment(char *_buffer)
int count_screen_mode_selected(Environment *_environment)
int conditional
Definition ugbc.h:2121
int valueCount
Definition ugbc.h:2125
char * values[MAX_TEMPORARY_STORAGE]
Definition ugbc.h:2124
char * line
Definition ugbc.h:2118
Macro * macro
Definition ugbc.h:2122
Macro * currentMacro
Definition ugbc.h:2123
int current
Definition ugbc.h:2119
char * lines[MAX_TEMPORARY_STORAGE]
Definition ugbc.h:2126
int excluded[MAX_NESTED_ARRAYS]
Definition ugbc.h:2120
int lineCount
Definition ugbc.h:2127
Structure of compilation environment.
Definition ugbc.h:2269
int stackStartAddress
Definition ugbc.h:3296
int scaleY
Definition ugbc.h:3235
int optionClip
Definition ugbc.h:2467
JoystickConfig joystickConfig
Definition ugbc.h:2437
int address
Definition ugbc.h:2780
int offsetX
Definition ugbc.h:3237
DataSegment * dataSegment
Definition ugbc.h:2568
int verticalOverlapRequired
Definition ugbc.h:3231
NumberConfig numberConfig
Definition ugbc.h:2410
int enableRle
Definition ugbc.h:2561
CopperList * copperList
Definition ugbc.h:3282
MultiplexingSpriteConfig multiplexingSpriteConfig
Definition ugbc.h:2425
int sysCallUsed
Definition ugbc.h:3162
int frameBufferStart2
Definition ugbc.h:3116
int stackSize
Definition ugbc.h:3294
int frameBufferStart
Definition ugbc.h:3111
KeyboardConfig keyboardConfig
Definition ugbc.h:2435
int offsetY
Definition ugbc.h:3238
TileDescriptors * descriptors
Definition ugbc.h:2939
int horizontalOverlapRequired
Definition ugbc.h:3232
int lmarginAtariBasicEnabled
Definition ugbc.h:3229
EmbedResult embedResult
Definition ugbc.h:2447
int scaleX
Definition ugbc.h:3234
int horizontalScrollOff
Definition ugbc.h:3300
char * parameters[MAX_TEMPORARY_STORAGE]
Definition ugbc.h:2108
char * name
Definition ugbc.h:2107
struct _Macro * next
Definition ugbc.h:2112
int parameterCount
Definition ugbc.h:2109
char * lines[MAX_TEMPORARY_STORAGE]
Definition ugbc.h:2110
int lineCount
Definition ugbc.h:2111
int maxBytes
Definition ugbc.h:2261
int maxDigits
Definition ugbc.h:2262
yysymbol_kind_t yytoken
yy_state_t * yyssp
int embedcolno
#define yylloc
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
#define YYMAXDEPTH
int embedlex()
#define YYSTACK_FREE
yysymbol_kind_t
@ YYSYMBOL_OP_PIPE
@ YYSYMBOL_macro_value
@ YYSYMBOL_COCO2
@ YYSYMBOL_ROM
@ YYSYMBOL_ENDMACRO
@ YYSYMBOL_output
@ YYSYMBOL_Value
@ YYSYMBOL_YYUNDEF
@ YYSYMBOL_embed2
@ YYSYMBOL_OP_COMMA
@ YYSYMBOL_target
@ YYSYMBOL_IF
@ YYSYMBOL_DRAGON
@ YYSYMBOL_C128
@ YYSYMBOL_MACRO
@ YYSYMBOL_ELSEIF
@ YYSYMBOL_OP_LTE
@ YYSYMBOL_YYerror
@ YYSYMBOL_NewLine
@ YYSYMBOL_DRAGON32
@ YYSYMBOL_macro_parameters
@ YYSYMBOL_OP_TAB
@ YYSYMBOL_SC3000
@ YYSYMBOL_K7
@ YYSYMBOL_BIN
@ YYSYMBOL_const_factor
@ YYSYMBOL_C64
@ YYSYMBOL_Integer
@ YYSYMBOL_K7N
@ YYSYMBOL_embed
@ YYSYMBOL_PCCGA
@ YYSYMBOL_ZX
@ YYSYMBOL_Identifier
@ YYSYMBOL_PC1403
@ YYSYMBOL_VIC20
@ YYSYMBOL_GB
@ YYSYMBOL_macro_values
@ YYSYMBOL_DSK
@ YYSYMBOL_macro_parameter
@ YYSYMBOL_REU
@ YYSYMBOL_D64
@ YYSYMBOL_ATARI
@ YYSYMBOL_OP_DISEQUAL
@ YYSYMBOL_ATARIXL
@ YYSYMBOL_OP_LT
@ YYSYMBOL_C128Z
@ YYSYMBOL_Content
@ YYSYMBOL_ELSE
@ YYSYMBOL_SDDRIVE
@ YYSYMBOL_COLECO
@ YYSYMBOL_C64REU
@ YYSYMBOL_DRAGON64
@ YYSYMBOL_TO8
@ YYSYMBOL_YYACCEPT
@ YYSYMBOL_MSX1
@ YYSYMBOL_COCO
@ YYSYMBOL_String
@ YYSYMBOL_OP
@ YYSYMBOL_EMIT
@ YYSYMBOL_YYEOF
@ YYSYMBOL_VZ200
@ YYSYMBOL_TAP
@ YYSYMBOL_OP_OR
@ YYSYMBOL_OP_AT
@ YYSYMBOL_OP_NOT
@ YYSYMBOL_85_1
@ YYSYMBOL_COCO3
@ YYSYMBOL_CP
@ YYSYMBOL_CPC
@ YYSYMBOL_PRG
@ YYSYMBOL_YYEMPTY
@ YYSYMBOL_OP_GTE
@ YYSYMBOL_PC128OP
@ YYSYMBOL_OP_GT
@ YYSYMBOL_MO5
@ YYSYMBOL_OP_POINT
@ YYSYMBOL_SG1000
@ YYSYMBOL_ATR
@ YYSYMBOL_const_expr
@ YYSYMBOL_MSX
@ YYSYMBOL_XEX
@ YYSYMBOL_OP_AND
@ YYSYMBOL_86_2
@ YYSYMBOL_AS
@ YYSYMBOL_K7O
@ YYSYMBOL_COCO1
@ YYSYMBOL_ENDIF
@ YYSYMBOL_INLINE
@ YYSYMBOL_OP_EQUAL
#define YY_ASSERT(E)
#define YY_(Msgid)
int embederror(Environment *, const char *)
#define YYNOMEM
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
int embedwrap()
#define YYNSTATES
#define YY_IGNORE_USELESS_CAST_END
int embeddebug
short yytype_int16
#define yychar
#define YYABORT
#define yylex
#define YYSTACK_BYTES(N)
#define YYLLOC_DEFAULT(Current, Rhs, N)
#define YY_REDUCE_PRINT(Rule)
#define YY_CAST(Type, Val)
#define YYCASE_(N, S)
#define YY_NULLPTR
#define YYFINAL
#define YY_ACCESSING_SYMBOL(State)
#define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
#define yyparse
#define yylval
int embederrors
#define YYNTOKENS
@ YYENOMEM
unsigned char yytype_uint8
#define YY_STACK_PRINT(Bottom, Top)
#define YYSIZE_T
#define YYSTACK_ALLOC_MAXIMUM
#define YY_IGNORE_USELESS_CAST_BEGIN
#define configure_get_value(hardware, parameter)
void * malloc(YYSIZE_T)
#define YYPTRDIFF_T
#define yynerrs
#define YYACCEPT
#define yytable_value_is_error(Yyn)
#define YYTRANSLATE(YYX)
int embedposno
#define yydebug
#define YY_ATTRIBUTE_UNUSED
#define YYPOPSTACK(N)
int yy_state_fast_t
unsigned short yytype_uint16
#define YYLAST
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
#define yypact_value_is_default(Yyn)
#define YYINITDEPTH
signed char yytype_int8
void free(void *)
#define YYERROR
char * str_replace(char *orig, char *rep, char *with)
#define YYSIZEOF(X)
#define YYSTACK_ALLOC
yytype_int8 yy_state_t
#define YYDPRINTF(Args)
#define YY_USE(E)
#define yyerror
@ YYEOF
@ YYerror
@ YYEMPTY
@ YYUNDEF
#define yyalloc
@ OUTPUT_FILE_TYPE_ROM
Definition ugbc.h:265
@ OUTPUT_FILE_TYPE_REU
Definition ugbc.h:269
@ OUTPUT_FILE_TYPE_K7_NEW
Definition ugbc.h:262
@ OUTPUT_FILE_TYPE_DSK
Definition ugbc.h:267
@ OUTPUT_FILE_TYPE_PRG
Definition ugbc.h:259
@ OUTPUT_FILE_TYPE_TAP
Definition ugbc.h:263
@ OUTPUT_FILE_TYPE_K7_ORIGINAL
Definition ugbc.h:261
@ OUTPUT_FILE_TYPE_BIN
Definition ugbc.h:258
@ OUTPUT_FILE_TYPE_ATR
Definition ugbc.h:268
@ OUTPUT_FILE_TYPE_SDDRIVE
Definition ugbc.h:274
@ OUTPUT_FILE_TYPE_D64
Definition ugbc.h:266
@ OUTPUT_FILE_TYPE_XEX
Definition ugbc.h:260
#define MAX_TEMPORARY_STORAGE
Definition ugbc.h:563
#define CRITICAL_MACRO_UNDEFINED(m)
Definition ugbc.h:3608
#define CRITICAL_MACRO_TOO_MUCH_LINES(m)
Definition ugbc.h:3605
#define CRITICAL_MACRO_TOO_MUCH_PARAMETERS(m, p)
Definition ugbc.h:3604
#define CRITICAL_MACRO_TOO_MUCH_VALUES(m, v)
Definition ugbc.h:3606
#define CRITICAL_MACRO_MISMATCH_PARAMETER_VALUES(m)
Definition ugbc.h:3607
struct _Environment Environment
Structure of compilation environment.
struct _Macro Macro
#define MAKE_LABEL
Definition ugbc.h:3351
yysymbol_kind_t
Definition ugbc.tab.c:312
yytype_int16 yy_state_t
Definition ugbc.tab.c:1996
int yyposno
Definition ugbc.tab.c:138
#define YYLOCATION_PRINT
Definition ugbc.tab.c:31604
#define YYFPRINTF
Definition ugbc.tab.c:31552
char * strcopy(char *_dest, char *_source)
char * string
YYLTYPE yyls_alloc
YYSTYPE yyvs_alloc
yy_state_t yyss_alloc