diff --git a/.gitignore b/.gitignore index be195210..eb7d7df8 100644 --- a/.gitignore +++ b/.gitignore @@ -43,16 +43,19 @@ ylwrap apple2ix*.tar.gz test-driver +# GDB +.gdb_history + # generated sources src/rom.c src/x86/glue.S -src/meta/debug.c +src/arm/glue.S # sub{tree,module} src/rom # generated binaries -apple2ix +/apple2ix genfont genrom @@ -65,11 +68,16 @@ xcuserdata .DS_Store xcshareddata -# Android builds +# Android CLI builds Android/bin Android/gen Android/libs - # Android.mk is tEh dynamicz! Android/jni/Android.mk +# Android Studio +.gradle +Android/local.properties +Android/.idea/workspace.xml +Android/.idea/libraries +Android/build diff --git a/Android/jni/apple2ix b/Android/jni/apple2ix new file mode 120000 index 00000000..c07a74de --- /dev/null +++ b/Android/jni/apple2ix @@ -0,0 +1 @@ +build.sh \ No newline at end of file diff --git a/Android/jni/apple2ix-src b/Android/jni/apple2ix-src new file mode 120000 index 00000000..929cb3dc --- /dev/null +++ b/Android/jni/apple2ix-src @@ -0,0 +1 @@ +../../src \ No newline at end of file diff --git a/Android/jni/build.sh b/Android/jni/build.sh index 4455ff09..65fe4e04 100755 --- a/Android/jni/build.sh +++ b/Android/jni/build.sh @@ -1,7 +1,7 @@ #!/bin/sh package_id="org.deadc0de.apple2" -apple2_src_path=../../src +apple2_src_path=apple2ix-src glue_srcs="$apple2_src_path/disk.c $apple2_src_path/misc.c $apple2_src_path/display.c $apple2_src_path/vm.c $apple2_src_path/cpu-supp.c" do_load=0 do_debug=0 diff --git a/Android/jni/sources.mk b/Android/jni/sources.mk index 5f2aaad4..14829e2b 100644 --- a/Android/jni/sources.mk +++ b/Android/jni/sources.mk @@ -1,7 +1,7 @@ # ----------------------------------------------------------------------------- # Common emulator sources and build settings -APPLE2_SRC_PATH := ../../src +APPLE2_SRC_PATH := apple2ix-src APPLE2_X86_SRC := \ $(APPLE2_SRC_PATH)/x86/glue.S $(APPLE2_SRC_PATH)/x86/cpu.S diff --git a/Android/local.properties b/Android/local.properties deleted file mode 100644 index abeb5205..00000000 --- a/Android/local.properties +++ /dev/null @@ -1,10 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must *NOT* be checked into Version Control Systems, -# as it contains information specific to your local configuration. - -# location of the SDK. This is only used by Ant -# For customization when using a Version Control System, please read the -# header note. -sdk.dir=/home/asc/Android/Sdk diff --git a/src/meta/debug.c b/src/meta/debug.c new file mode 100644 index 00000000..57506716 --- /dev/null +++ b/src/meta/debug.c @@ -0,0 +1,3570 @@ + +#line 3 "src/meta/debug.c" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 +#define YY_FLEX_SUBMINOR_VERSION 39 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +#ifdef __cplusplus + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) + +#define YY_USE_CONST + +#endif /* defined (__STDC__) */ +#endif /* ! __cplusplus */ + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN (yy_start) = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START (((yy_start) - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart(yyin ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +extern yy_size_t yyleng; + +extern FILE *yyin, *yyout; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + + #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = (yy_hold_char); \ + YY_RESTORE_YY_MORE_OFFSET \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, (yytext_ptr) ) + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + yy_size_t yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* Stack of input buffers. */ +static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ +static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ +static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ + ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ + : NULL) + +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] + +/* yy_hold_char holds the character lost when yytext is formed. */ +static char yy_hold_char; +static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +yy_size_t yyleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 0; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void yyrestart (FILE *input_file ); +void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); +void yy_delete_buffer (YY_BUFFER_STATE b ); +void yy_flush_buffer (YY_BUFFER_STATE b ); +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); +void yypop_buffer_state (void ); + +static void yyensure_buffer_stack (void ); +static void yy_load_buffer_state (void ); +static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); + +#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) + +YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); +YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); +YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); + +void *yyalloc (yy_size_t ); +void *yyrealloc (void *,yy_size_t ); +void yyfree (void * ); + +#define yy_new_buffer yy_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer(yyin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer(yyin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ + +typedef unsigned char YY_CHAR; + +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; + +typedef int yy_state_type; + +extern int yylineno; + +int yylineno = 1; + +extern char *yytext; +#define yytext_ptr yytext + +static yy_state_type yy_get_previous_state (void ); +static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); +static int yy_get_next_buffer (void ); +static void yy_fatal_error (yyconst char msg[] ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + (yytext_ptr) = yy_bp; \ + yyleng = (size_t) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ + *yy_cp = '\0'; \ + (yy_c_buf_p) = yy_cp; + +#define YY_NUM_RULES 64 +#define YY_END_OF_BUFFER 65 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static yyconst flex_int16_t yy_accept[411] = + { 0, + 0, 0, 65, 63, 62, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 0, 0, 0, 0, 0, + 58, 0, 0, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, + 0, 0, 0, 39, 0, 0, 0, 0, 0, 16, + 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, + 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 0, 0, 53, 0, 0, 0, + 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, + + 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 28, 0, 0, 55, 0, 0, 0, 0, + 0, 31, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, + 0, 0, 0, 0, 0, 0, 0, 56, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 22, 0, 0, 0, 0, 0, 3, + + 0, 0, 0, 34, 0, 0, 0, 0, 0, 40, + 0, 0, 0, 0, 0, 0, 0, 0, 51, 0, + 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, + 29, 0, 38, 0, 0, 60, 0, 26, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 43, 0, + 0, 32, 0, 0, 5, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 52, 0, + 0, 0, 0, 0, 61, 0, 0, 0, 26, 0, + 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, + + 9, 0, 0, 35, 0, 0, 0, 0, 41, 0, + 0, 11, 0, 0, 0, 19, 0, 0, 57, 0, + 0, 0, 45, 0, 0, 0, 0, 23, 0, 4, + 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, + 0, 0, 0, 50, 0, 0, 0, 0, 47, 0, + 49, 0, 0, 0, 0, 7, 0, 0, 36, 0, + 0, 42, 0, 0, 0, 0, 17, 50, 0, 0, + 49, 0, 2, 0, 10, 0, 0, 0, 12, 0, + 20, 0, 46, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 8, 0, 0, 0, 18, 0, + + 48, 0, 0, 0, 24, 0, 0, 0, 59, 0 + } ; + +static yyconst flex_int32_t yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, + 1, 1, 4, 1, 1, 1, 5, 6, 7, 8, + 9, 9, 10, 11, 9, 9, 9, 12, 1, 1, + 1, 1, 13, 1, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 1, 23, 24, 25, 26, 27, 28, + 1, 29, 30, 31, 32, 33, 34, 35, 36, 1, + 1, 1, 1, 1, 1, 1, 37, 38, 39, 40, + + 41, 42, 43, 44, 45, 1, 46, 47, 48, 49, + 50, 51, 1, 52, 53, 54, 55, 56, 57, 58, + 59, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static yyconst flex_int32_t yy_meta[61] = + { 0, + 1, 2, 2, 3, 4, 5, 5, 5, 5, 5, + 5, 6, 1, 7, 7, 7, 7, 7, 7, 1, + 1, 1, 1, 8, 1, 1, 9, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 7, 7, 7, 7, + 7, 7, 1, 1, 1, 1, 8, 1, 1, 9, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 10 + } ; + +static yyconst flex_int16_t yy_base[454] = + { 0, + 371, 0, 338, 1976, 1976, 59, 61, 120, 179, 238, + 297, 356, 64, 66, 415, 474, 71, 98, 37, 292, + 533, 34, 592, 77, 651, 73, 145, 75, 65, 106, + 1976, 269, 124, 301, 168, 315, 1976, 364, 305, 68, + 208, 114, 59, 710, 78, 1976, 769, 370, 97, 828, + 100, 106, 210, 1976, 424, 410, 220, 450, 458, 1976, + 478, 115, 231, 887, 123, 512, 280, 1976, 303, 387, + 1976, 526, 471, 390, 429, 436, 135, 243, 537, 541, + 1976, 443, 555, 452, 560, 327, 1976, 623, 597, 601, + 589, 546, 627, 608, 640, 1976, 946, 629, 631, 674, + + 657, 1976, 127, 1005, 676, 704, 171, 690, 699, 694, + 174, 741, 1976, 706, 713, 1976, 723, 187, 746, 727, + 789, 1976, 96, 737, 163, 0, 198, 819, 801, 212, + 235, 838, 869, 824, 224, 294, 326, 874, 302, 231, + 755, 832, 292, 901, 908, 312, 1064, 0, 362, 792, + 967, 745, 977, 381, 388, 796, 810, 972, 884, 1976, + 290, 815, 897, 834, 995, 861, 991, 1976, 980, 986, + 313, 1000, 399, 1008, 1015, 340, 1051, 1059, 371, 1028, + 1976, 363, 1074, 1133, 1070, 543, 899, 1104, 1128, 1081, + 384, 1084, 1124, 1976, 272, 1135, 480, 246, 1143, 1976, + + 566, 495, 1137, 1976, 426, 476, 453, 475, 1150, 1976, + 488, 506, 1153, 1173, 1161, 1163, 991, 506, 1976, 1165, + 514, 225, 1167, 1976, 648, 1232, 661, 940, 565, 1171, + 1976, 0, 1976, 696, 1184, 1976, 1191, 1976, 1196, 713, + 1202, 1206, 766, 800, 1198, 1214, 1234, 1217, 1976, 851, + 1236, 1976, 952, 1238, 1976, 0, 1240, 1276, 1279, 959, + 1252, 975, 1257, 173, 1056, 168, 1265, 1273, 1976, 0, + 1299, 1288, 1302, 1304, 1306, 1308, 1264, 565, 1976, 1057, + 1324, 1312, 1068, 1328, 1976, 1335, 157, 1332, 1976, 1347, + 1094, 1120, 1226, 1335, 1351, 1353, 1976, 1368, 141, 1374, + + 1976, 1355, 1358, 1976, 135, 1367, 127, 1377, 1976, 1379, + 1383, 1976, 1384, 122, 1394, 1976, 1397, 1399, 1976, 1401, + 1403, 1406, 1976, 1408, 1414, 1418, 1420, 1976, 1422, 1976, + 0, 1425, 1428, 1430, 1433, 1438, 1442, 1444, 1976, 0, + 1447, 1450, 1453, 1460, 1462, 1462, 98, 1468, 1976, 1470, + 1473, 1487, 1481, 1484, 1492, 1976, 1494, 1498, 1976, 1503, + 1509, 1976, 1512, 1515, 1519, 1521, 1976, 1976, 1523, 1529, + 1976, 1532, 1976, 1534, 1976, 1533, 1536, 1543, 1976, 1546, + 1976, 1551, 1976, 1553, 1557, 1560, 1559, 81, 1571, 67, + 1582, 1565, 1568, 1571, 1976, 0, 0, 1585, 1976, 1587, + + 1976, 1593, 1595, 1597, 1976, 1599, 1602, 1605, 1976, 1976, + 1665, 1674, 1681, 1687, 1696, 1705, 1714, 1723, 1732, 1741, + 1747, 1753, 1759, 1765, 1774, 1783, 1792, 1798, 1804, 1810, + 1819, 1825, 1832, 1835, 1838, 1845, 1854, 1861, 1870, 1880, + 1890, 1899, 1908, 1914, 1920, 1926, 1932, 1938, 1947, 1956, + 1959, 1962, 1968 + } ; + +static yyconst flex_int16_t yy_def[454] = + { 0, + 411, 410, 410, 410, 410, 412, 410, 412, 410, 410, + 412, 11, 410, 410, 410, 410, 410, 410, 410, 410, + 410, 410, 410, 410, 410, 410, 412, 413, 410, 410, + 410, 414, 8, 410, 410, 410, 410, 415, 27, 39, + 410, 410, 410, 410, 410, 410, 410, 27, 48, 410, + 410, 410, 410, 410, 416, 410, 410, 410, 410, 410, + 410, 27, 410, 410, 64, 410, 410, 410, 417, 410, + 410, 410, 410, 410, 418, 410, 15, 15, 410, 410, + 410, 410, 410, 410, 410, 410, 410, 414, 410, 410, + 410, 419, 410, 410, 410, 410, 410, 410, 410, 410, + + 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, + 23, 410, 410, 410, 410, 410, 420, 25, 410, 410, + 410, 410, 413, 413, 410, 421, 410, 88, 410, 410, + 410, 410, 415, 133, 410, 410, 410, 410, 44, 410, + 422, 422, 410, 410, 410, 410, 410, 423, 410, 424, + 424, 410, 410, 410, 410, 410, 410, 410, 410, 410, + 410, 410, 410, 410, 410, 410, 410, 410, 417, 418, + 410, 410, 410, 419, 410, 97, 410, 410, 97, 410, + 410, 410, 425, 410, 410, 410, 410, 410, 410, 410, + 410, 420, 410, 410, 410, 421, 410, 410, 426, 410, + + 427, 410, 410, 410, 410, 428, 410, 410, 422, 410, + 410, 429, 410, 410, 410, 410, 147, 147, 410, 423, + 410, 410, 430, 410, 410, 410, 431, 410, 410, 410, + 410, 170, 410, 410, 410, 410, 410, 410, 410, 410, + 425, 432, 410, 410, 410, 410, 410, 410, 410, 410, + 410, 410, 433, 410, 410, 434, 410, 426, 426, 410, + 427, 410, 428, 410, 410, 410, 429, 410, 410, 435, + 430, 271, 410, 410, 410, 410, 226, 226, 410, 410, + 431, 410, 436, 410, 410, 410, 410, 410, 410, 432, + 437, 438, 433, 433, 434, 410, 410, 410, 410, 439, + + 410, 440, 410, 410, 410, 441, 410, 429, 410, 435, + 410, 410, 410, 410, 442, 410, 410, 410, 410, 436, + 410, 410, 410, 410, 437, 438, 410, 410, 443, 410, + 444, 439, 332, 440, 410, 441, 410, 445, 410, 446, + 442, 341, 410, 436, 447, 410, 410, 410, 410, 410, + 438, 443, 352, 444, 410, 410, 410, 410, 410, 410, + 410, 410, 445, 363, 446, 410, 410, 410, 447, 410, + 410, 410, 410, 448, 410, 410, 410, 410, 410, 449, + 410, 410, 410, 450, 448, 385, 410, 410, 410, 410, + 449, 391, 450, 410, 410, 451, 452, 410, 410, 410, + + 410, 451, 452, 410, 410, 453, 453, 410, 410, 0, + 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, + 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, + 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, + 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, + 410, 410, 410 + } ; + +static yyconst flex_int16_t yy_nxt[2037] = + { 0, + 4, 4, 5, 4, 4, 6, 6, 6, 6, 6, + 6, 4, 7, 8, 9, 10, 11, 6, 12, 13, + 14, 15, 4, 16, 17, 18, 19, 4, 20, 21, + 22, 23, 24, 25, 4, 4, 8, 9, 10, 11, + 6, 12, 13, 14, 15, 4, 16, 17, 18, 19, + 4, 20, 21, 22, 23, 24, 25, 4, 4, 4, + 26, 26, 30, 30, 97, 69, 69, 30, 30, 107, + 28, 397, 88, 88, 26, 26, 123, 123, 114, 114, + 125, 39, 29, 72, 28, 396, 136, 97, 89, 73, + 70, 140, 107, 74, 90, 91, 29, 123, 123, 92, + + 92, 115, 370, 125, 39, 29, 72, 30, 30, 136, + 48, 89, 73, 70, 140, 93, 74, 90, 91, 29, + 31, 32, 32, 71, 115, 31, 340, 146, 94, 125, + 37, 28, 95, 48, 337, 33, 116, 147, 93, 27, + 135, 34, 335, 35, 161, 331, 26, 26, 410, 36, + 146, 94, 125, 410, 410, 95, 28, 96, 33, 182, + 147, 321, 27, 135, 34, 31, 35, 161, 29, 195, + 195, 410, 36, 307, 130, 130, 410, 410, 305, 37, + 38, 38, 182, 131, 27, 27, 27, 27, 27, 27, + 28, 29, 39, 27, 27, 27, 40, 27, 191, 410, + + 410, 41, 42, 197, 198, 43, 131, 44, 45, 134, + 134, 142, 142, 201, 201, 39, 27, 27, 27, 40, + 27, 191, 410, 410, 41, 42, 154, 154, 43, 270, + 44, 45, 162, 162, 43, 155, 51, 205, 46, 47, + 47, 202, 202, 27, 27, 27, 27, 27, 27, 28, + 256, 48, 27, 27, 27, 49, 27, 43, 155, 51, + 205, 50, 410, 208, 51, 52, 53, 46, 410, 54, + 32, 32, 126, 127, 48, 27, 27, 27, 49, 27, + 28, 162, 162, 253, 50, 410, 208, 51, 52, 53, + 68, 410, 35, 98, 98, 206, 206, 54, 55, 55, + + 63, 211, 88, 88, 69, 69, 38, 38, 28, 99, + 229, 100, 410, 212, 212, 35, 88, 88, 56, 410, + 57, 101, 129, 63, 90, 58, 59, 41, 37, 234, + 132, 43, 99, 229, 100, 207, 34, 410, 90, 68, + 171, 56, 410, 57, 101, 129, 172, 90, 58, 59, + 41, 102, 234, 132, 43, 410, 60, 61, 61, 34, + 37, 90, 71, 171, 46, 38, 38, 221, 222, 172, + 62, 47, 47, 5, 37, 28, 63, 64, 410, 29, + 239, 65, 227, 227, 66, 67, 410, 29, 69, 69, + 43, 30, 30, 62, 228, 228, 51, 410, 53, 63, + + 64, 250, 29, 239, 65, 130, 130, 66, 67, 410, + 29, 151, 151, 43, 410, 68, 75, 75, 410, 51, + 410, 53, 410, 46, 250, 55, 55, 148, 149, 54, + 75, 75, 76, 152, 77, 28, 410, 75, 75, 153, + 78, 79, 262, 80, 82, 82, 71, 57, 410, 31, + 410, 156, 156, 82, 82, 76, 152, 77, 410, 151, + 151, 410, 153, 78, 79, 262, 80, 157, 264, 60, + 57, 158, 30, 30, 81, 82, 82, 206, 206, 61, + 61, 152, 159, 60, 256, 198, 198, 83, 81, 28, + 157, 264, 265, 84, 158, 81, 201, 201, 74, 85, + + 86, 29, 87, 266, 152, 159, 253, 212, 212, 160, + 83, 87, 410, 164, 164, 265, 84, 60, 270, 222, + 222, 74, 85, 86, 29, 410, 266, 30, 30, 165, + 31, 410, 166, 87, 92, 92, 410, 68, 75, 75, + 410, 167, 75, 75, 242, 242, 103, 92, 92, 73, + 104, 410, 165, 74, 76, 166, 82, 82, 76, 410, + 105, 82, 82, 106, 167, 80, 187, 201, 201, 103, + 260, 168, 73, 104, 84, 410, 74, 76, 282, 84, + 85, 76, 410, 105, 410, 31, 106, 410, 80, 187, + 88, 88, 96, 108, 108, 410, 81, 84, 88, 88, + + 81, 282, 84, 85, 410, 96, 410, 130, 130, 92, + 92, 410, 90, 109, 87, 110, 173, 111, 410, 87, + 90, 91, 112, 410, 88, 88, 126, 127, 92, 92, + 98, 98, 98, 98, 410, 90, 109, 410, 110, 173, + 111, 92, 92, 90, 91, 112, 90, 410, 37, 410, + 100, 113, 117, 117, 154, 154, 37, 94, 98, 98, + 101, 95, 227, 227, 118, 280, 119, 96, 410, 90, + 94, 120, 410, 100, 410, 98, 98, 92, 92, 410, + 94, 121, 37, 101, 95, 410, 96, 118, 102, 119, + 102, 108, 108, 94, 120, 108, 108, 283, 283, 96, + + 108, 108, 410, 101, 121, 92, 92, 114, 114, 410, + 122, 134, 134, 410, 114, 114, 102, 189, 286, 287, + 137, 190, 110, 138, 117, 117, 101, 139, 117, 117, + 410, 105, 41, 102, 410, 96, 43, 410, 193, 193, + 189, 410, 108, 108, 190, 110, 138, 117, 117, 113, + 139, 154, 154, 113, 105, 41, 209, 209, 113, 43, + 225, 410, 109, 96, 110, 116, 120, 291, 291, 46, + 47, 47, 116, 410, 141, 141, 141, 141, 141, 141, + 28, 410, 122, 225, 410, 109, 122, 110, 410, 120, + 117, 117, 29, 223, 223, 51, 194, 156, 156, 410, + + 113, 410, 88, 88, 119, 122, 243, 243, 410, 120, + 410, 156, 156, 410, 210, 29, 162, 162, 51, 410, + 199, 199, 410, 410, 90, 134, 134, 119, 54, 142, + 142, 410, 120, 142, 142, 164, 164, 410, 143, 88, + 88, 144, 410, 125, 410, 145, 410, 90, 122, 410, + 43, 224, 292, 292, 51, 160, 53, 410, 51, 34, + 37, 90, 164, 164, 144, 410, 125, 410, 145, 160, + 203, 203, 410, 43, 68, 134, 134, 51, 200, 53, + 410, 51, 34, 46, 90, 156, 156, 54, 162, 162, + 410, 54, 410, 168, 410, 410, 41, 37, 162, 162, + + 43, 157, 142, 142, 410, 243, 243, 63, 163, 142, + 142, 410, 65, 410, 244, 410, 67, 63, 410, 41, + 168, 144, 410, 43, 157, 410, 67, 51, 204, 53, + 63, 163, 410, 46, 51, 65, 53, 244, 410, 67, + 63, 227, 227, 160, 144, 410, 68, 175, 175, 67, + 51, 253, 53, 293, 293, 410, 68, 51, 410, 53, + 54, 176, 177, 178, 298, 299, 410, 54, 151, 151, + 148, 149, 179, 156, 156, 180, 302, 302, 151, 151, + 410, 230, 230, 410, 176, 177, 178, 232, 232, 157, + 152, 410, 164, 164, 410, 179, 164, 164, 180, 226, + + 152, 235, 235, 410, 159, 181, 183, 183, 410, 237, + 237, 166, 157, 152, 410, 166, 175, 175, 184, 410, + 185, 410, 226, 152, 167, 186, 60, 159, 187, 175, + 175, 160, 105, 188, 166, 410, 60, 410, 166, 231, + 410, 184, 410, 185, 410, 233, 410, 167, 186, 410, + 168, 187, 175, 175, 168, 105, 188, 306, 306, 236, + 175, 175, 313, 314, 96, 213, 213, 238, 178, 283, + 283, 242, 242, 410, 181, 183, 183, 214, 240, 215, + 180, 216, 92, 92, 410, 251, 251, 181, 180, 410, + 186, 178, 217, 187, 218, 291, 291, 187, 324, 410, + + 214, 410, 215, 180, 216, 242, 242, 410, 105, 410, + 181, 180, 410, 186, 410, 217, 187, 218, 181, 185, + 187, 292, 292, 219, 186, 193, 193, 187, 410, 245, + 245, 105, 410, 96, 242, 242, 254, 254, 203, 203, + 96, 410, 185, 252, 257, 257, 258, 186, 185, 410, + 187, 209, 209, 186, 213, 213, 187, 246, 247, 248, + 410, 188, 213, 213, 213, 213, 268, 268, 223, 223, + 271, 185, 230, 230, 213, 213, 186, 410, 216, 187, + 246, 247, 248, 194, 188, 235, 235, 249, 215, 410, + 216, 410, 237, 237, 255, 410, 204, 284, 284, 245, + + 245, 216, 200, 288, 288, 410, 410, 242, 242, 210, + 240, 215, 219, 216, 410, 245, 245, 410, 245, 245, + 219, 410, 219, 410, 269, 410, 224, 293, 293, 187, + 231, 410, 219, 273, 273, 245, 245, 251, 251, 254, + 254, 257, 257, 236, 410, 274, 246, 275, 410, 276, + 238, 410, 187, 300, 300, 285, 410, 249, 303, 303, + 277, 289, 278, 246, 410, 248, 308, 308, 274, 246, + 275, 410, 276, 249, 268, 268, 249, 410, 410, 258, + 296, 296, 410, 277, 410, 278, 246, 410, 248, 311, + 311, 279, 410, 249, 410, 252, 410, 255, 410, 200, + + 410, 410, 410, 273, 273, 273, 273, 273, 273, 273, + 273, 301, 410, 317, 317, 410, 304, 410, 318, 275, + 410, 276, 410, 276, 309, 315, 315, 410, 410, 284, + 284, 410, 269, 288, 288, 410, 327, 327, 297, 321, + 287, 287, 275, 410, 276, 410, 276, 312, 322, 322, + 410, 410, 329, 329, 296, 296, 302, 302, 410, 303, + 303, 279, 410, 279, 410, 279, 410, 279, 306, 306, + 410, 319, 331, 299, 299, 300, 300, 332, 308, 308, + 338, 338, 410, 316, 311, 311, 410, 285, 340, 314, + 314, 289, 410, 410, 328, 315, 315, 341, 317, 317, + + 317, 317, 343, 343, 345, 345, 323, 322, 322, 410, + 330, 410, 297, 346, 347, 348, 348, 304, 410, 350, + 350, 327, 327, 329, 329, 352, 410, 410, 410, 355, + 355, 357, 357, 301, 358, 358, 309, 410, 339, 360, + 360, 410, 312, 361, 361, 338, 338, 363, 410, 410, + 410, 366, 366, 316, 343, 343, 319, 410, 319, 410, + 344, 343, 343, 345, 345, 323, 370, 347, 347, 348, + 348, 350, 350, 349, 350, 350, 410, 351, 410, 328, + 410, 330, 372, 372, 410, 374, 374, 356, 410, 410, + 410, 410, 359, 355, 355, 357, 357, 410, 376, 358, + + 358, 362, 410, 339, 360, 360, 410, 377, 410, 367, + 361, 361, 368, 410, 410, 410, 378, 378, 410, 344, + 380, 380, 366, 366, 382, 382, 410, 349, 410, 371, + 384, 384, 351, 372, 372, 374, 374, 385, 387, 388, + 373, 389, 390, 375, 378, 378, 410, 380, 380, 391, + 410, 356, 382, 382, 384, 384, 410, 359, 410, 410, + 410, 394, 394, 396, 388, 388, 398, 398, 362, 400, + 400, 410, 394, 394, 379, 397, 390, 390, 381, 410, + 367, 410, 383, 410, 410, 410, 398, 398, 400, 400, + 410, 373, 410, 375, 404, 404, 406, 406, 404, 404, + + 406, 406, 379, 408, 408, 381, 408, 408, 410, 410, + 383, 410, 410, 410, 410, 410, 410, 410, 410, 395, + 410, 410, 410, 410, 399, 410, 410, 401, 410, 410, + 395, 410, 410, 410, 410, 410, 410, 410, 410, 410, + 410, 410, 410, 410, 399, 410, 401, 410, 410, 410, + 410, 410, 405, 410, 410, 410, 405, 410, 410, 410, + 410, 409, 410, 410, 409, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 27, 410, 410, 27, 27, + 27, 27, 124, 410, 410, 124, 410, 124, 128, 128, + 128, 128, 128, 128, 128, 410, 128, 133, 410, 410, + + 133, 133, 133, 133, 133, 133, 150, 150, 150, 150, + 150, 150, 150, 410, 150, 169, 410, 410, 169, 410, + 169, 410, 410, 169, 170, 410, 410, 170, 410, 410, + 410, 410, 170, 174, 410, 410, 174, 410, 174, 410, + 410, 174, 192, 410, 410, 192, 410, 192, 410, 410, + 192, 196, 410, 196, 141, 410, 410, 141, 410, 410, + 410, 410, 141, 220, 410, 220, 150, 410, 410, 150, + 410, 150, 410, 410, 150, 241, 410, 241, 241, 410, + 241, 241, 410, 241, 259, 259, 410, 259, 410, 259, + 410, 410, 259, 261, 410, 261, 261, 410, 261, 263, + + 410, 410, 263, 410, 263, 267, 410, 410, 267, 410, + 267, 272, 272, 410, 272, 410, 272, 410, 410, 272, + 281, 410, 281, 281, 410, 281, 290, 410, 290, 290, + 410, 290, 290, 294, 410, 410, 294, 410, 294, 295, + 410, 295, 310, 410, 310, 320, 320, 320, 320, 320, + 320, 320, 320, 320, 320, 325, 410, 325, 325, 410, + 325, 326, 326, 326, 326, 326, 326, 326, 326, 326, + 326, 333, 333, 410, 333, 410, 333, 410, 410, 333, + 334, 334, 334, 334, 334, 334, 334, 334, 334, 334, + 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, + + 342, 342, 410, 342, 410, 342, 410, 410, 342, 353, + 353, 410, 353, 410, 353, 410, 410, 353, 354, 410, + 354, 364, 364, 410, 364, 410, 364, 410, 410, 364, + 365, 410, 365, 369, 410, 410, 369, 410, 369, 386, + 386, 410, 386, 410, 386, 410, 410, 386, 392, 392, + 410, 392, 410, 392, 410, 410, 392, 393, 410, 410, + 393, 410, 393, 402, 410, 402, 403, 410, 403, 407, + 410, 410, 407, 410, 407, 3, 410, 410, 410, 410, + 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, + 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, + + 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, + 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, + 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, + 410, 410, 410, 410, 410, 410 + } ; + +static yyconst flex_int16_t yy_chk[2037] = + { 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 6, 6, 7, 7, 19, 13, 13, 14, 14, 22, + 6, 390, 17, 17, 26, 26, 28, 28, 24, 24, + 29, 40, 6, 14, 26, 388, 43, 19, 17, 14, + 13, 45, 22, 14, 17, 17, 26, 123, 123, 18, + + 18, 24, 347, 29, 40, 6, 14, 30, 30, 43, + 49, 17, 14, 13, 45, 18, 14, 17, 17, 26, + 7, 8, 8, 13, 24, 14, 314, 51, 18, 42, + 17, 8, 18, 49, 307, 8, 24, 52, 18, 33, + 42, 8, 305, 8, 62, 299, 27, 27, 65, 8, + 51, 18, 42, 33, 77, 18, 27, 18, 8, 103, + 52, 287, 33, 42, 8, 30, 8, 62, 27, 125, + 125, 65, 8, 266, 35, 35, 33, 77, 264, 8, + 9, 9, 103, 35, 9, 9, 9, 9, 9, 9, + 9, 27, 9, 9, 9, 9, 9, 9, 107, 111, + + 118, 9, 9, 127, 127, 9, 35, 9, 9, 41, + 41, 53, 53, 130, 130, 9, 9, 9, 9, 9, + 9, 107, 111, 118, 9, 9, 57, 57, 9, 222, + 9, 9, 63, 63, 41, 57, 53, 135, 9, 10, + 10, 131, 131, 10, 10, 10, 10, 10, 10, 10, + 198, 10, 10, 10, 10, 10, 10, 41, 57, 53, + 135, 10, 78, 140, 10, 10, 10, 41, 78, 53, + 32, 32, 32, 32, 10, 10, 10, 10, 10, 10, + 32, 67, 67, 195, 10, 78, 140, 10, 10, 10, + 63, 78, 32, 20, 20, 136, 136, 10, 11, 11, + + 67, 143, 34, 34, 69, 69, 39, 39, 11, 20, + 161, 20, 139, 146, 146, 32, 36, 36, 11, 139, + 11, 20, 34, 67, 34, 11, 11, 39, 32, 171, + 36, 39, 20, 161, 20, 137, 36, 3, 36, 67, + 86, 11, 139, 11, 20, 34, 86, 34, 11, 11, + 39, 20, 171, 36, 39, 176, 11, 12, 12, 36, + 34, 36, 69, 86, 39, 38, 38, 149, 149, 86, + 12, 48, 48, 1, 36, 38, 12, 12, 176, 12, + 182, 12, 154, 154, 12, 12, 179, 38, 70, 70, + 38, 74, 74, 12, 155, 155, 48, 179, 48, 12, + + 12, 191, 12, 182, 12, 173, 173, 12, 12, 179, + 38, 56, 56, 38, 0, 12, 15, 15, 0, 48, + 179, 48, 0, 38, 191, 55, 55, 55, 55, 48, + 75, 75, 15, 56, 15, 55, 0, 76, 76, 56, + 15, 15, 205, 15, 82, 82, 70, 55, 0, 74, + 0, 58, 58, 84, 84, 15, 56, 15, 0, 59, + 59, 0, 56, 15, 15, 205, 15, 58, 207, 56, + 55, 58, 73, 73, 15, 16, 16, 206, 206, 61, + 61, 59, 58, 55, 197, 197, 197, 16, 75, 61, + 58, 207, 208, 16, 58, 76, 202, 202, 73, 16, + + 16, 61, 82, 211, 59, 58, 202, 212, 212, 58, + 16, 84, 0, 66, 66, 208, 16, 59, 221, 221, + 221, 73, 16, 16, 61, 0, 211, 72, 72, 66, + 73, 0, 66, 16, 21, 21, 218, 61, 79, 79, + 0, 66, 80, 80, 186, 186, 21, 92, 92, 72, + 21, 0, 66, 72, 79, 66, 83, 83, 80, 218, + 21, 85, 85, 21, 66, 79, 186, 201, 201, 21, + 201, 66, 72, 21, 83, 0, 72, 79, 229, 85, + 83, 80, 0, 21, 0, 72, 21, 0, 79, 186, + 91, 91, 21, 23, 23, 278, 79, 83, 89, 89, + + 80, 229, 85, 83, 0, 92, 0, 90, 90, 94, + 94, 0, 91, 23, 83, 23, 90, 23, 278, 85, + 89, 89, 23, 0, 88, 88, 88, 88, 93, 93, + 98, 98, 99, 99, 88, 91, 23, 0, 23, 90, + 23, 95, 95, 89, 89, 23, 88, 0, 91, 0, + 99, 23, 25, 25, 225, 225, 89, 93, 101, 101, + 99, 93, 227, 227, 25, 227, 25, 94, 0, 88, + 95, 25, 0, 99, 0, 100, 100, 105, 105, 0, + 93, 25, 88, 99, 93, 0, 93, 25, 98, 25, + 99, 108, 108, 95, 25, 110, 110, 234, 234, 95, + + 109, 109, 0, 100, 25, 106, 106, 114, 114, 0, + 25, 44, 44, 0, 115, 115, 101, 106, 240, 240, + 44, 106, 109, 44, 117, 117, 100, 44, 120, 120, + 0, 106, 44, 100, 0, 105, 44, 0, 124, 124, + 106, 0, 112, 112, 106, 109, 44, 119, 119, 108, + 44, 152, 152, 110, 106, 44, 141, 141, 109, 44, + 152, 0, 112, 106, 112, 114, 119, 243, 243, 44, + 47, 47, 115, 0, 47, 47, 47, 47, 47, 47, + 47, 0, 117, 152, 0, 112, 120, 112, 0, 119, + 121, 121, 47, 150, 150, 47, 124, 156, 156, 0, + + 112, 0, 129, 129, 121, 119, 244, 244, 0, 121, + 0, 157, 157, 0, 141, 47, 162, 162, 47, 0, + 128, 128, 128, 128, 129, 134, 134, 121, 47, 50, + 50, 0, 121, 142, 142, 164, 164, 0, 50, 132, + 132, 50, 128, 50, 0, 50, 0, 129, 121, 0, + 134, 150, 250, 250, 50, 156, 50, 0, 142, 132, + 129, 132, 166, 166, 50, 128, 50, 0, 50, 157, + 133, 133, 0, 134, 162, 138, 138, 50, 128, 50, + 133, 142, 132, 134, 132, 159, 159, 50, 64, 64, + 0, 142, 133, 164, 0, 133, 138, 132, 163, 163, + + 138, 159, 144, 144, 0, 187, 187, 64, 64, 145, + 145, 0, 64, 0, 187, 133, 64, 163, 133, 138, + 166, 145, 0, 138, 159, 0, 163, 144, 133, 144, + 64, 64, 0, 138, 145, 64, 145, 187, 0, 64, + 163, 228, 228, 159, 145, 0, 64, 97, 97, 163, + 144, 228, 144, 253, 253, 0, 163, 145, 0, 145, + 144, 97, 97, 97, 260, 260, 0, 145, 151, 151, + 151, 151, 97, 158, 158, 97, 262, 262, 153, 153, + 0, 169, 169, 0, 97, 97, 97, 170, 170, 158, + 151, 0, 167, 167, 0, 97, 165, 165, 97, 153, + + 153, 172, 172, 0, 158, 97, 104, 104, 0, 174, + 174, 167, 158, 151, 0, 165, 175, 175, 104, 217, + 104, 217, 153, 153, 165, 104, 151, 158, 104, 180, + 180, 158, 104, 104, 167, 0, 153, 0, 165, 169, + 0, 104, 217, 104, 217, 170, 0, 165, 104, 0, + 167, 104, 177, 177, 165, 104, 104, 265, 265, 172, + 178, 178, 280, 280, 104, 147, 147, 174, 177, 283, + 283, 185, 185, 0, 175, 183, 183, 147, 183, 147, + 177, 147, 190, 190, 0, 192, 192, 180, 178, 0, + 185, 177, 147, 185, 147, 291, 291, 183, 291, 0, + + 147, 0, 147, 177, 147, 188, 188, 0, 190, 0, + 177, 178, 0, 185, 0, 147, 185, 147, 178, 188, + 183, 292, 292, 147, 188, 193, 193, 188, 0, 189, + 189, 190, 0, 183, 184, 184, 196, 196, 203, 203, + 190, 0, 188, 192, 199, 199, 199, 188, 184, 0, + 188, 209, 209, 184, 213, 213, 184, 189, 189, 189, + 0, 184, 215, 215, 216, 216, 220, 220, 223, 223, + 223, 184, 230, 230, 214, 214, 184, 0, 215, 184, + 189, 189, 189, 193, 184, 235, 235, 189, 214, 0, + 214, 0, 237, 237, 196, 0, 203, 239, 239, 245, + + 245, 215, 199, 241, 241, 0, 241, 242, 242, 209, + 242, 214, 213, 214, 0, 246, 246, 0, 248, 248, + 215, 0, 216, 0, 220, 241, 223, 293, 293, 242, + 230, 0, 214, 226, 226, 247, 247, 251, 251, 254, + 254, 257, 257, 235, 0, 226, 248, 226, 241, 226, + 237, 0, 242, 261, 261, 239, 261, 245, 263, 263, + 226, 241, 226, 247, 0, 247, 267, 267, 226, 248, + 226, 0, 226, 246, 268, 268, 248, 258, 258, 258, + 259, 259, 259, 226, 0, 226, 247, 0, 247, 272, + 272, 226, 277, 247, 277, 251, 0, 254, 0, 257, + + 271, 271, 271, 273, 273, 274, 274, 275, 275, 276, + 276, 261, 0, 282, 282, 277, 263, 277, 282, 274, + 0, 274, 0, 275, 267, 281, 281, 0, 281, 284, + 284, 0, 268, 288, 288, 258, 294, 294, 259, 286, + 286, 286, 274, 0, 274, 0, 275, 272, 290, 290, + 0, 290, 295, 295, 296, 296, 302, 302, 271, 303, + 303, 273, 0, 274, 0, 275, 0, 276, 306, 306, + 290, 282, 298, 298, 298, 300, 300, 300, 308, 308, + 310, 310, 0, 281, 311, 311, 0, 284, 313, 313, + 313, 288, 0, 290, 294, 315, 315, 315, 317, 317, + + 318, 318, 320, 320, 321, 321, 290, 322, 322, 0, + 295, 0, 296, 324, 324, 325, 325, 303, 325, 326, + 326, 327, 327, 329, 329, 329, 332, 332, 332, 333, + 333, 334, 334, 300, 335, 335, 308, 0, 310, 336, + 336, 0, 311, 337, 337, 338, 338, 338, 341, 341, + 341, 342, 342, 315, 343, 343, 317, 0, 318, 0, + 320, 344, 344, 345, 345, 322, 346, 346, 346, 348, + 348, 350, 350, 325, 351, 351, 0, 326, 0, 327, + 0, 329, 353, 353, 332, 354, 354, 333, 352, 352, + 352, 0, 335, 355, 355, 357, 357, 0, 357, 358, + + 358, 337, 0, 338, 360, 360, 341, 360, 0, 342, + 361, 361, 343, 363, 363, 363, 364, 364, 0, 344, + 365, 365, 366, 366, 369, 369, 0, 348, 0, 350, + 370, 370, 351, 372, 372, 374, 374, 374, 376, 376, + 353, 377, 377, 354, 378, 378, 352, 380, 380, 380, + 0, 355, 382, 382, 384, 384, 0, 358, 385, 385, + 385, 386, 386, 387, 387, 387, 392, 392, 361, 393, + 393, 363, 394, 394, 364, 389, 389, 389, 365, 0, + 366, 0, 369, 391, 391, 391, 398, 398, 400, 400, + 0, 372, 0, 374, 402, 402, 403, 403, 404, 404, + + 406, 406, 378, 407, 407, 380, 408, 408, 0, 0, + 382, 0, 0, 0, 0, 0, 385, 0, 0, 386, + 0, 0, 0, 0, 392, 0, 0, 393, 0, 0, + 394, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 391, 0, 0, 398, 0, 400, 0, 0, 0, + 0, 0, 402, 0, 0, 0, 404, 0, 0, 0, + 0, 407, 0, 0, 408, 411, 411, 411, 411, 411, + 411, 411, 411, 411, 411, 412, 0, 0, 412, 412, + 412, 412, 413, 0, 0, 413, 0, 413, 414, 414, + 414, 414, 414, 414, 414, 0, 414, 415, 0, 0, + + 415, 415, 415, 415, 415, 415, 416, 416, 416, 416, + 416, 416, 416, 0, 416, 417, 0, 0, 417, 0, + 417, 0, 0, 417, 418, 0, 0, 418, 0, 0, + 0, 0, 418, 419, 0, 0, 419, 0, 419, 0, + 0, 419, 420, 0, 0, 420, 0, 420, 0, 0, + 420, 421, 0, 421, 422, 0, 0, 422, 0, 0, + 0, 0, 422, 423, 0, 423, 424, 0, 0, 424, + 0, 424, 0, 0, 424, 425, 0, 425, 425, 0, + 425, 425, 0, 425, 426, 426, 0, 426, 0, 426, + 0, 0, 426, 427, 0, 427, 427, 0, 427, 428, + + 0, 0, 428, 0, 428, 429, 0, 0, 429, 0, + 429, 430, 430, 0, 430, 0, 430, 0, 0, 430, + 431, 0, 431, 431, 0, 431, 432, 0, 432, 432, + 0, 432, 432, 433, 0, 0, 433, 0, 433, 434, + 0, 434, 435, 0, 435, 436, 436, 436, 436, 436, + 436, 436, 436, 436, 436, 437, 0, 437, 437, 0, + 437, 438, 438, 438, 438, 438, 438, 438, 438, 438, + 438, 439, 439, 0, 439, 0, 439, 0, 0, 439, + 440, 440, 440, 440, 440, 440, 440, 440, 440, 440, + 441, 441, 441, 441, 441, 441, 441, 441, 441, 441, + + 442, 442, 0, 442, 0, 442, 0, 0, 442, 443, + 443, 0, 443, 0, 443, 0, 0, 443, 444, 0, + 444, 445, 445, 0, 445, 0, 445, 0, 0, 445, + 446, 0, 446, 447, 0, 0, 447, 0, 447, 448, + 448, 0, 448, 0, 448, 0, 0, 448, 449, 449, + 0, 449, 0, 449, 0, 0, 449, 450, 0, 0, + 450, 0, 450, 451, 0, 451, 452, 0, 452, 453, + 0, 0, 453, 0, 453, 410, 410, 410, 410, 410, + 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, + 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, + + 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, + 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, + 410, 410, 410, 410, 410, 410, 410, 410, 410, 410, + 410, 410, 410, 410, 410, 410 + } ; + +static yy_state_type yy_last_accepting_state; +static char *yy_last_accepting_cpos; + +extern int yy_flex_debug; +int yy_flex_debug = 0; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +char *yytext; +#line 1 "src/meta/debug.l" +/* + * Apple // emulator for Linux: Lexer for debugger + * + * Copyright 1994 Alexander Jean-Claude Bottema + * Copyright 1995 Stephen Lee + * Copyright 1997, 1998 Aaron Culliney + * Copyright 1998, 1999, 2000 Michael Deutschmann + * + * This software package is subject to the GNU General Public License + * version 2 or later (your choice) as published by the Free Software + * Foundation. + * + * THERE ARE NO WARRANTIES WHATSOEVER. + * + */ +/* ASSUMPTIONS: + * flex version 2.5.2 or later + * + */ +#line 23 "src/meta/debug.l" + +/* process includes only the second time we parse this file. */ +#include "common.h" + +#define debugtext yytext + +#define DEBUG_BUFSZ 256 + +YY_BUFFER_STATE buffer = 0; + +extern char second_buf[DEBUGGER_BUF_Y][DEBUGGER_BUF_X];/* scratch buffer for output */ +extern int num_buffer_lines; /* num lines of output */ +extern int arg1, arg2, arg3; /* command arguments */ +extern int breakpoints[MAX_BRKPTS]; /* memory breakpoints */ +extern int watchpoints[MAX_BRKPTS]; /* memory watchpoints */ + +// internal debugger commands +extern void clear_debugger_screen(); +extern void bload(FILE*, char*, int, int); +extern void show_misc_info(); +extern uint8_t get_current_opcode(); +extern void dump_mem(int, int, int, int, int); +extern void search_mem(char*, int, int); +extern void set_mem(int, char*); +extern void set_lc_mem(int, int, char*); +extern void disasm(int, int, int, int); +extern void clear_halt(int*, int); +extern bool set_halt(int*, int); +extern void show_breakpts(); +extern void show_regs(); +extern void display_help(); +extern void show_lc_info(); +extern void show_disk_info(); +extern void set_halt_opcode(uint8_t opcode); +extern void set_halt_65c02(); +extern void clear_halt_65c02(); +extern void clear_halt_opcode(uint8_t opcode); +extern void show_opcode_breakpts(); +extern int debugger_go(stepping_struct_t s); +extern void fb_sha1(); + +/* + d{is} {lc1|lc2} {/bank/}{addr} {+}{len} + m{em} {lc1|lc2} {/bank/}{addr} {+}{len} + a{scii} {lc1|lc2} {/bank/}{addr} {+}{len} + r{egs} + {lc1|lc2} : + bload // + bsave // + (s{tep} | n{ext}) {len} + f{inish} + u{ntil} + g{o} {addr} + sea{rch} {lc1|lc2} + (b{reak} | w{atch}) {addr} + (b{reak} | w{atch}) {addr} + b{reak} op + (c{lear} | i{gnore}) {num} + c{lear} op + key + sta{tus} + l{ang} + dr{ive} + vm + fr{esh} + (? | h{elp}) +*/ + +#line 1140 "src/meta/debug.c" + +#define INITIAL 0 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +static int yy_init_globals (void ); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy (void ); + +int yyget_debug (void ); + +void yyset_debug (int debug_flag ); + +YY_EXTRA_TYPE yyget_extra (void ); + +void yyset_extra (YY_EXTRA_TYPE user_defined ); + +FILE *yyget_in (void ); + +void yyset_in (FILE * in_str ); + +FILE *yyget_out (void ); + +void yyset_out (FILE * out_str ); + +yy_size_t yyget_leng (void ); + +char *yyget_text (void ); + +int yyget_lineno (void ); + +void yyset_lineno (int line_number ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap (void ); +#else +extern int yywrap (void ); +#endif +#endif + + static void yyunput (int c,char *buf_ptr ); + +#ifndef yytext_ptr +static void yy_flex_strncpy (char *,yyconst char *,int ); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * ); +#endif + +#ifndef YY_NO_INPUT + +#ifdef __cplusplus +static int yyinput (void ); +#else +static int input (void ); +#endif + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + size_t n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + }\ +\ + +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int yylex (void); + +#define YY_DECL int yylex (void) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + if ( yyleng > 0 ) \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ + (yytext[yyleng - 1] == '\n'); \ + YY_USER_ACTION + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + + if ( !(yy_init) ) + { + (yy_init) = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer(yyin,YY_BUF_SIZE ); + } + + yy_load_buffer_state( ); + } + + { +#line 104 "src/meta/debug.l" + + + + +#line 1362 "src/meta/debug.c" + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = (yy_c_buf_p); + + /* Support of yytext. */ + *yy_cp = (yy_hold_char); + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = (yy_start); + yy_current_state += YY_AT_BOL(); +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 411 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 1976 ); + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + yy_act = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = (yy_hold_char); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; + +case 1: +/* rule 1 can match eol */ +YY_RULE_SETUP +#line 108 "src/meta/debug.l" +{ + /* mem */ + int do_ascii = 0; + + if (tolower(debugtext[0]) == 'a') + do_ascii = 1; + while (!isspace(*debugtext)) ++debugtext; + + arg1 = (int)strtol(debugtext, &debugtext, 16); + arg2 = (int)strtol(debugtext, &debugtext, 16); + dump_mem(arg1, arg2, 0, do_ascii, -1); + return MEM; +} + YY_BREAK +case 2: +/* rule 2 can match eol */ +YY_RULE_SETUP +#line 122 "src/meta/debug.l" +{ + /* mem // */ + int do_ascii = 0; + + if (tolower(debugtext[0]) == 'a') + do_ascii = 1; + while (*debugtext != '/') ++debugtext; + ++debugtext; /* after / */ + arg3 = (int)strtol(debugtext, &debugtext, 10); + ++debugtext; /* after / */ + + arg1 = (int)strtol(debugtext, &debugtext, 16); + arg2 = (int)strtol(debugtext, &debugtext, 16); + dump_mem(arg1, arg2, 0, do_ascii, arg3); + return MEM; +} + YY_BREAK +case 3: +/* rule 3 can match eol */ +YY_RULE_SETUP +#line 139 "src/meta/debug.l" +{ + /* mem */ + int do_ascii = 0; + + if (tolower(debugtext[0]) == 'a') + do_ascii = 1; + while (!isspace(*debugtext)) ++debugtext; + + arg1 = (int)strtol(debugtext, &debugtext, 16); + dump_mem(arg1, 256, 0, do_ascii, -1); + return MEM; +} + YY_BREAK +case 4: +/* rule 4 can match eol */ +YY_RULE_SETUP +#line 152 "src/meta/debug.l" +{ + /* mem // */ + int do_ascii = 0; + + if (tolower(debugtext[0]) == 'a') + do_ascii = 1; + while (*debugtext != '/') ++debugtext; + ++debugtext; /* after / */ + arg3 = (int)strtol(debugtext, &debugtext, 10); + ++debugtext; /* after / */ + + arg1 = (int)strtol(debugtext, &debugtext, 16); + dump_mem(arg1, 256, 0, do_ascii, arg3); + return MEM; +} + YY_BREAK +case 5: +/* rule 5 can match eol */ +YY_RULE_SETUP +#line 168 "src/meta/debug.l" +{ + /* mem + */ + int do_ascii = 0; + + if (tolower(debugtext[0]) == 'a') + do_ascii = 1; + while (*debugtext != '+') ++debugtext; + ++debugtext; + + arg1 = (int)strtol(debugtext, &debugtext, 16); + dump_mem(cpu65_pc, arg1, 0, do_ascii, -1); + return MEM; +} + YY_BREAK +case 6: +/* rule 6 can match eol */ +YY_RULE_SETUP +#line 182 "src/meta/debug.l" +{ + /* dump mem from current location */ + int do_ascii = 0; + + if (tolower(debugtext[0]) == 'a') + do_ascii = 1; + dump_mem(cpu65_pc, 256, 0, do_ascii, -1); + return MEM; +} + YY_BREAK +case 7: +/* rule 7 can match eol */ +YY_RULE_SETUP +#line 192 "src/meta/debug.l" +{ + /* dump mem from lc */ + int do_ascii = 0; + int lc; + + if (tolower(debugtext[0]) == 'a') + do_ascii = 1; + while (tolower(*debugtext) != 'l') ++debugtext; ++debugtext; + if (tolower(*debugtext) == 'c') ++debugtext; + + lc = (int)strtol(debugtext, &debugtext, 10); + arg1 = (int)strtol(debugtext, &debugtext, 16); + arg2 = (int)strtol(debugtext, &debugtext, 16); + + dump_mem(arg1, arg2, lc, do_ascii, -1); + return MEM; +} + YY_BREAK +case 8: +/* rule 8 can match eol */ +YY_RULE_SETUP +#line 210 "src/meta/debug.l" +{ + /* dump mem from lc // */ + int do_ascii = 0; + int lc; + + if (tolower(debugtext[0]) == 'a') + do_ascii = 1; + while (tolower(*debugtext) != 'l') ++debugtext; ++debugtext; + if (tolower(*debugtext) == 'c') ++debugtext; + lc = (int)strtol(debugtext, &debugtext, 10); + + while (*debugtext != '/') ++debugtext; + ++debugtext; /* after / */ + arg3 = (int)strtol(debugtext, &debugtext, 10); + ++debugtext; /* after / */ + arg1 = (int)strtol(debugtext, &debugtext, 16); + arg2 = (int)strtol(debugtext, &debugtext, 16); + + dump_mem(arg1, arg2, lc, do_ascii, arg3); + return MEM; +} + YY_BREAK +case 9: +/* rule 9 can match eol */ +YY_RULE_SETUP +#line 232 "src/meta/debug.l" +{ + /* dump mem from lc */ + int do_ascii = 0; + int lc; + + if (tolower(debugtext[0]) == 'a') + do_ascii = 1; + while (tolower(*debugtext) != 'l') ++debugtext; ++debugtext; + if (tolower(*debugtext) == 'c') ++debugtext; + + lc = (int)strtol(debugtext, &debugtext, 10); + arg1 = (int)strtol(debugtext, &debugtext, 16); + + dump_mem(arg1, 256, lc, do_ascii, -1); + return MEM; +} + YY_BREAK +case 10: +/* rule 10 can match eol */ +YY_RULE_SETUP +#line 249 "src/meta/debug.l" +{ + /* dump mem from lc // */ + int do_ascii = 0; + int lc; + + if (tolower(debugtext[0]) == 'a') + do_ascii = 1; + while (tolower(*debugtext) != 'l') ++debugtext; ++debugtext; + if (tolower(*debugtext) == 'c') ++debugtext; + lc = (int)strtol(debugtext, &debugtext, 10); + + while (*debugtext != '/') ++debugtext; + ++debugtext; /* after / */ + arg3 = (int)strtol(debugtext, &debugtext, 10); + ++debugtext; /* after / */ + arg1 = (int)strtol(debugtext, &debugtext, 16); + + dump_mem(arg1, 256, lc, do_ascii, arg3); + return MEM; +} + YY_BREAK +case 11: +/* rule 11 can match eol */ +YY_RULE_SETUP +#line 270 "src/meta/debug.l" +{ + /* disassemble at */ + while (!isspace(*debugtext)) ++debugtext; + + arg1 = (int)strtol(debugtext, &debugtext, 16); + arg2 = (int)strtol(debugtext, &debugtext, 16); + + disasm(arg1, arg2, 0, -1); + return DIS; +} + YY_BREAK +case 12: +/* rule 12 can match eol */ +YY_RULE_SETUP +#line 281 "src/meta/debug.l" +{ + /* disassemble at // */ + while (*debugtext != '/') ++debugtext; + ++debugtext; /* after / */ + arg3 = (int)strtol(debugtext, &debugtext, 10); + ++debugtext; /* after / */ + + arg1 = (int)strtol(debugtext, &debugtext, 16); + arg2 = (int)strtol(debugtext, &debugtext, 16); + + disasm(arg1, arg2, 0, arg3); + return DIS; +} + YY_BREAK +case 13: +/* rule 13 can match eol */ +YY_RULE_SETUP +#line 295 "src/meta/debug.l" +{ + /* disassemble at */ + while (!isspace(*debugtext)) ++debugtext; + + arg1 = (int)strtol(debugtext, &debugtext, 16); + arg2 = 256; + if ((arg1 < 0) || (arg1 > 65535)) arg1 = cpu65_pc; + + disasm(arg1, arg2, 0, -1); + return DIS; +} + YY_BREAK +case 14: +/* rule 14 can match eol */ +YY_RULE_SETUP +#line 307 "src/meta/debug.l" +{ + /* disassemble at // */ + while (*debugtext != '/') ++debugtext; + ++debugtext; /* after / */ + arg3 = (int)strtol(debugtext, &debugtext, 10); + ++debugtext; /* after / */ + + arg1 = (int)strtol(debugtext, &debugtext, 16); + arg2 = 256; + if ((arg1 < 0) || (arg1 > 65535)) arg1 = cpu65_pc; + + disasm(arg1, arg2, 0, arg3); + return DIS; +} + YY_BREAK +case 15: +/* rule 15 can match eol */ +YY_RULE_SETUP +#line 322 "src/meta/debug.l" +{ + /* disassemble current location + */ + while (*debugtext != '+') ++debugtext; + ++debugtext; + + arg1 = (int)strtol(debugtext, &debugtext, 16); + disasm(cpu65_pc, arg1, 0, -1); + return DIS; +} + YY_BREAK +case 16: +/* rule 16 can match eol */ +YY_RULE_SETUP +#line 332 "src/meta/debug.l" +{ + /* disassemble current location */ + disasm(cpu65_pc, 256, 0, -1); + return DIS; +} + YY_BREAK +case 17: +/* rule 17 can match eol */ +YY_RULE_SETUP +#line 338 "src/meta/debug.l" +{ + /* disassemble language */ + int lc; + + while (tolower(*debugtext) != 'l') ++debugtext; ++debugtext; + if (tolower(*debugtext) == 'c') ++debugtext; + + lc = (int)strtol(debugtext, &debugtext, 10); + arg1 = (int)strtol(debugtext, &debugtext, 16); + arg2 = (int)strtol(debugtext, &debugtext, 16); + + disasm(arg1, arg2, lc, -1); + return DIS; +} + YY_BREAK +case 18: +/* rule 18 can match eol */ +YY_RULE_SETUP +#line 353 "src/meta/debug.l" +{ + /* disassemble language // */ + int lc; + + while (tolower(*debugtext) != 'l') ++debugtext; ++debugtext; + if (tolower(*debugtext) == 'c') ++debugtext; + lc = (int)strtol(debugtext, &debugtext, 10); + + while (*debugtext != '/') ++debugtext; + ++debugtext; /* after / */ + arg3 = (int)strtol(debugtext, &debugtext, 10); + ++debugtext; /* after / */ + + arg1 = (int)strtol(debugtext, &debugtext, 16); + arg2 = (int)strtol(debugtext, &debugtext, 16); + + disasm(arg1, arg2, lc, arg3); + return DIS; +} + YY_BREAK +case 19: +/* rule 19 can match eol */ +YY_RULE_SETUP +#line 373 "src/meta/debug.l" +{ + /* disassemble language */ + int lc; + + while (tolower(*debugtext) != 'l') ++debugtext; ++debugtext; + if (tolower(*debugtext) == 'c') ++debugtext; + + lc = (int)strtol(debugtext, &debugtext, 10); + arg1 = (int)strtol(debugtext, &debugtext, 16); + + disasm(arg1, 256, lc, -1); + return DIS; +} + YY_BREAK +case 20: +/* rule 20 can match eol */ +YY_RULE_SETUP +#line 387 "src/meta/debug.l" +{ + /* disassemble language // */ + int lc; + + while (tolower(*debugtext) != 'l') ++debugtext; ++debugtext; + if (tolower(*debugtext) == 'c') ++debugtext; + lc = (int)strtol(debugtext, &debugtext, 10); + + while (*debugtext != '/') ++debugtext; + ++debugtext; /* after / */ + arg3 = (int)strtol(debugtext, &debugtext, 10); + ++debugtext; /* after / */ + + arg1 = (int)strtol(debugtext, &debugtext, 16); + + disasm(arg1, 256, lc, arg3); + return DIS; +} + YY_BREAK +case 21: +/* rule 21 can match eol */ +YY_RULE_SETUP +#line 406 "src/meta/debug.l" +{ + /* show cpu state */ + show_regs(); + return REGS; +} + YY_BREAK +case 22: +/* rule 22 can match eol */ +YY_RULE_SETUP +#line 412 "src/meta/debug.l" +{ + /* set memory : */ + arg1 = (int)strtol(debugtext, &debugtext, 16); + + while (*debugtext != ':') ++debugtext; ++debugtext; + while (isspace(*debugtext)) ++debugtext; + + set_mem(arg1, debugtext); + return SETMEM; +} + YY_BREAK +case 23: +/* rule 23 can match eol */ +YY_RULE_SETUP +#line 423 "src/meta/debug.l" +{ + /* set LC memory lc1|lc2 : */ + int lc; + + arg1 = (int)strtol(debugtext, &debugtext, 16); + + while (tolower(*debugtext) != 'l') ++debugtext; ++debugtext; + if (tolower(*debugtext) == 'c') ++debugtext; + lc = (int)strtol(debugtext, &debugtext, 10); + ++debugtext; while (isspace(*debugtext)) ++debugtext; + + set_lc_mem(arg1, lc, debugtext); + return SETMEM; +} + YY_BREAK +case 24: +/* rule 24 can match eol */ +YY_RULE_SETUP +#line 438 "src/meta/debug.l" +{ + /* bload // */ + FILE *fp = NULL; + char *ptr = NULL; + char buf[DEBUG_BUFSZ]; + + while (!isspace(*debugtext)) ++debugtext; + while (isspace(*debugtext)) ++debugtext; + ptr = debugtext; + while (!isspace(*debugtext)) ++debugtext; + int len = MIN((int)(debugtext-ptr), DEBUG_BUFSZ-1); + + /* filename */ + strncpy(buf, ptr, len); + buf[len] = '\0'; + + /* get bank info */ + while (*debugtext != '/') ++debugtext; + ++debugtext; + int bank = (int)strtol(debugtext, &debugtext, 10); + + /* extract addrs */ + ++debugtext; + arg1 = (int)strtol(debugtext, (char**)NULL, 16); + + fp = fopen(buf, "r"); + if (fp == NULL) { + perror(buf); + sprintf(second_buf[num_buffer_lines++], "problem: %s", buf); + return BLOAD; + } + + bload(fp, buf, bank, arg1); + fclose(fp); + return BLOAD; +} + YY_BREAK +case 25: +/* rule 25 can match eol */ +YY_RULE_SETUP +#line 475 "src/meta/debug.l" +{ + + stepping_struct_t s = { + .step_type = STEPPING, + .step_count = 1 + }; + + if (*debugtext == 'n') { + s.step_type = NEXTING; + } + + debugger_go(s); + return STEP; +} + YY_BREAK +case 26: +/* rule 26 can match eol */ +YY_RULE_SETUP +#line 490 "src/meta/debug.l" +{ + + while (!isspace(*debugtext)) ++debugtext; + + arg1 = (int)strtol(debugtext, (char**)NULL, 16); + if ((arg1 < 1) || (arg1 > 255)) arg1 = 255; + + stepping_struct_t s = { + .step_type = STEPPING, + .step_count = arg1 + }; + + if (*debugtext == 'n') { + s.step_type = NEXTING; + } + + debugger_go(s); + return STEP; +} + YY_BREAK +case 27: +/* rule 27 can match eol */ +YY_RULE_SETUP +#line 510 "src/meta/debug.l" +{ + + stepping_struct_t s = { + .step_type = FINISHING, + .step_frame = 1 + }; + + debugger_go(s); + return FINISH; +} + YY_BREAK +case 28: +/* rule 28 can match eol */ +YY_RULE_SETUP +#line 521 "src/meta/debug.l" +{ + /* step until PC == next instruction. good for finishing backward + loops */ + uint8_t op = get_current_opcode(); + int delta=0; + + switch (opcodes[op].mode) + { + case addr_implied: + case addr_accumulator: + delta = 1; + break; + case addr_immediate: + case addr_zeropage: + case addr_zeropage_x: + case addr_zeropage_y: + case addr_indirect: + case addr_indirect_x: + case addr_indirect_y: + case addr_relative: + delta = 2; + break; + case addr_absolute: + case addr_absolute_x: + case addr_absolute_y: + case addr_j_indirect: + case addr_j_indirect_x: + delta = 3; + break; + } + + stepping_struct_t s = { + .step_type = UNTILING, + .step_pc = cpu65_pc + delta + }; + + debugger_go(s); + return UNTIL; +} + YY_BREAK +case 29: +/* rule 29 can match eol */ +YY_RULE_SETUP +#line 561 "src/meta/debug.l" +{ + /* jump to addrs and run while remaining in debugger console */ + while (!isspace(*debugtext)) ++debugtext; + + /* DANGEROUS! */ + cpu65_pc = (int)strtol(debugtext, (char**)NULL, 16); + + stepping_struct_t s = { + .step_type = GOING + }; + + debugger_go(s); + return GO; +} + YY_BREAK +case 30: +/* rule 30 can match eol */ +YY_RULE_SETUP +#line 576 "src/meta/debug.l" +{ + stepping_struct_t s = { + .step_type = GOING + }; + + debugger_go(s); + return GO; +} + YY_BREAK +case 31: +/* rule 31 can match eol */ +YY_RULE_SETUP +#line 585 "src/meta/debug.l" +{ + /* set watchpoint */ + set_halt(watchpoints, cpu65_pc); + return WATCH; +} + YY_BREAK +case 32: +/* rule 32 can match eol */ +YY_RULE_SETUP +#line 591 "src/meta/debug.l" +{ + /* set watchpoint */ + while (!isspace(*debugtext)) ++debugtext; + + arg1 = (int)strtol(debugtext, (char**)NULL, 16); + if ((arg1 < 0) || (arg1 > 65535)) { + sprintf(second_buf[num_buffer_lines++], "invalid address"); + return WATCH; + } + + set_halt(watchpoints, arg1); + return WATCH; +} + YY_BREAK +case 33: +/* rule 33 can match eol */ +YY_RULE_SETUP +#line 606 "src/meta/debug.l" +{ + /* set breakpoint */ + set_halt(breakpoints, cpu65_pc); + return BREAK; +} + YY_BREAK +case 34: +/* rule 34 can match eol */ +YY_RULE_SETUP +#line 612 "src/meta/debug.l" +{ + /* set breakpoint */ + while (!isspace(*debugtext)) ++debugtext; + + arg1 = (int)strtol(debugtext, (char**)NULL, 16); + if ((arg1 < 0) || (arg1 > 65535)) { + sprintf(second_buf[num_buffer_lines++], "invalid address"); + return BREAK; + } + + set_halt(breakpoints, arg1); + return BREAK; +} + YY_BREAK +case 35: +/* rule 35 can match eol */ +YY_RULE_SETUP +#line 626 "src/meta/debug.l" +{ + /* set breakpoint */ + while (!(*debugtext == 'p')) ++debugtext; + ++debugtext; + + arg1 = (int)strtol(debugtext, (char**)NULL, 16); + if ((arg1 < 0) || (arg1 > 0xFF)) { + sprintf(second_buf[num_buffer_lines++], "invalid opcode"); + return BREAK; + } + + set_halt_opcode((uint8_t)arg1); + return BREAK; +} + YY_BREAK +case 36: +/* rule 36 can match eol */ +YY_RULE_SETUP +#line 641 "src/meta/debug.l" +{ + /* set opcode breakpoints on 65c02 instructions */ + set_halt_65c02(); + return BREAK; +} + YY_BREAK +case 37: +/* rule 37 can match eol */ +YY_RULE_SETUP +#line 647 "src/meta/debug.l" +{ + /* ignore everything */ + clear_halt(watchpoints, 0); + sprintf(second_buf[num_buffer_lines++], "ignored all"); + return IGNORE; +} + YY_BREAK +case 38: +/* rule 38 can match eol */ +YY_RULE_SETUP +#line 654 "src/meta/debug.l" +{ + /* ignore ... */ + + while (!isspace(*debugtext)) ++debugtext; + + while (*debugtext) { + arg1 = (int)strtol(debugtext, &debugtext, 10); + if ((arg1 < 1) || (arg1 > MAX_BRKPTS)) { + sprintf(second_buf[num_buffer_lines++], "invalid watchpoint"); + return IGNORE; + } + clear_halt(watchpoints, arg1); + sprintf(second_buf[num_buffer_lines++], "ignored %d", arg1); + } + return IGNORE; +} + YY_BREAK +case 39: +/* rule 39 can match eol */ +YY_RULE_SETUP +#line 672 "src/meta/debug.l" +{ + /* clear everything */ + clear_halt(breakpoints, 0); + sprintf(second_buf[num_buffer_lines++], "cleared all"); + return CLEAR; +} + YY_BREAK +case 40: +/* rule 40 can match eol */ +YY_RULE_SETUP +#line 679 "src/meta/debug.l" +{ + /* clear ... */ + while (!isspace(*debugtext)) ++debugtext; + + while (*debugtext) { + arg1 = (int)strtol(debugtext, &debugtext, 10); + if ((arg1 < 1) || (arg1 > MAX_BRKPTS)) { + sprintf(second_buf[num_buffer_lines++], "invalid breakpoint"); + return CLEAR; + } + clear_halt(breakpoints, arg1); + sprintf(second_buf[num_buffer_lines++], "cleared %d", arg1); + } + return CLEAR; +} + YY_BREAK +case 41: +/* rule 41 can match eol */ +YY_RULE_SETUP +#line 695 "src/meta/debug.l" +{ + /* clear ... */ + while (!(*debugtext == 'p')) ++debugtext; + ++debugtext; + + while (*debugtext) { + arg1 = (int)strtol(debugtext, &debugtext, 16); + if ((arg1 < 0) || (arg1 > 255)) { + sprintf(second_buf[num_buffer_lines++], "invalid opcode"); + return CLEAR; + } + clear_halt_opcode((uint8_t)arg1); + sprintf(second_buf[num_buffer_lines++], "cleared opcode %02X", + (uint8_t)arg1); + } + return CLEAR; +} + YY_BREAK +case 42: +/* rule 42 can match eol */ +YY_RULE_SETUP +#line 713 "src/meta/debug.l" +{ + /* clear 65c02 ... */ + clear_halt_65c02(); + return CLEAR; +} + YY_BREAK +case 43: +/* rule 43 can match eol */ +YY_RULE_SETUP +#line 719 "src/meta/debug.l" +{ + /* show breakpoints and watchpoints */ + show_breakpts(); + return STATUS; +} + YY_BREAK +case 44: +/* rule 44 can match eol */ +YY_RULE_SETUP +#line 725 "src/meta/debug.l" +{ + /* show opcode breakpoints */ + show_opcode_breakpts(); + return OPCODES; +} + YY_BREAK +case 45: +/* rule 45 can match eol */ +YY_RULE_SETUP +#line 731 "src/meta/debug.l" +{ + /* search main memory for */ + while (!isspace(*debugtext)) ++debugtext; + while (isspace(*debugtext)) ++debugtext; + + search_mem(debugtext, 0, -1); + + return SEARCH; +} + YY_BREAK +case 46: +/* rule 46 can match eol */ +YY_RULE_SETUP +#line 741 "src/meta/debug.l" +{ + /* search memory for */ + while (*debugtext != '/') ++debugtext; + ++debugtext; /* after / */ + arg3 = (int)strtol(debugtext, &debugtext, 10); + ++debugtext; /* after / */ + while (isspace(*debugtext)) ++debugtext; + + search_mem(debugtext, 0, arg3); + + return SEARCH; +} + YY_BREAK +case 47: +/* rule 47 can match eol */ +YY_RULE_SETUP +#line 754 "src/meta/debug.l" +{ + /* search LC for */ + int lc; + + while (tolower(*debugtext) != 'l') ++debugtext; ++debugtext; + if (tolower(*debugtext) == 'c') ++debugtext; + lc = (int)strtol(debugtext, &debugtext, 10); + + while (!isspace(*debugtext)) ++debugtext; + while (isspace(*debugtext)) ++debugtext; + + search_mem(debugtext, lc, -1); + + return SEARCH; +} + YY_BREAK +case 48: +/* rule 48 can match eol */ +YY_RULE_SETUP +#line 770 "src/meta/debug.l" +{ + /* search LC memory for */ + int lc; + + while (tolower(*debugtext) != 'l') ++debugtext; ++debugtext; + if (tolower(*debugtext) == 'c') ++debugtext; + lc = (int)strtol(debugtext, &debugtext, 10); + + while (*debugtext != '/') ++debugtext; + ++debugtext; /* after / */ + arg3 = (int)strtol(debugtext, &debugtext, 10); + ++debugtext; /* after / */ + while (isspace(*debugtext)) ++debugtext; + + search_mem(debugtext, lc, arg3); + + return SEARCH; +} + YY_BREAK +case 49: +/* rule 49 can match eol */ +YY_RULE_SETUP +#line 789 "src/meta/debug.l" +{ + /* type ASCII to emulator */ + char buf[DEBUG_BUFSZ]; + + while (!isspace(*debugtext)) ++debugtext; + while (isspace(*debugtext)) ++debugtext; + + strncpy(buf, debugtext, DEBUG_BUFSZ-2); + int len = (int)strlen(buf); + buf[len] = '\r'; + buf[len+1] = '\0'; + + stepping_struct_t s = { + .step_type = TYPING, + .step_text = buf + }; + + debugger_go(s); + + return TYPE; +} + YY_BREAK +case 50: +/* rule 50 can match eol */ +YY_RULE_SETUP +#line 811 "src/meta/debug.l" +{ + /* load/type ASCII */ + FILE *fp = NULL; + char buf[DEBUG_BUFSZ]; + + while (!isspace(*debugtext)) ++debugtext; + while (isspace(*debugtext)) ++debugtext; + + fp = fopen(debugtext, "r"); + if (fp == NULL) { + perror(debugtext); + sprintf(second_buf[num_buffer_lines++], "problem: %s", debugtext); + return LOAD; + } + + LOG("Typing..."); + int ch = -1; + while (fgets(buf, DEBUG_BUFSZ, fp)) { + LOG("%s", buf); + + stepping_struct_t s = { + .step_type = LOADING, + .step_text = buf + }; + + ch = debugger_go(s); + if (ch != -1) { + break; + } + } + fclose(fp); + + if (ch == -1) { + stepping_struct_t s = { + .step_type = GOING, + }; + debugger_go(s); + } + + return LOAD; +} + YY_BREAK +case 51: +/* rule 51 can match eol */ +YY_RULE_SETUP +#line 853 "src/meta/debug.l" +{ +#if CPU_TRACING + char *buf = NULL; + asprintf(&buf, "%s/%s", getenv("HOME"), "cputrace.txt"); + cpu65_trace_toggle(buf); + free(buf); +#else + LOG("CPU tracing not enabled..."); +#endif +} + YY_BREAK +case 52: +/* rule 52 can match eol */ +YY_RULE_SETUP +#line 864 "src/meta/debug.l" +{ +#if DISK_TRACING + char *buf = NULL; + asprintf(&buf, "%s/%s", getenv("HOME"), "disktrace.txt"); + c_toggle_disk_trace_6(buf, NULL); + free(buf); +#else + LOG("Disk tracing not enabled..."); +#endif +} + YY_BREAK +case 53: +/* rule 53 can match eol */ +YY_RULE_SETUP +#line 875 "src/meta/debug.l" +{ + /* display language card settings */ + show_lc_info(); + return LC; +} + YY_BREAK +case 54: +/* rule 54 can match eol */ +YY_RULE_SETUP +#line 881 "src/meta/debug.l" +{ + /* show disk settings */ + show_disk_info(); + return DRIVE; +} + YY_BREAK +case 55: +/* rule 55 can match eol */ +YY_RULE_SETUP +#line 887 "src/meta/debug.l" +{ + /* show other VM softswitch settings */ + show_misc_info(); + return VM; +} + YY_BREAK +case 56: +/* rule 56 can match eol */ +YY_RULE_SETUP +#line 893 "src/meta/debug.l" +{ + /* refresh the screen */ + clear_debugger_screen(); +} + YY_BREAK +case 57: +/* rule 57 can match eol */ +YY_RULE_SETUP +#line 898 "src/meta/debug.l" +{ + fb_sha1(); + return FBSHA1; +} + YY_BREAK +case 58: +/* rule 58 can match eol */ +YY_RULE_SETUP +#line 903 "src/meta/debug.l" +{ + display_help(); + return HELP; +} + YY_BREAK +case 59: +/* rule 59 can match eol */ +YY_RULE_SETUP +#line 908 "src/meta/debug.l" +{ + /* bsave // */ + /* save memory dump to file */ + FILE *fp = NULL; + char *ptr = NULL; + char buf[DEBUG_BUFSZ]; + + while (!isspace(*debugtext)) ++debugtext; + while (isspace(*debugtext)) ++debugtext; + + /* copy file name */ + ptr = debugtext; + while (!isspace(*debugtext)) ++debugtext; + int len = MIN((int)(debugtext-ptr), DEBUG_BUFSZ-1); + strncpy(buf, ptr, len); + buf[len] = '\0'; + + /* get bank info */ + while (*debugtext != '/') ++debugtext; + ++debugtext; + int bank = (int)strtol(debugtext, &debugtext, 10); + ++debugtext; + + /* extract addrs and len */ + unsigned int addrs = (int)strtol(debugtext, &debugtext, 16); + while (isspace(*debugtext)) ++debugtext; + len = (int)strtol(debugtext, &debugtext, 16); + + if (addrs+len > 0x10000) { + sprintf(second_buf[num_buffer_lines++], "buffer length overflow"); + return BSAVE; + } + + fp = fopen(buf, "w"); /* try to open file for writing */ + if (fp == NULL) { + perror(buf); + sprintf(second_buf[num_buffer_lines++], "problem: %s", buf); + return BSAVE; + } + + do { + size_t written = fwrite(apple_ii_64k[bank]+addrs, 1, len, fp); + len -= written; + addrs += written; + } while(len); + + sprintf(second_buf[num_buffer_lines++], "bsaved: %s", buf); + fclose(fp); + return BSAVE; +} + YY_BREAK +case 60: +/* rule 60 can match eol */ +YY_RULE_SETUP +#line 959 "src/meta/debug.l" +{ + /* log debugger output to file - not implemented */ + return LOG; +} + YY_BREAK +case 61: +/* rule 61 can match eol */ +YY_RULE_SETUP +#line 964 "src/meta/debug.l" +{ + /* save apple2 state to a .img file - not implemented I'd like to + * be compatible with the applePC emulator's .img format. anyone + * have documentation on this? -ASC + **/ + return SAVE; +} + YY_BREAK +case 62: +/* rule 62 can match eol */ +YY_RULE_SETUP +#line 973 "src/meta/debug.l" +/* ignore newlines */ + YY_BREAK +case 63: +YY_RULE_SETUP +#line 975 "src/meta/debug.l" +/* ignore extraneous characters */ + YY_BREAK +case 64: +YY_RULE_SETUP +#line 978 "src/meta/debug.l" +ECHO; + YY_BREAK +#line 2542 "src/meta/debug.c" +case YY_STATE_EOF(INITIAL): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = (yy_hold_char); + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++(yy_c_buf_p); + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = (yy_c_buf_p); + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_END_OF_FILE: + { + (yy_did_buffer_switch_on_eof) = 0; + + if ( yywrap( ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of user's declarations */ +} /* end of yylex */ + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +static int yy_get_next_buffer (void) +{ + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + register char *source = (yytext_ptr); + register int number_to_move, i; + int ret_val; + + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + + else + { + yy_size_t num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + + int yy_c_buf_p_offset = + (int) ((yy_c_buf_p) - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + yy_size_t new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + if ( (yy_n_chars) == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart(yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (void) +{ + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = (yy_start); + yy_current_state += YY_AT_BOL(); + + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 60); + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 411 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) +{ + register int yy_is_jam; + register char *yy_cp = (yy_c_buf_p); + + register YY_CHAR yy_c = 60; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 411 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 410); + + return yy_is_jam ? 0 : yy_current_state; +} + + static void yyunput (int c, register char * yy_bp ) +{ + register char *yy_cp; + + yy_cp = (yy_c_buf_p); + + /* undo effects of setting up yytext */ + *yy_cp = (yy_hold_char); + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register yy_size_t number_to_move = (yy_n_chars) + 2; + register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; + register char *source = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; + + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + (yytext_ptr) = yy_bp; + (yy_hold_char) = *yy_cp; + (yy_c_buf_p) = yy_cp; +} + +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (void) +#else + static int input (void) +#endif + +{ + int c; + + *(yy_c_buf_p) = (yy_hold_char); + + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + /* This was really a NUL. */ + *(yy_c_buf_p) = '\0'; + + else + { /* need more input */ + yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); + ++(yy_c_buf_p); + + switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart(yyin ); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap( ) ) + return EOF; + + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = (yytext_ptr) + offset; + break; + } + } + } + + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve yytext */ + (yy_hold_char) = *++(yy_c_buf_p); + + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); + + return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * + * @note This function does not reset the start condition to @c INITIAL . + */ + void yyrestart (FILE * input_file ) +{ + + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer(yyin,YY_BUF_SIZE ); + } + + yy_init_buffer(YY_CURRENT_BUFFER,input_file ); + yy_load_buffer_state( ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * + */ + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) +{ + + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_buffer_stack (); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state( ); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + (yy_did_buffer_switch_on_eof) = 1; +} + +static void yy_load_buffer_state (void) +{ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + (yy_hold_char) = *(yy_c_buf_p); +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * + * @return the allocated buffer state. + */ + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer(b,file ); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with yy_create_buffer() + * + */ + void yy_delete_buffer (YY_BUFFER_STATE b ) +{ + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yyfree((void *) b->yy_ch_buf ); + + yyfree((void *) b ); +} + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a yyrestart() or at EOF. + */ + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) + +{ + int oerrno = errno; + + yy_flush_buffer(b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; + + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * + */ + void yy_flush_buffer (YY_BUFFER_STATE b ) +{ + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state( ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * + */ +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) +{ + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * + */ +void yypop_buffer_state (void) +{ + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void yyensure_buffer_stack (void) +{ + yy_size_t num_to_alloc; + + if (!(yy_buffer_stack)) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; + (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; + } + + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + int grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer(b ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to yylex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * yy_scan_bytes() instead. + */ +YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) +{ + + return yy_scan_bytes(yystr,strlen(yystr) ); +} + +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will + * scan from a @e copy of @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + yy_size_t i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = _yybytes_len + 2; + buf = (char *) yyalloc(n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer(buf,n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; +} + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +static void yy_fatal_error (yyconst char* msg ) +{ + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = (yy_hold_char); \ + (yy_c_buf_p) = yytext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the current line number. + * + */ +int yyget_lineno (void) +{ + + return yylineno; +} + +/** Get the input stream. + * + */ +FILE *yyget_in (void) +{ + return yyin; +} + +/** Get the output stream. + * + */ +FILE *yyget_out (void) +{ + return yyout; +} + +/** Get the length of the current token. + * + */ +yy_size_t yyget_leng (void) +{ + return yyleng; +} + +/** Get the current token. + * + */ + +char *yyget_text (void) +{ + return yytext; +} + +/** Set the current line number. + * @param line_number + * + */ +void yyset_lineno (int line_number ) +{ + + yylineno = line_number; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param in_str A readable stream. + * + * @see yy_switch_to_buffer + */ +void yyset_in (FILE * in_str ) +{ + yyin = in_str ; +} + +void yyset_out (FILE * out_str ) +{ + yyout = out_str ; +} + +int yyget_debug (void) +{ + return yy_flex_debug; +} + +void yyset_debug (int bdebug ) +{ + yy_flex_debug = bdebug ; +} + +static int yy_init_globals (void) +{ + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ + + (yy_buffer_stack) = 0; + (yy_buffer_stack_top) = 0; + (yy_buffer_stack_max) = 0; + (yy_c_buf_p) = (char *) 0; + (yy_init) = 0; + (yy_start) = 0; + +/* Defined in main.c */ +#ifdef YY_STDINIT + yyin = stdin; + yyout = stdout; +#else + yyin = (FILE *) 0; + yyout = (FILE *) 0; +#endif + + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ + return 0; +} + +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (void) +{ + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + yy_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(); + } + + /* Destroy the stack itself. */ + yyfree((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * yylex() is called, initialization will occur. */ + yy_init_globals( ); + + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +{ + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * s ) +{ + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *yyalloc (yy_size_t size ) +{ + return (void *) malloc( size ); +} + +void *yyrealloc (void * ptr, yy_size_t size ) +{ + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); +} + +void yyfree (void * ptr ) +{ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +#line 977 "src/meta/debug.l" + + + + +int yywrap () { + return 1; +} + +/* initialize the buffer - needed each time through */ +void init_lex (char *str, int size) { + if (buffer) yy_delete_buffer(buffer); + buffer = yy_scan_buffer(str,size); + + if (!buffer) { /* oops */ + video_shutdown(); + printf("lex buffer not big enough\n"); + exit(1); + } + +#define WONT_EXECUTE 0 + static volatile void *hack_warnings = &hack_warnings; + if (hack_warnings == WONT_EXECUTE) { + // flex defines these, but we don't use 'em ... + char hack[2]; + yyunput('\0', hack); + input(); + } +#undef WONT_EXECUTE +} + +