torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LutScanner.cpp File Reference
#include <iostream>
#include <errno.h>
#include <cstdlib>
#include <cstring>
#include <FlexLexer.h>
#include <string>
#include "torc/bitstream/assembler/lut/LutScanner.hpp"
+ Include dependency graph for LutScanner.cpp:

Go to the source code of this file.

Data Structures

struct  yy_buffer_state
 Bison parser internals. More...
 
struct  yy_trans_info
 Bison parser internals. More...
 

Namespaces

 torc
 Implementation of class to encapsulate micro-bitstream library generation code.
 
 torc::bitstream
 Namespace for the Torc bitstream frame-level support, including packet parsing and writing.
 

Macros

#define YY_INT_ALIGNED   short int
 
#define FLEX_SCANNER
 
#define YY_FLEX_MAJOR_VERSION   2
 
#define YY_FLEX_MINOR_VERSION   5
 
#define YY_FLEX_SUBMINOR_VERSION   35
 
#define FLEX_BETA
 
#define yyFlexLexer   LutFlexLexer
 
#define FLEXINT_H
 
#define INT8_MIN   (-128)
 
#define INT16_MIN   (-32767-1)
 
#define INT32_MIN   (-2147483647-1)
 
#define INT8_MAX   (127)
 
#define INT16_MAX   (32767)
 
#define INT32_MAX   (2147483647)
 
#define UINT8_MAX   (255U)
 
#define UINT16_MAX   (65535U)
 
#define UINT32_MAX   (4294967295U)
 
#define yyconst
 
#define YY_NULL   0
 
#define YY_SC_TO_UI(c)   ((unsigned int) (unsigned char) c)
 
#define BEGIN   (yy_start) = 1 + 2 *
 
#define YY_START   (((yy_start) - 1) / 2)
 
#define YYSTATE   YY_START
 
#define YY_STATE_EOF(state)   (YY_END_OF_BUFFER + state + 1)
 
#define YY_NEW_FILE   yyrestart( yyin )
 
#define YY_END_OF_BUFFER_CHAR   0
 
#define YY_BUF_SIZE   16384
 
#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
 
#define YY_TYPEDEF_YY_BUFFER_STATE
 
#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 yyless(n)
 
#define unput(c)   yyunput( c, (yytext_ptr) )
 
#define YY_TYPEDEF_YY_SIZE_T
 
#define YY_STRUCT_YY_BUFFER_STATE
 
#define YY_BUFFER_NEW   0
 
#define YY_BUFFER_NORMAL   1
 
#define YY_BUFFER_EOF_PENDING   2
 
#define YY_CURRENT_BUFFER
 
#define YY_CURRENT_BUFFER_LVALUE   (yy_buffer_stack)[(yy_buffer_stack_top)]
 
#define yy_new_buffer   yy_create_buffer
 
#define yy_set_interactive(is_interactive)
 
#define yy_set_bol(at_bol)
 
#define YY_AT_BOL()   (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
 
#define yytext_ptr   yytext
 
#define YY_DO_BEFORE_ACTION
 
#define YY_NUM_RULES   12
 
#define YY_END_OF_BUFFER   13
 
#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
 
#define yyterminate()   return token::END
 
#define YY_NO_UNISTD_H
 Disable the inclusion of unistd.h, which is not available under Visual C++ on Win32. More...
 
#define DEBUG(a)
 
#define DEBUG1(a)   printf a
 
#define YY_USER_ACTION   yylloc->columns(yyleng);
 Enable C++ generation for the scanner class. More...
 
#define INITIAL   0
 
#define YY_EXTRA_TYPE   void *
 
#define YY_READ_BUF_SIZE   8192
 
#define ECHO   LexerOutput( yytext, yyleng )
 
#define YY_INPUT(buf, result, max_size)
 
#define YY_START_STACK_INCR   25
 
#define YY_FATAL_ERROR(msg)   LexerError( msg )
 
#define YY_DECL_IS_OURS   1
 
#define YY_DECL   int yyFlexLexer::yylex()
 
#define YY_BREAK   break;
 
#define YY_RULE_SETUP   YY_USER_ACTION
 
#define YY_EXIT_FAILURE   2
 
#define yyless(n)
 
#define YYTABLES_NAME   "yytables"
 

Typedefs

typedef signed char flex_int8_t
 Bison lexer internals. More...
 
typedef short int flex_int16_t
 Bison lexer internals. More...
 
typedef int flex_int32_t
 Bison lexer internals. More...
 
typedef unsigned char flex_uint8_t
 Bison lexer internals. More...
 
typedef unsigned short int flex_uint16_t
 Bison lexer internals. More...
 
typedef unsigned int flex_uint32_t
 Bison lexer internals. More...
 
typedef struct yy_buffer_stateYY_BUFFER_STATE
 Bison lexer internals. More...
 
typedef size_t yy_size_t
 Bison lexer internals. More...
 
typedef unsigned char YY_CHAR
 Bison lexer internals. More...
 
typedef torc::LutParser::token token
 Import the parser's token types into a local typedef. More...
 
typedef torc::LutParser::token_type token_type
 Bison lexer internals. More...
 

Functions

void * Lutalloc (yy_size_t)
 
void * Lutrealloc (void *, yy_size_t)
 
void Lutfree (void *)
 
yylloc step ()
 Code belonging at the beginning of yylex(). More...
 
 if (!(yy_init))
 
 while (1)
 
int isatty (int)
 

Variables

int yyleng
 Bison lexer internals. More...
 
static yyconst flex_int16_t yy_accept [19]
 
static yyconst flex_int32_t yy_ec [256]
 
static yyconst flex_int32_t yy_meta [14]
 
static yyconst flex_int16_t yy_base [20]
 
static yyconst flex_int16_t yy_def [20]
 
static yyconst flex_int16_t yy_nxt [32]
 
static yyconst flex_int16_t yy_chk [32]
 
YY_DECL register yy_state_type yy_current_state
 
register char * yy_cp
 
register char * yy_bp
 
register int yy_act
 

Macro Definition Documentation

#define BEGIN   (yy_start) = 1 + 2 *

Definition at line 136 of file LutScanner.cpp.

#define DEBUG (   a)

Definition at line 460 of file LutScanner.cpp.

#define DEBUG1 (   a)    printf a

Definition at line 461 of file LutScanner.cpp.

#define ECHO   LexerOutput( yytext, yyleng )

Definition at line 511 of file LutScanner.cpp.

#define EOB_ACT_CONTINUE_SCAN   0

Definition at line 169 of file LutScanner.cpp.

#define EOB_ACT_END_OF_FILE   1

Definition at line 170 of file LutScanner.cpp.

#define EOB_ACT_LAST_MATCH   2

Definition at line 171 of file LutScanner.cpp.

#define FLEX_BETA

Definition at line 14 of file LutScanner.cpp.

#define FLEX_SCANNER

Definition at line 9 of file LutScanner.cpp.

#define FLEXINT_H

Definition at line 34 of file LutScanner.cpp.

#define INITIAL   0

Definition at line 478 of file LutScanner.cpp.

#define INT16_MAX   (32767)

Definition at line 77 of file LutScanner.cpp.

#define INT16_MIN   (-32767-1)

Definition at line 68 of file LutScanner.cpp.

#define INT32_MAX   (2147483647)

Definition at line 80 of file LutScanner.cpp.

#define INT32_MIN   (-2147483647-1)

Definition at line 71 of file LutScanner.cpp.

#define INT8_MAX   (127)

Definition at line 74 of file LutScanner.cpp.

#define INT8_MIN   (-128)

Definition at line 65 of file LutScanner.cpp.

#define REJECT   reject_used_but_not_detected

Definition at line 407 of file LutScanner.cpp.

#define UINT16_MAX   (65535U)

Definition at line 86 of file LutScanner.cpp.

#define UINT32_MAX   (4294967295U)

Definition at line 89 of file LutScanner.cpp.

#define UINT8_MAX   (255U)

Definition at line 83 of file LutScanner.cpp.

#define unput (   c)    yyunput( c, (yytext_ptr) )

Definition at line 189 of file LutScanner.cpp.

#define YY_AT_BOL ( )    (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)

Definition at line 303 of file LutScanner.cpp.

#define YY_BREAK   break;

Definition at line 562 of file LutScanner.cpp.

#define YY_BUF_SIZE   16384

Definition at line 155 of file LutScanner.cpp.

#define YY_BUFFER_EOF_PENDING   2

Definition at line 257 of file LutScanner.cpp.

#define YY_BUFFER_NEW   0

Definition at line 245 of file LutScanner.cpp.

#define YY_BUFFER_NORMAL   1

Definition at line 246 of file LutScanner.cpp.

#define YY_CURRENT_BUFFER
Value:
( (yy_buffer_stack) \
? (yy_buffer_stack)[(yy_buffer_stack_top)] \
: NULL)

Definition at line 268 of file LutScanner.cpp.

#define YY_CURRENT_BUFFER_LVALUE   (yy_buffer_stack)[(yy_buffer_stack_top)]

Definition at line 275 of file LutScanner.cpp.

#define YY_DECL   int yyFlexLexer::yylex()

Definition at line 550 of file LutScanner.cpp.

#define YY_DECL_IS_OURS   1

Definition at line 549 of file LutScanner.cpp.

#define YY_DO_BEFORE_ACTION
Value:
yyleng = (size_t) (yy_cp - yy_bp); \
(yy_hold_char) = *yy_cp; \
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
#define yytext_ptr
Definition: LutScanner.cpp:309
int yyleng
Bison lexer internals.
register char * yy_cp
Definition: LutScanner.cpp:573
register char * yy_bp
Definition: LutScanner.cpp:573

Definition at line 316 of file LutScanner.cpp.

#define YY_END_OF_BUFFER   13

Definition at line 324 of file LutScanner.cpp.

#define YY_END_OF_BUFFER_CHAR   0

Definition at line 151 of file LutScanner.cpp.

#define YY_EXIT_FAILURE   2

Definition at line 1564 of file LutScanner.cpp.

#define YY_EXTRA_TYPE   void *

Definition at line 489 of file LutScanner.cpp.

#define YY_FATAL_ERROR (   msg)    LexerError( msg )

Definition at line 540 of file LutScanner.cpp.

#define YY_FLEX_MAJOR_VERSION   2

Definition at line 10 of file LutScanner.cpp.

#define YY_FLEX_MINOR_VERSION   5

Definition at line 11 of file LutScanner.cpp.

#define YY_FLEX_SUBMINOR_VERSION   35

Definition at line 12 of file LutScanner.cpp.

#define YY_INPUT (   buf,
  result,
  max_size 
)
Value:
if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \
YY_FATAL_ERROR( "input in flex scanner failed" );
#define YY_FATAL_ERROR(msg)
Definition: LutScanner.cpp:540
if(!(yy_init))
Definition: LutScanner.cpp:598

Definition at line 518 of file LutScanner.cpp.

#define YY_INT_ALIGNED   short int

Definition at line 5 of file LutScanner.cpp.

#define YY_LESS_LINENO (   n)

Definition at line 173 of file LutScanner.cpp.

#define YY_MORE_ADJ   0

Definition at line 409 of file LutScanner.cpp.

#define yy_new_buffer   yy_create_buffer

Definition at line 281 of file LutScanner.cpp.

#define YY_NEW_FILE   yyrestart( yyin )

Definition at line 149 of file LutScanner.cpp.

#define YY_NO_UNISTD_H

Disable the inclusion of unistd.h, which is not available under Visual C++ on Win32.

The C++ scanner uses STL streams instead.

Definition at line 457 of file LutScanner.cpp.

#define YY_NULL   0

Definition at line 123 of file LutScanner.cpp.

#define YY_NUM_RULES   12

Definition at line 323 of file LutScanner.cpp.

#define YY_READ_BUF_SIZE   8192

Definition at line 506 of file LutScanner.cpp.

#define YY_RESTORE_YY_MORE_OFFSET

Definition at line 410 of file LutScanner.cpp.

#define YY_RULE_SETUP   YY_USER_ACTION

Definition at line 565 of file LutScanner.cpp.

#define YY_SC_TO_UI (   c)    ((unsigned int) (unsigned char) c)

Definition at line 130 of file LutScanner.cpp.

#define yy_set_bol (   at_bol)
Value:
{ \
yyensure_buffer_stack (); \
yy_create_buffer( yyin, YY_BUF_SIZE ); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
}
#define YY_CURRENT_BUFFER_LVALUE
Definition: LutScanner.cpp:275
#define YY_CURRENT_BUFFER
Definition: LutScanner.cpp:268
#define YY_BUF_SIZE
Definition: LutScanner.cpp:155
if(!(yy_init))
Definition: LutScanner.cpp:598

Definition at line 293 of file LutScanner.cpp.

#define yy_set_interactive (   is_interactive)
Value:
{ \
yyensure_buffer_stack (); \
yy_create_buffer( yyin, YY_BUF_SIZE ); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
}
#define YY_CURRENT_BUFFER_LVALUE
Definition: LutScanner.cpp:275
#define YY_CURRENT_BUFFER
Definition: LutScanner.cpp:268
#define YY_BUF_SIZE
Definition: LutScanner.cpp:155
if(!(yy_init))
Definition: LutScanner.cpp:598

Definition at line 283 of file LutScanner.cpp.

#define YY_START   (((yy_start) - 1) / 2)

Definition at line 142 of file LutScanner.cpp.

#define YY_START_STACK_INCR   25

Definition at line 535 of file LutScanner.cpp.

#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))

Definition at line 160 of file LutScanner.cpp.

#define YY_STATE_EOF (   state)    (YY_END_OF_BUFFER + state + 1)

Definition at line 146 of file LutScanner.cpp.

#define YY_STRUCT_YY_BUFFER_STATE

Definition at line 197 of file LutScanner.cpp.

#define YY_TYPEDEF_YY_BUFFER_STATE

Definition at line 163 of file LutScanner.cpp.

#define YY_TYPEDEF_YY_SIZE_T

Definition at line 192 of file LutScanner.cpp.

#define YY_USER_ACTION   yylloc->columns(yyleng);

Enable C++ generation for the scanner class.

Change the name of the scanner class to "LutFlexLexer". The manual says batch is "somewhat more optimized". Enable debug output from the scanner. We anticipate no included LUT files. Track location information. Each time yylex is invoked, begin is moved to end.

Definition at line 475 of file LutScanner.cpp.

#define yyconst

Definition at line 119 of file LutScanner.cpp.

#define yyFlexLexer   LutFlexLexer

Definition at line 23 of file LutScanner.cpp.

#define yyless (   n)
Value:
do \
{ \
/* Undo effects of setting up yytext. */ \
int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\
*yy_cp = (yy_hold_char); \
(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
} \
while ( 0 )
while(1)
Definition: LutScanner.cpp:624
#define YY_DO_BEFORE_ACTION
Definition: LutScanner.cpp:316
#define YY_LESS_LINENO(n)
Definition: LutScanner.cpp:173
#define YY_RESTORE_YY_MORE_OFFSET
Definition: LutScanner.cpp:410
register char * yy_cp
Definition: LutScanner.cpp:573
register char * yy_bp
Definition: LutScanner.cpp:573
#define YY_MORE_ADJ
Definition: LutScanner.cpp:409

Definition at line 1576 of file LutScanner.cpp.

#define yyless (   n)
Value:
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 )
while(1)
Definition: LutScanner.cpp:624
int yyleng
Bison lexer internals.
#define YY_LESS_LINENO(n)
Definition: LutScanner.cpp:173

Definition at line 1576 of file LutScanner.cpp.

#define yymore ( )    yymore_used_but_not_detected

Definition at line 408 of file LutScanner.cpp.

#define YYSTATE   YY_START

Definition at line 143 of file LutScanner.cpp.

#define YYTABLES_NAME   "yytables"

Definition at line 1638 of file LutScanner.cpp.

#define yyterminate ( )    return token::END

By default, yylex() returns int, but we want token_type instead. Unfortunately, yyterminate returns 0 by default, which is not of token_type.

Definition at line 453 of file LutScanner.cpp.

#define yytext_ptr   yytext

Definition at line 309 of file LutScanner.cpp.

Typedef Documentation

Bison lexer internals.

Definition at line 56 of file LutScanner.cpp.

Bison lexer internals.

Definition at line 57 of file LutScanner.cpp.

Bison lexer internals.

Definition at line 55 of file LutScanner.cpp.

Bison lexer internals.

Definition at line 59 of file LutScanner.cpp.

Bison lexer internals.

Definition at line 60 of file LutScanner.cpp.

Bison lexer internals.

Definition at line 58 of file LutScanner.cpp.

Import the parser's token types into a local typedef.

Definition at line 448 of file LutScanner.cpp.

Bison lexer internals.

Definition at line 449 of file LutScanner.cpp.

Bison lexer internals.

Definition at line 164 of file LutScanner.cpp.

Bison lexer internals.

Definition at line 307 of file LutScanner.cpp.

Bison lexer internals.

Definition at line 193 of file LutScanner.cpp.

Function Documentation

if ( yy_init)

Definition at line 598 of file LutScanner.cpp.

599  {
600  (yy_init) = 1;
601 
602 #ifdef YY_USER_INIT
603  YY_USER_INIT;
604 #endif
605 
606  if ( ! (yy_start) )
607  (yy_start) = 1; /* first start state */
608 
609  if ( ! yyin )
610  yyin = & std::cin;
611 
612  if ( ! yyout )
613  yyout = & std::cout;
614 
615  if ( ! YY_CURRENT_BUFFER ) {
616  yyensure_buffer_stack ();
618  yy_create_buffer( yyin, YY_BUF_SIZE );
619  }
620 
621  yy_load_buffer_state( );
622  }
#define YY_CURRENT_BUFFER_LVALUE
Definition: LutScanner.cpp:275
#define YY_CURRENT_BUFFER
Definition: LutScanner.cpp:268
#define YY_BUF_SIZE
Definition: LutScanner.cpp:155
int isatty ( int  )
void * Lutalloc ( yy_size_t  size)

Definition at line 1616 of file LutScanner.cpp.

1617 {
1618  return (void *) malloc( size );
1619 }

+ Here is the caller graph for this function:

void Lutfree ( void *  ptr)

Definition at line 1633 of file LutScanner.cpp.

1634 {
1635  free( (char *) ptr ); /* see Lutrealloc() for (char *) cast */
1636 }

+ Here is the caller graph for this function:

void * Lutrealloc ( void *  ptr,
yy_size_t  size 
)

Definition at line 1621 of file LutScanner.cpp.

1622 {
1623  /* The cast to (char *) in the following accommodates both
1624  * implementations that use char* generic pointers, and those
1625  * that use void* generic pointers. It works with the latter
1626  * because both ANSI C and C++ allow castless assignment from
1627  * any pointer type to void*, and deal with argument conversions
1628  * as though doing an assignment.
1629  */
1630  return (void *) realloc( (char *) ptr, size );
1631 }

+ Here is the caller graph for this function:

yylloc step ( )

Code belonging at the beginning of yylex().

while ( )

Definition at line 624 of file LutScanner.cpp.

625  {
626  yy_cp = (yy_c_buf_p);
627 
628  /* Support of yytext. */
629  *yy_cp = (yy_hold_char);
630 
631  /* yy_bp points to the position in yy_ch_buf of the start of
632  * the current run.
633  */
634  yy_bp = yy_cp;
635 
636  yy_current_state = (yy_start);
637 yy_match:
638  do
639  {
640  register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
642  {
643  (yy_last_accepting_state) = yy_current_state;
644  (yy_last_accepting_cpos) = yy_cp;
645  }
646  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
647  {
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];
651  }
652  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
653  ++yy_cp;
654  }
655  while ( yy_current_state != 18 );
656  yy_cp = (yy_last_accepting_cpos);
657  yy_current_state = (yy_last_accepting_state);
658 
659 yy_find_action:
661 
663 
664 do_action: /* This label is used only to access EOF actions. */
665 
666  switch ( yy_act )
667  { /* beginning of action switch */
668  case 0: /* must back up */
669  /* undo the effects of YY_DO_BEFORE_ACTION */
670  *yy_cp = (yy_hold_char);
671  yy_cp = (yy_last_accepting_cpos);
672  yy_current_state = (yy_last_accepting_state);
673  goto yy_find_action;
674 
675 case 1:
677 #line 103 "scanner.ll"
678 { *yylval = yytext; return token::VAR; }
679  YY_BREAK
680 case 2:
682 #line 104 "scanner.ll"
683 { }
684  YY_BREAK
685 case 3:
687 #line 105 "scanner.ll"
688 { return token::LP; }
689  YY_BREAK
690 case 4:
692 #line 106 "scanner.ll"
693 { return token::RP; }
694  YY_BREAK
695 case 5:
697 #line 107 "scanner.ll"
698 { *yylval = "NOT"; return token::NOT; }
699  YY_BREAK
700 case 6:
702 #line 108 "scanner.ll"
703 { *yylval = "OR"; return token::OR;}
704  YY_BREAK
705 case 7:
707 #line 109 "scanner.ll"
708 { *yylval = "AND"; return token::AND;}
709  YY_BREAK
710 case 8:
712 #line 110 "scanner.ll"
713 { *yylval = "XOR"; return token::XOR;}
714  YY_BREAK
715 case 9:
716 /* rule 9 can match eol */
718 #line 111 "scanner.ll"
719 { }
720  YY_BREAK
721 case 10:
723 #line 112 "scanner.ll"
724 { *yylval = yytext; return token::VAR; }
725  YY_BREAK
726 case 11:
728 #line 113 "scanner.ll"
729 { std::cout << "Flex Unrecognised token!" << std::endl; exit (-1); }
730  YY_BREAK
731 /* ---------------------------------------------------------------------------------------------- */
732 /* ------------------------------------- End XDL lexer rules ------------------------------------ */
733 /* ---------------------------------------------------------------------------------------------- */
734 case 12:
736 #line 121 "scanner.ll"
737 ECHO;
738  YY_BREAK
739 #line 740 "LutScanner.cpp"
740 case YY_STATE_EOF(INITIAL):
741  yyterminate();
742 
743  case YY_END_OF_BUFFER:
744  {
745  /* Amount of text matched not including the EOB char. */
746  int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
747 
748  /* Undo the effects of YY_DO_BEFORE_ACTION. */
749  *yy_cp = (yy_hold_char);
751 
752  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
753  {
754  /* We're scanning a new file or input source. It's
755  * possible that this happened because the user
756  * just pointed yyin at a new source and called
757  * yylex(). If so, then we have to assure
758  * consistency between YY_CURRENT_BUFFER and our
759  * globals. Here is the right place to do so, because
760  * this is the first action (other than possibly a
761  * back-up) that will match for the new input source.
762  */
763  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
764  YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
765  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
766  }
767 
768  /* Note that here we test for yy_c_buf_p "<=" to the position
769  * of the first EOB in the buffer, since yy_c_buf_p will
770  * already have been incremented past the NUL character
771  * (since all states make transitions on EOB to the
772  * end-of-buffer state). Contrast this with the test
773  * in input().
774  */
775  if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
776  { /* This was really a NUL. */
777  yy_state_type yy_next_state;
778 
779  (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
780 
781  yy_current_state = yy_get_previous_state( );
782 
783  /* Okay, we're now positioned to make the NUL
784  * transition. We couldn't have
785  * yy_get_previous_state() go ahead and do it
786  * for us because it doesn't know how to deal
787  * with the possibility of jamming (and we don't
788  * want to build jamming into it because then it
789  * will run more slowly).
790  */
791 
792  yy_next_state = yy_try_NUL_trans( yy_current_state );
793 
795 
796  if ( yy_next_state )
797  {
798  /* Consume the NUL. */
799  yy_cp = ++(yy_c_buf_p);
800  yy_current_state = yy_next_state;
801  goto yy_match;
802  }
803 
804  else
805  {
806  yy_cp = (yy_last_accepting_cpos);
807  yy_current_state = (yy_last_accepting_state);
808  goto yy_find_action;
809  }
810  }
811 
812  else switch ( yy_get_next_buffer( ) )
813  {
814  case EOB_ACT_END_OF_FILE:
815  {
816  (yy_did_buffer_switch_on_eof) = 0;
817 
818  if ( yywrap( ) )
819  {
820  /* Note: because we've taken care in
821  * yy_get_next_buffer() to have set up
822  * yytext, we can now set up
823  * yy_c_buf_p so that if some total
824  * hoser (like flex itself) wants to
825  * call the scanner after we return the
826  * YY_NULL, it'll still work - another
827  * YY_NULL will get returned.
828  */
829  (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
830 
832  goto do_action;
833  }
834 
835  else
836  {
837  if ( ! (yy_did_buffer_switch_on_eof) )
838  YY_NEW_FILE;
839  }
840  break;
841  }
842 
844  (yy_c_buf_p) =
845  (yytext_ptr) + yy_amount_of_matched_text;
846 
847  yy_current_state = yy_get_previous_state( );
848 
849  yy_cp = (yy_c_buf_p);
851  goto yy_match;
852 
853  case EOB_ACT_LAST_MATCH:
854  (yy_c_buf_p) =
855  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
856 
857  yy_current_state = yy_get_previous_state( );
858 
859  yy_cp = (yy_c_buf_p);
861  goto yy_find_action;
862  }
863  break;
864  }
865 
866  default:
868  "fatal flex scanner internal error--no action found" );
869  } /* end of action switch */
870  } /* end of scanning one token */
#define YY_CURRENT_BUFFER_LVALUE
Definition: LutScanner.cpp:275
static yyconst flex_int16_t yy_accept[19]
Definition: LutScanner.cpp:332
static yyconst flex_int16_t yy_nxt[32]
Definition: LutScanner.cpp:388
#define ECHO
Definition: LutScanner.cpp:511
#define EOB_ACT_CONTINUE_SCAN
Definition: LutScanner.cpp:169
#define YY_FATAL_ERROR(msg)
Definition: LutScanner.cpp:540
#define YY_NEW_FILE
Definition: LutScanner.cpp:149
#define yyterminate()
Definition: LutScanner.cpp:453
#define yytext_ptr
Definition: LutScanner.cpp:309
#define YY_RULE_SETUP
Definition: LutScanner.cpp:565
#define YY_SC_TO_UI(c)
Definition: LutScanner.cpp:130
#define EOB_ACT_LAST_MATCH
Definition: LutScanner.cpp:171
register int yy_act
Definition: LutScanner.cpp:574
static yyconst flex_int16_t yy_base[20]
Definition: LutScanner.cpp:376
#define YY_START
Definition: LutScanner.cpp:142
#define YY_STATE_EOF(state)
Definition: LutScanner.cpp:146
#define YY_BUFFER_NORMAL
Definition: LutScanner.cpp:246
#define YY_DO_BEFORE_ACTION
Definition: LutScanner.cpp:316
static yyconst flex_int16_t yy_chk[32]
Definition: LutScanner.cpp:396
YY_DECL register yy_state_type yy_current_state
Definition: LutScanner.cpp:572
static yyconst flex_int16_t yy_def[20]
Definition: LutScanner.cpp:382
#define EOB_ACT_END_OF_FILE
Definition: LutScanner.cpp:170
#define YY_END_OF_BUFFER
Definition: LutScanner.cpp:324
static yyconst flex_int32_t yy_ec[256]
Definition: LutScanner.cpp:338
#define YY_RESTORE_YY_MORE_OFFSET
Definition: LutScanner.cpp:410
#define INITIAL
Definition: LutScanner.cpp:478
#define YY_BUFFER_NEW
Definition: LutScanner.cpp:245
static yyconst flex_int32_t yy_meta[14]
Definition: LutScanner.cpp:370
register char * yy_cp
Definition: LutScanner.cpp:573
register char * yy_bp
Definition: LutScanner.cpp:573
#define YY_BREAK
Definition: LutScanner.cpp:562
unsigned char YY_CHAR
Bison lexer internals.
Definition: LutScanner.cpp:307
#define YY_MORE_ADJ
Definition: LutScanner.cpp:409

Variable Documentation

yyconst flex_int16_t yy_accept[19]
static
Initial value:
=
{ 0,
0, 0, 13, 11, 9, 9, 3, 4, 7, 6,
10, 2, 8, 11, 5, 10, 1, 0
}

Definition at line 332 of file LutScanner.cpp.

register int yy_act

Definition at line 574 of file LutScanner.cpp.

yyconst flex_int16_t yy_base[20]
static
Initial value:
=
{ 0,
0, 0, 17, 18, 18, 18, 18, 18, 18, 18,
8, 18, 18, 0, 18, 7, 18, 18, 12
}

Definition at line 376 of file LutScanner.cpp.

register char * yy_bp

Definition at line 573 of file LutScanner.cpp.

yyconst flex_int16_t yy_chk[32]
static
Initial value:
=
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 19, 16, 11, 3, 18, 18, 18,
18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
18
}

Definition at line 396 of file LutScanner.cpp.

register char* yy_cp

Definition at line 573 of file LutScanner.cpp.

YY_DECL register yy_state_type yy_current_state

The main scanner function which does all the work.

Definition at line 572 of file LutScanner.cpp.

yyconst flex_int16_t yy_def[20]
static
Initial value:
=
{ 0,
18, 1, 18, 18, 18, 18, 18, 18, 18, 18,
18, 18, 18, 19, 18, 18, 18, 0, 18
}

Definition at line 382 of file LutScanner.cpp.

yyconst flex_int32_t yy_ec[256]
static

Definition at line 338 of file LutScanner.cpp.

yyconst flex_int32_t yy_meta[14]
static
Initial value:
=
{ 0,
1, 1, 1, 1, 1, 1, 1, 2, 2, 1,
1, 1, 1
}

Definition at line 370 of file LutScanner.cpp.

yyconst flex_int16_t yy_nxt[32]
static
Initial value:
=
{ 0,
4, 5, 6, 7, 8, 9, 10, 11, 4, 12,
13, 14, 15, 17, 16, 16, 18, 3, 18, 18,
18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
18
}

Definition at line 388 of file LutScanner.cpp.

int yyleng

Bison lexer internals.