1 #line 2 "LutScanner.cpp"
3 #line 4 "LutScanner.cpp"
5 #define YY_INT_ALIGNED short int
10 #define YY_FLEX_MAJOR_VERSION 2
11 #define YY_FLEX_MINOR_VERSION 5
12 #define YY_FLEX_SUBMINOR_VERSION 35
13 #if YY_FLEX_SUBMINOR_VERSION > 0
23 #define yyFlexLexer LutFlexLexer
38 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
43 #ifndef __STDC_LIMIT_MACROS
44 #define __STDC_LIMIT_MACROS 1
65 #define INT8_MIN (-128)
68 #define INT16_MIN (-32767-1)
71 #define INT32_MIN (-2147483647-1)
74 #define INT8_MAX (127)
77 #define INT16_MAX (32767)
80 #define INT32_MAX (2147483647)
83 #define UINT8_MAX (255U)
86 #define UINT16_MAX (65535U)
89 #define UINT32_MAX (4294967295U)
109 #if defined (__STDC__)
117 #define yyconst const
130 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
136 #define BEGIN (yy_start) = 1 + 2 *
142 #define YY_START (((yy_start) - 1) / 2)
143 #define YYSTATE YY_START
146 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
149 #define YY_NEW_FILE yyrestart( yyin )
151 #define YY_END_OF_BUFFER_CHAR 0
155 #define YY_BUF_SIZE 16384
160 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
162 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
163 #define YY_TYPEDEF_YY_BUFFER_STATE
169 #define EOB_ACT_CONTINUE_SCAN 0
170 #define EOB_ACT_END_OF_FILE 1
171 #define EOB_ACT_LAST_MATCH 2
173 #define YY_LESS_LINENO(n)
180 int yyless_macro_arg = (n); \
181 YY_LESS_LINENO(yyless_macro_arg);\
182 *yy_cp = (yy_hold_char); \
183 YY_RESTORE_YY_MORE_OFFSET \
184 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
185 YY_DO_BEFORE_ACTION; \
189 #define unput(c) yyunput( c, (yytext_ptr) )
191 #ifndef YY_TYPEDEF_YY_SIZE_T
192 #define YY_TYPEDEF_YY_SIZE_T
196 #ifndef YY_STRUCT_YY_BUFFER_STATE
197 #define YY_STRUCT_YY_BUFFER_STATE
245 #define YY_BUFFER_NEW 0
246 #define YY_BUFFER_NORMAL 1
257 #define YY_BUFFER_EOF_PENDING 2
268 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
269 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
275 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
281 #define yy_new_buffer yy_create_buffer
283 #define yy_set_interactive(is_interactive) \
285 if ( ! YY_CURRENT_BUFFER ){ \
286 yyensure_buffer_stack (); \
287 YY_CURRENT_BUFFER_LVALUE = \
288 yy_create_buffer( yyin, YY_BUF_SIZE ); \
290 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
293 #define yy_set_bol(at_bol) \
295 if ( ! YY_CURRENT_BUFFER ){\
296 yyensure_buffer_stack (); \
297 YY_CURRENT_BUFFER_LVALUE = \
298 yy_create_buffer( yyin, YY_BUF_SIZE ); \
300 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
303 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
309 #define yytext_ptr yytext
316 #define YY_DO_BEFORE_ACTION \
317 (yytext_ptr) = yy_bp; \
318 yyleng = (size_t) (yy_cp - yy_bp); \
319 (yy_hold_char) = *yy_cp; \
321 (yy_c_buf_p) = yy_cp;
323 #define YY_NUM_RULES 12
324 #define YY_END_OF_BUFFER 13
334 0, 0, 13, 11, 9, 9, 3, 4, 7, 6,
335 10, 2, 8, 11, 5, 10, 1, 0
340 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
341 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
342 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
343 1, 2, 1, 1, 1, 1, 1, 1, 1, 4,
344 5, 6, 7, 1, 1, 1, 1, 8, 8, 9,
345 9, 9, 9, 9, 9, 9, 9, 1, 1, 1,
346 10, 1, 1, 11, 12, 12, 12, 12, 12, 12,
347 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
348 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
349 1, 1, 1, 1, 1, 1, 12, 12, 12, 12,
351 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
352 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
353 12, 12, 1, 1, 1, 13, 1, 1, 1, 1,
354 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
355 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
356 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
357 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
358 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
359 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
360 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
362 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
363 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
364 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
365 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
366 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
372 1, 1, 1, 1, 1, 1, 1, 2, 2, 1,
378 0, 0, 17, 18, 18, 18, 18, 18, 18, 18,
379 8, 18, 18, 0, 18, 7, 18, 18, 12
384 18, 1, 18, 18, 18, 18, 18, 18, 18, 18,
385 18, 18, 18, 19, 18, 18, 18, 0, 18
390 4, 5, 6, 7, 8, 9, 10, 11, 4, 12,
391 13, 14, 15, 17, 16, 16, 18, 3, 18, 18,
392 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
398 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
399 1, 1, 1, 19, 16, 11, 3, 18, 18, 18,
400 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
407 #define REJECT reject_used_but_not_detected
408 #define yymore() yymore_used_but_not_detected
409 #define YY_MORE_ADJ 0
410 #define YY_RESTORE_YY_MORE_OFFSET
428 #line 20 "scanner.ll"
444 namespace torc {
namespace bitstream {} }
445 using namespace torc::bitstream;
453 #define yyterminate() return token::END
457 #define YY_NO_UNISTD_H
461 #define DEBUG1(a) printf a
474 #line 81 "scanner.ll"
475 #define YY_USER_ACTION yylloc->columns(yyleng);
476 #line 477 "LutScanner.cpp"
480 #ifndef YY_NO_UNISTD_H
488 #ifndef YY_EXTRA_TYPE
489 #define YY_EXTRA_TYPE void *
493 static void yy_flex_strncpy (
char *,
yyconst char *,
int );
496 #ifdef YY_NEED_STRLEN
497 static int yy_flex_strlen (
yyconst char * );
505 #ifndef YY_READ_BUF_SIZE
506 #define YY_READ_BUF_SIZE 8192
511 #define ECHO LexerOutput( yytext, yyleng )
518 #define YY_INPUT(buf,result,max_size) \
520 if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \
521 YY_FATAL_ERROR( "input in flex scanner failed" );
530 #define yyterminate() return YY_NULL
534 #ifndef YY_START_STACK_INCR
535 #define YY_START_STACK_INCR 25
539 #ifndef YY_FATAL_ERROR
540 #define YY_FATAL_ERROR(msg) LexerError( msg )
549 #define YY_DECL_IS_OURS 1
550 #define YY_DECL int yyFlexLexer::yylex()
556 #ifndef YY_USER_ACTION
557 #define YY_USER_ACTION
562 #define YY_BREAK break;
565 #define YY_RULE_SETUP \
576 #line 84 "scanner.ll"
596 #line 597 "LutScanner.cpp"
616 yyensure_buffer_stack ();
621 yy_load_buffer_state( );
626 yy_cp = (yy_c_buf_p);
629 *yy_cp = (yy_hold_char);
636 yy_current_state = (yy_start);
643 (yy_last_accepting_state) = yy_current_state;
644 (yy_last_accepting_cpos) = yy_cp;
646 while (
yy_chk[
yy_base[yy_current_state] + yy_c] != yy_current_state )
648 yy_current_state = (int)
yy_def[yy_current_state];
649 if ( yy_current_state >= 19 )
650 yy_c =
yy_meta[(
unsigned int) yy_c];
655 while ( yy_current_state != 18 );
656 yy_cp = (yy_last_accepting_cpos);
657 yy_current_state = (yy_last_accepting_state);
670 *yy_cp = (yy_hold_char);
671 yy_cp = (yy_last_accepting_cpos);
672 yy_current_state = (yy_last_accepting_state);
677 #line 103 "scanner.ll"
682 #line 104 "scanner.ll"
687 #line 105 "scanner.ll"
692 #line 106 "scanner.ll"
697 #line 107 "scanner.ll"
702 #line 108 "scanner.ll"
707 #line 109 "scanner.ll"
712 #line 110 "scanner.ll"
718 #line 111 "scanner.ll"
723 #line 112 "scanner.ll"
728 #line 113 "scanner.ll"
729 { std::cout <<
"Flex Unrecognised token!" << std::endl; exit (-1); }
736 #line 121 "scanner.ll"
739 #line 740 "LutScanner.cpp"
746 int yy_amount_of_matched_text = (int) (yy_cp - (
yytext_ptr)) - 1;
749 *yy_cp = (yy_hold_char);
779 (yy_c_buf_p) = (
yytext_ptr) + yy_amount_of_matched_text;
781 yy_current_state = yy_get_previous_state( );
792 yy_next_state = yy_try_NUL_trans( yy_current_state );
799 yy_cp = ++(yy_c_buf_p);
800 yy_current_state = yy_next_state;
806 yy_cp = (yy_last_accepting_cpos);
807 yy_current_state = (yy_last_accepting_state);
812 else switch ( yy_get_next_buffer( ) )
816 (yy_did_buffer_switch_on_eof) = 0;
837 if ( ! (yy_did_buffer_switch_on_eof) )
847 yy_current_state = yy_get_previous_state( );
849 yy_cp = (yy_c_buf_p);
857 yy_current_state = yy_get_previous_state( );
859 yy_cp = (yy_c_buf_p);
868 "fatal flex scanner internal error--no action found" );
885 yy_did_buffer_switch_on_eof = 0;
887 yy_looking_for_trail_begin = 0;
890 yy_more_offset = yy_prev_more_offset = 0;
892 yy_start_stack_ptr = yy_start_stack_depth = 0;
893 yy_start_stack = NULL;
896 yy_buffer_stack_top = 0;
897 yy_buffer_stack_max = 0;
907 delete [] yy_state_buf;
920 yy_switch_to_buffer( yy_create_buffer( new_in,
YY_BUF_SIZE ) );
927 #ifdef YY_INTERACTIVE
933 if ( yyin->eof() || yyin->fail() )
936 #ifdef YY_INTERACTIVE
948 (void) yyin->read( buf, max_size );
953 return yyin->gcount();
959 (void) yyout->write( buf, size );
973 register int number_to_move, i;
978 "fatal flex scanner internal error--end of buffer missed" );
1002 number_to_move = (int) ((yy_c_buf_p) - (
yytext_ptr)) - 1;
1004 for ( i = 0; i < number_to_move; ++i )
1005 *(dest++) = *(source++);
1018 while ( num_to_read <= 0 )
1024 int yy_c_buf_p_offset =
1031 if ( new_size <= 0 )
1046 "fatal error - scanner input buffer overflow" );
1048 (yy_c_buf_p) = &b->
yy_ch_buf[yy_c_buf_p_offset];
1060 (yy_n_chars), (
size_t) num_to_read );
1065 if ( (yy_n_chars) == 0 )
1086 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1089 YY_FATAL_ERROR(
"out of dynamic memory in yy_get_next_buffer()" );
1092 (yy_n_chars) += number_to_move;
1106 register char *
yy_cp;
1108 yy_current_state = (yy_start);
1115 (yy_last_accepting_state) = yy_current_state;
1116 (yy_last_accepting_cpos) = yy_cp;
1118 while (
yy_chk[
yy_base[yy_current_state] + yy_c] != yy_current_state )
1120 yy_current_state = (int)
yy_def[yy_current_state];
1121 if ( yy_current_state >= 19 )
1122 yy_c =
yy_meta[(
unsigned int) yy_c];
1137 register int yy_is_jam;
1138 register char *yy_cp = (yy_c_buf_p);
1143 (yy_last_accepting_state) = yy_current_state;
1144 (yy_last_accepting_cpos) = yy_cp;
1146 while (
yy_chk[
yy_base[yy_current_state] + yy_c] != yy_current_state )
1148 yy_current_state = (int)
yy_def[yy_current_state];
1149 if ( yy_current_state >= 19 )
1150 yy_c =
yy_meta[(
unsigned int) yy_c];
1153 yy_is_jam = (yy_current_state == 18);
1160 register char *
yy_cp;
1162 yy_cp = (yy_c_buf_p);
1165 *yy_cp = (yy_hold_char);
1167 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1170 register int number_to_move = (yy_n_chars) + 2;
1173 register char *source =
1177 *--dest = *--source;
1179 yy_cp += (int) (dest - source);
1180 yy_bp += (int) (dest - source);
1184 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1188 *--yy_cp = (char) c;
1191 (yy_hold_char) = *yy_cp;
1192 (yy_c_buf_p) = yy_cp;
1199 *(yy_c_buf_p) = (yy_hold_char);
1209 *(yy_c_buf_p) =
'\0';
1216 switch ( yy_get_next_buffer( ) )
1239 if ( ! (yy_did_buffer_switch_on_eof) )
1255 c = *(
unsigned char *) (yy_c_buf_p);
1256 *(yy_c_buf_p) =
'\0';
1257 (yy_hold_char) = *++(yy_c_buf_p);
1271 yyensure_buffer_stack ();
1277 yy_load_buffer_state( );
1292 yyensure_buffer_stack ();
1299 *(yy_c_buf_p) = (yy_hold_char);
1305 yy_load_buffer_state( );
1312 (yy_did_buffer_switch_on_eof) = 1;
1320 (yy_hold_char) = *(yy_c_buf_p);
1348 yy_init_buffer( b, file );
1372 extern "C" int isatty (
int );
1383 yy_flush_buffer( b );
1425 yy_load_buffer_state( );
1436 if (new_buffer == NULL)
1439 yyensure_buffer_stack();
1445 *(yy_c_buf_p) = (yy_hold_char);
1452 (yy_buffer_stack_top)++;
1456 yy_load_buffer_state( );
1457 (yy_did_buffer_switch_on_eof) = 1;
1471 if ((yy_buffer_stack_top) > 0)
1472 --(yy_buffer_stack_top);
1475 yy_load_buffer_state( );
1476 (yy_did_buffer_switch_on_eof) = 1;
1487 if (!(yy_buffer_stack)) {
1497 if ( ! (yy_buffer_stack) )
1498 YY_FATAL_ERROR(
"out of dynamic memory in yyensure_buffer_stack()" );
1500 memset((yy_buffer_stack), 0, num_to_alloc *
sizeof(
struct yy_buffer_state*));
1502 (yy_buffer_stack_max) = num_to_alloc;
1503 (yy_buffer_stack_top) = 0;
1507 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1512 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1517 if ( ! (yy_buffer_stack) )
1518 YY_FATAL_ERROR(
"out of dynamic memory in yyensure_buffer_stack()" );
1521 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size *
sizeof(
struct yy_buffer_state*));
1522 (yy_buffer_stack_max) = num_to_alloc;
1528 if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) )
1533 new_size = (yy_start_stack_depth) *
sizeof(
int );
1535 if ( ! (yy_start_stack) )
1536 (yy_start_stack) = (
int *)
Lutalloc(new_size );
1539 (yy_start_stack) = (
int *)
Lutrealloc((
void *) (yy_start_stack),new_size );
1541 if ( ! (yy_start_stack) )
1542 YY_FATAL_ERROR(
"out of memory expanding start-condition stack" );
1545 (yy_start_stack)[(yy_start_stack_ptr)++] =
YY_START;
1552 if ( --(yy_start_stack_ptr) < 0 )
1555 BEGIN((yy_start_stack)[(yy_start_stack_ptr)]);
1560 return (yy_start_stack)[(yy_start_stack_ptr) - 1];
1563 #ifndef YY_EXIT_FAILURE
1564 #define YY_EXIT_FAILURE 2
1569 std::cerr << msg << std::endl;
1580 int yyless_macro_arg = (n); \
1581 YY_LESS_LINENO(yyless_macro_arg);\
1582 yytext[yyleng] = (yy_hold_char); \
1583 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1584 (yy_hold_char) = *(yy_c_buf_p); \
1585 *(yy_c_buf_p) = '\0'; \
1586 yyleng = yyless_macro_arg; \
1597 static void yy_flex_strncpy (
char* s1,
yyconst char * s2,
int n )
1600 for ( i = 0; i < n; ++i )
1605 #ifdef YY_NEED_STRLEN
1606 static int yy_flex_strlen (
yyconst char * s )
1609 for ( n = 0; s[n]; ++n )
1618 return (
void *) malloc( size );
1630 return (
void *) realloc( (
char *) ptr, size );
1635 free( (
char *) ptr );
1638 #define YYTABLES_NAME "yytables"
1640 #line 121 "scanner.ll"
1671 std::cerr <<
"in LutFlexLexer::yylex() !" << std::endl;
1679 int LutFlexLexer::yywrap() {
void yy_switch_to_buffer(struct yy_buffer_state *new_buffer)
void yypush_buffer_state(struct yy_buffer_state *new_buffer)
unsigned char flex_uint8_t
Bison lexer internals.
char * yy_buf_pos
Bison lexer internals.
#define YY_CURRENT_BUFFER_LVALUE
int yy_n_chars
Bison lexer internals.
unsigned int flex_uint32_t
Bison lexer internals.
#define YY_START_STACK_INCR
static yyconst flex_int16_t yy_accept[19]
static yyconst flex_int16_t yy_nxt[32]
#define YY_END_OF_BUFFER_CHAR
void yy_push_state(int new_state)
void * Lutrealloc(void *, yy_size_t)
yy_state_type yy_try_NUL_trans(yy_state_type current_state)
int yy_fill_buffer
Bison lexer internals.
struct yy_buffer_state * YY_BUFFER_STATE
Bison lexer internals.
size_t yy_size_t
Bison lexer internals.
void yy_flush_buffer(struct yy_buffer_state *b)
#define YY_INPUT(buf, result, max_size)
int yy_bs_lineno
Bison lexer internals.
#define EOB_ACT_CONTINUE_SCAN
#define YY_FATAL_ERROR(msg)
struct yy_buffer_state * yy_create_buffer(FLEX_STD istream *s, int size)
yy_size_t yy_buf_size
Bison lexer internals.
Header for the LutScanner class.
void yyunput(int c, char *buf_ptr)
void yypop_buffer_state()
virtual void LexerError(const char *msg)
signed char flex_int8_t
Bison lexer internals.
int yy_at_bol
Bison lexer internals.
void yy_load_buffer_state()
yyFlexLexer(FLEX_STD istream *arg_yyin=0, FLEX_STD ostream *arg_yyout=0)
LutScanner(std::istream *arg_yyin=0, std::ostream *arg_yyout=0)
Public constructor.
int yy_bs_column
Bison lexer internals.
#define EOB_ACT_LAST_MATCH
short int flex_int16_t
Bison lexer internals.
#define YY_CURRENT_BUFFER
virtual int LexerInput(char *buf, int max_size)
void * Lutalloc(yy_size_t)
std::istream * yy_input_file
Bison lexer internals.
char * yy_ch_buf
Bison lexer internals.
virtual ~LutScanner()
Virtual destructor.
static yyconst flex_int16_t yy_base[20]
virtual void LexerOutput(const char *buf, int size)
int yy_is_our_buffer
Bison lexer internals.
#define YY_STATE_EOF(state)
void yyensure_buffer_stack(void)
int yyleng
Bison lexer internals.
#define YY_DO_BEFORE_ACTION
static yyconst flex_int16_t yy_chk[32]
YY_DECL register yy_state_type yy_current_state
static yyconst flex_int16_t yy_def[20]
#define EOB_ACT_END_OF_FILE
void yyrestart(FLEX_STD istream *s)
flex_int32_t yy_verify
Bison lexer internals.
void yy_delete_buffer(struct yy_buffer_state *b)
virtual void switch_streams(FLEX_STD istream *new_in, FLEX_STD ostream *new_out)
#define YY_BUFFER_EOF_PENDING
unsigned short int flex_uint16_t
Bison lexer internals.
flex_int32_t yy_nxt
Bison lexer internals.
void set_debug(bool b)
Enables or disables debugging output.
void yy_init_buffer(struct yy_buffer_state *b, FLEX_STD istream *s)
int yy_is_interactive
Bison lexer internals.
static yyconst flex_int32_t yy_ec[256]
torc::LutParser::token_type token_type
Bison lexer internals.
torc::LutParser::token token
Import the parser's token types into a local typedef.
#define YY_RESTORE_YY_MORE_OFFSET
yy_state_type yy_get_previous_state()
static yyconst flex_int32_t yy_meta[14]
int flex_int32_t
Bison lexer internals.
unsigned char YY_CHAR
Bison lexer internals.
int yy_buffer_status
Bison lexer internals.