10
10
#define YY_FLEX_MAJOR_VERSION 2
11
11
#define YY_FLEX_MINOR_VERSION 5
12
#define YY_FLEX_SUBMINOR_VERSION 33
12
#define YY_FLEX_SUBMINOR_VERSION 35
13
13
#if YY_FLEX_SUBMINOR_VERSION > 0
32
32
/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
34
#if __STDC_VERSION__ >= 199901L
34
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
36
36
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
37
37
* if you want the limit (max/min) macros for int types.
179
180
#define unput(c) yyunput( c, (yytext_ptr) )
181
/* The following is because we cannot portably get our hands on size_t
182
* (without autoconf's help, which isn't available because we want
183
* flex-generated scanners to compile on their own).
186
182
#ifndef YY_TYPEDEF_YY_SIZE_T
187
183
#define YY_TYPEDEF_YY_SIZE_T
188
typedef unsigned int yy_size_t;
184
typedef size_t yy_size_t;
191
187
#ifndef YY_STRUCT_YY_BUFFER_STATE
613
610
static char*prefix = 0;
615
static char utf8buf[16];
616
static char* getUTF8(unsigned int charnum)
618
memset(utf8buf, 0, sizeof(utf8buf));
621
utf8buf[0] = charnum;
623
} else if(charnum <0x800) {
624
/* 0000 0080-0000 07FF 110xxxxx 10xxxxxx */
625
utf8buf[0] = 0xc0 | (charnum >> 6);
626
utf8buf[1] = 0x80 | (charnum & 0x3f);
628
} else if(charnum < 0x10000) {
629
/* 0000 0800-0000 FFFF 1110xxxx 10xxxxxx 10xxxxxx */
630
utf8buf[0] = 0xe0 | (charnum >> 12);
631
utf8buf[1] = 0x80 |((charnum >> 6)&0x3f);
632
utf8buf[2] = 0x80 |((charnum )&0x3f);
634
} else if(charnum < 0x200000) {
635
/* 0001 0000-001F FFFF 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */
636
utf8buf[0] = 0xf0 | (charnum >> 18);
637
utf8buf[1] = 0x80 |((charnum >> 12)&0x3f);
638
utf8buf[2] = 0x80 |((charnum >> 6 )&0x3f);
639
utf8buf[3] = 0x80 |((charnum )&0x3f);
641
} else if(charnum < 0x4000000) {
642
/* 0020 0000-03FF FFFF 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx */
643
utf8buf[0] = 0xf8 | (charnum >> 24);
644
utf8buf[1] = 0x80 |((charnum >> 18)&0x3f);
645
utf8buf[2] = 0x80 |((charnum >> 12)&0x3f);
646
utf8buf[3] = 0x80 |((charnum >> 6 )&0x3f);
647
utf8buf[4] = 0x80 |((charnum )&0x3f);
649
} else if(charnum < 0x80000000) {
650
/* 0400 0000-7FFF FFFF 1111110x 10xxxxxx ... 10xxxxxx */
651
utf8buf[0] = 0xfc | (charnum >> 30);
652
utf8buf[1] = 0x80 |((charnum >> 24)&0x3f);
653
utf8buf[2] = 0x80 |((charnum >> 18)&0x3f);
654
utf8buf[3] = 0x80 |((charnum >> 12)&0x3f);
655
utf8buf[4] = 0x80 |((charnum >> 6 )&0x3f);
656
utf8buf[5] = 0x80 |((charnum )&0x3f);
659
fprintf(stderr, "Illegal character: 0x%08x\n", charnum);
664
612
static void unescapeString(string_t * tmp)
667
615
/* fixme - this routine expects the string to be
668
616
null-terminated */
670
for (p1=tmp->str; (p=strchr(p1, '\\')); p1 = p+1)
618
for (p1=(char*)tmp->str; (p=strchr(p1, '\\')); p1 = p+1)
788
736
#define MAX_INCLUDE_DEPTH 16
789
YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
790
int line_stack[MAX_INCLUDE_DEPTH];
791
int column_stack[MAX_INCLUDE_DEPTH];
792
int include_stack_ptr = 0;
737
static YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
738
static int line_stack[MAX_INCLUDE_DEPTH];
739
static int column_stack[MAX_INCLUDE_DEPTH];
740
static int include_stack_ptr = 0;
794
void handleInclude(char*text, int len)
742
static void handleInclude(char*text, int len)
797
745
while(len >=1 && (text[0] == ' ' || text[0] == '\t')) {
800
while(len >= 1 && (text[len-1] == ' ' || text[len-1] == '\n')) {
749
(text[len-1] == ' ' ||
750
text[len-1] == '\r' ||
751
text[len-1] == '\n')) {
803
754
if(len >= 2 && text[0] == '"' && text[len-1] == '"') {
852
803
static int yy_init_globals (void );
805
/* Accessor methods to globals.
806
These are made visible to non-reentrant scanners for convenience. */
808
int yylex_destroy (void );
810
int yyget_debug (void );
812
void yyset_debug (int debug_flag );
814
YY_EXTRA_TYPE yyget_extra (void );
816
void yyset_extra (YY_EXTRA_TYPE user_defined );
818
FILE *yyget_in (void );
820
void yyset_in (FILE * in_str );
822
FILE *yyget_out (void );
824
void yyset_out (FILE * out_str );
826
int yyget_leng (void );
828
char *yyget_text (void );
830
int yyget_lineno (void );
832
void yyset_lineno (int line_number );
854
834
/* Macros after this point can all be overridden by user definitions in
893
873
/* This used to be an fputs(), but since the string might contain NUL's,
894
874
* we now use fwrite().
896
#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
876
#define ECHO fwrite( yytext, yyleng, 1, yyout )
899
879
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1103
1083
(yy_c_buf_p) = yy_cp -= 1;
1104
1084
YY_DO_BEFORE_ACTION; /* set up yytext again */
1106
#line 270 "parser.lex"
1086
#line 225 "parser.lex"
1107
1087
{s(NUMBER);c();BEGIN(0);}
1110
1090
/* rule 6 can match eol */
1112
#line 271 "parser.lex"
1092
#line 226 "parser.lex"
1116
1096
/* rule 7 can match eol */
1118
#line 272 "parser.lex"
1098
#line 227 "parser.lex"
1123
#line 273 "parser.lex"
1103
#line 228 "parser.lex"
1124
1104
{s(STRING);c();BEGIN(0);}
1128
1108
(yy_c_buf_p) = yy_cp -= 1;
1129
1109
YY_DO_BEFORE_ACTION; /* set up yytext again */
1131
#line 274 "parser.lex"
1111
#line 229 "parser.lex"
1132
1112
{c();printf("unterminated string in line %d: %s\n", line, yytext);exit(1);yyterminate();}
1135
1115
/* rule 10 can match eol */
1137
#line 275 "parser.lex"
1117
#line 230 "parser.lex"
1138
1118
{s(ASSIGNMENT);prefix="<plus>";c();BEGIN(R);}
1141
1121
/* rule 11 can match eol */
1143
#line 276 "parser.lex"
1123
#line 231 "parser.lex"
1144
1124
{s(ASSIGNMENT);prefix="<minus>";c();BEGIN(R);}
1147
1127
/* rule 12 can match eol */
1149
#line 277 "parser.lex"
1129
#line 232 "parser.lex"
1150
1130
{s(ASSIGNMENT);c();BEGIN(R);}
1152
1132
/* values which appear only on the right-hand side of assignments, like: x=50% */
1155
#line 279 "parser.lex"
1135
#line 234 "parser.lex"
1156
1136
{s(IDENTIFIER);c();BEGIN(0);}
1160
1140
/* rule 14 can match eol */
1162
#line 281 "parser.lex"
1142
#line 236 "parser.lex"
1163
1143
{handleInclude(yytext, yyleng);}
1167
#line 282 "parser.lex"
1147
#line 237 "parser.lex"
1168
1148
{s(COMMAND);c();}
1171
1151
/* rule 16 can match eol */
1173
#line 283 "parser.lex"
1153
#line 238 "parser.lex"
1174
1154
{s(RAWDATA);c();}
1178
#line 284 "parser.lex"
1158
#line 239 "parser.lex"
1179
1159
{s(IDENTIFIER);c();}
1183
#line 285 "parser.lex"
1163
#line 240 "parser.lex"
1184
1164
{c();BEGIN(BINARY);}
1187
1167
/* rule 19 can match eol */
1189
#line 286 "parser.lex"
1169
#line 241 "parser.lex"
1194
#line 287 "parser.lex"
1174
#line 242 "parser.lex"
1195
1175
{char c,c1=yytext[0];
1196
1176
printf("Syntax error in line %d, %d: %s", line, column, yytext);
1459
1439
/* Read in more data. */
1460
1440
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1461
(yy_n_chars), num_to_read );
1441
(yy_n_chars), (size_t) num_to_read );
1463
1443
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1483
1463
ret_val = EOB_ACT_CONTINUE_SCAN;
1465
if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1466
/* Extend the array by 50%, plus the number we really need. */
1467
yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1468
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1469
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1470
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1485
1473
(yy_n_chars) += number_to_move;
1486
1474
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1487
1475
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1910
1898
(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1911
1899
(num_to_alloc * sizeof(struct yy_buffer_state*)
1901
if ( ! (yy_buffer_stack) )
1902
YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1914
1904
memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1916
1906
(yy_buffer_stack_max) = num_to_alloc;
1928
1918
((yy_buffer_stack),
1929
1919
num_to_alloc * sizeof(struct yy_buffer_state*)
1921
if ( ! (yy_buffer_stack) )
1922
YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1932
1924
/* zero only the new slots.*/
1933
1925
memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1973
1965
/** Setup the input buffer state to scan a string. The next call to yylex() will
1974
1966
* scan from a @e copy of @a str.
1975
* @param str a NUL-terminated string to scan
1967
* @param yystr a NUL-terminated string to scan
1977
1969
* @return the newly allocated buffer state object.
1978
1970
* @note If you want to scan bytes that may contain NUL values, then use