g2o
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
yyFlexLexer Class Reference

#include <FlexLexer.h>

Inheritance diagram for yyFlexLexer:
Inheritance graph
[legend]
Collaboration diagram for yyFlexLexer:
Collaboration graph
[legend]

Public Member Functions

 yyFlexLexer (std::istream &arg_yyin, std::ostream &arg_yyout)
 
 yyFlexLexer (std::istream *arg_yyin=0, std::ostream *arg_yyout=0)
 
virtual ~yyFlexLexer ()
 
void yy_switch_to_buffer (yy_buffer_state *new_buffer)
 
yy_buffer_stateyy_create_buffer (std::istream *s, int size)
 
yy_buffer_stateyy_create_buffer (std::istream &s, int size)
 
void yy_delete_buffer (yy_buffer_state *b)
 
void yyrestart (std::istream *s)
 
void yyrestart (std::istream &s)
 
void yypush_buffer_state (yy_buffer_state *new_buffer)
 
void yypop_buffer_state ()
 
virtual int yylex ()
 
virtual void switch_streams (std::istream &new_in, std::ostream &new_out)
 
virtual void switch_streams (std::istream *new_in=0, std::ostream *new_out=0)
 
virtual int yywrap ()
 
- Public Member Functions inherited from FlexLexer
virtual ~FlexLexer ()
 
const char * YYText () const
 
int YYLeng () const
 
int yylex (std::istream &new_in, std::ostream &new_out)
 
int yylex (std::istream *new_in, std::ostream *new_out=0)
 
int lineno () const
 
int debug () const
 
void set_debug (int flag)
 

Protected Member Functions

virtual int LexerInput (char *buf, int max_size)
 
virtual void LexerOutput (const char *buf, int size)
 
virtual void LexerError (const char *msg)
 
void yyunput (int c, char *buf_ptr)
 
int yyinput ()
 
void yy_load_buffer_state ()
 
void yy_init_buffer (yy_buffer_state *b, std::istream &s)
 
void yy_flush_buffer (yy_buffer_state *b)
 
void yy_push_state (int new_state)
 
void yy_pop_state ()
 
int yy_top_state ()
 
yy_state_type yy_get_previous_state ()
 
yy_state_type yy_try_NUL_trans (yy_state_type current_state)
 
int yy_get_next_buffer ()
 
void yyensure_buffer_stack (void)
 

Protected Attributes

int yy_start_stack_ptr
 
int yy_start_stack_depth
 
int * yy_start_stack
 
std::istream yyin
 
std::ostream yyout
 
char yy_hold_char
 
int yy_n_chars
 
char * yy_c_buf_p
 
int yy_init
 
int yy_start
 
int yy_did_buffer_switch_on_eof
 
size_t yy_buffer_stack_top
 
size_t yy_buffer_stack_max
 
yy_buffer_state ** yy_buffer_stack
 
yy_state_type yy_last_accepting_state
 
char * yy_last_accepting_cpos
 
yy_state_typeyy_state_buf
 
yy_state_typeyy_state_ptr
 
char * yy_full_match
 
int * yy_full_state
 
int yy_full_lp
 
int yy_lp
 
int yy_looking_for_trail_begin
 
int yy_more_flag
 
int yy_more_len
 
int yy_more_offset
 
int yy_prev_more_offset
 
- Protected Attributes inherited from FlexLexer
char * yytext
 
int yyleng
 
int yylineno
 
int yy_flex_debug
 

Private Member Functions

void ctor_common ()
 

Detailed Description

Definition at line 112 of file FlexLexer.h.

Constructor & Destructor Documentation

◆ yyFlexLexer() [1/2]

yyFlexLexer::yyFlexLexer ( std::istream &  arg_yyin,
std::ostream &  arg_yyout 
)

Definition at line 895 of file flex_scanner.cpp.

896 : yyin(arg_yyin.rdbuf()), yyout(arg_yyout.rdbuf()) {
897 ctor_common();
898}
std::ostream yyout
Definition FlexLexer.h:166
std::istream yyin
Definition FlexLexer.h:165

References ctor_common(), and yyFlexLexer().

Referenced by yyFlexLexer(), and yyFlexLexer().

◆ yyFlexLexer() [2/2]

yyFlexLexer::yyFlexLexer ( std::istream *  arg_yyin = 0,
std::ostream *  arg_yyout = 0 
)

Definition at line 887 of file flex_scanner.cpp.

888 : yyin(arg_yyin ? arg_yyin->rdbuf() : std::cin.rdbuf()),
889 yyout(arg_yyout ? arg_yyout->rdbuf() : std::cout.rdbuf()) {
890 ctor_common();
891}
Definition jet.h:876

References ctor_common(), and yyFlexLexer().

◆ ~yyFlexLexer()

yyFlexLexer::~yyFlexLexer ( )
virtual

Definition at line 928 of file flex_scanner.cpp.

928 {
929 delete[] yy_state_buf;
930 yyfree(yy_start_stack);
932 yyfree(yy_buffer_stack);
933}
yy_state_type * yy_state_buf
Definition FlexLexer.h:195
void yy_delete_buffer(yy_buffer_state *b)
#define yyfree
#define YY_CURRENT_BUFFER

References yy_buffer_stack, YY_CURRENT_BUFFER, yy_delete_buffer(), yy_start_stack, yy_state_buf, yyfree, and ~yyFlexLexer().

Referenced by ~yyFlexLexer().

Member Function Documentation

◆ ctor_common()

void yyFlexLexer::ctor_common ( )
private

Definition at line 902 of file flex_scanner.cpp.

902 {
903 yy_c_buf_p = 0;
904 yy_init = 0;
905 yy_start = 0;
906 yy_flex_debug = 0;
907 yylineno = 1; // this will only get updated if %option yylineno
908
910
912 yy_more_flag = 0;
913 yy_more_len = 0;
915
917 yy_start_stack = NULL;
918
919 yy_buffer_stack = NULL;
922
923 yy_state_buf = 0;
924}
int yylineno
Definition FlexLexer.h:98
char * yy_c_buf_p
Definition FlexLexer.h:175
int yy_start_stack_depth
Definition FlexLexer.h:154
int yy_more_flag
Definition FlexLexer.h:205
int yy_start_stack_ptr
Definition FlexLexer.h:153
yy_buffer_state ** yy_buffer_stack
Definition FlexLexer.h:186
int yy_more_len
Definition FlexLexer.h:206
int * yy_start_stack
Definition FlexLexer.h:155
int yy_looking_for_trail_begin
Definition FlexLexer.h:203
size_t yy_buffer_stack_top
Definition FlexLexer.h:184
size_t yy_buffer_stack_max
Definition FlexLexer.h:185
int yy_more_offset
Definition FlexLexer.h:207
int yy_prev_more_offset
Definition FlexLexer.h:208
int yy_did_buffer_switch_on_eof
Definition FlexLexer.h:182
std::ostream out yy_flex_debug
Definition scanner.l:148

References ctor_common(), yy_buffer_stack, yy_buffer_stack_max, yy_buffer_stack_top, yy_c_buf_p, yy_did_buffer_switch_on_eof, yy_flex_debug, yy_init, yy_looking_for_trail_begin, yy_more_flag, yy_more_len, yy_more_offset, yy_prev_more_offset, yy_start, yy_start_stack, yy_start_stack_depth, yy_start_stack_ptr, yy_state_buf, and FlexLexer::yylineno.

Referenced by ctor_common(), yyFlexLexer(), and yyFlexLexer().

◆ LexerError()

void yyFlexLexer::LexerError ( const char *  msg)
protectedvirtual

Definition at line 1555 of file flex_scanner.cpp.

1555 {
1556 std::cerr << msg << std::endl;
1557 exit(YY_EXIT_FAILURE);
1558}
#define YY_EXIT_FAILURE

References LexerError(), and YY_EXIT_FAILURE.

Referenced by LexerError(), and yywrap().

◆ LexerInput()

int yyFlexLexer::LexerInput ( char *  buf,
int  max_size 
)
protectedvirtual

Definition at line 963 of file flex_scanner.cpp.

965{
966 if (yyin.eof() || yyin.fail()) return 0;
967
968#ifdef YY_INTERACTIVE
969 yyin.get(buf[0]);
970
971 if (yyin.eof()) return 0;
972
973 if (yyin.bad()) return -1;
974
975 return 1;
976
977#else
978 (void)yyin.read(buf, max_size);
979
980 if (yyin.bad())
981 return -1;
982 else
983 return yyin.gcount();
984#endif
985}

References LexerInput().

Referenced by LexerInput(), and yywrap().

◆ LexerOutput()

void yyFlexLexer::LexerOutput ( const char *  buf,
int  size 
)
protectedvirtual

Definition at line 987 of file flex_scanner.cpp.

987 {
988 (void)yyout.write(buf, size);
989}

References LexerOutput(), and yyout.

Referenced by LexerOutput(), and yywrap().

◆ switch_streams() [1/2]

void yyFlexLexer::switch_streams ( std::istream &  new_in,
std::ostream &  new_out 
)
virtual

Implements FlexLexer.

Definition at line 937 of file flex_scanner.cpp.

937 {
938 // was if( new_in )
941
942 // was if( new_out )
943 yyout.rdbuf(new_out.rdbuf());
944}
void yy_switch_to_buffer(yy_buffer_state *new_buffer)
yy_buffer_state * yy_create_buffer(std::istream *s, int size)
#define YY_BUF_SIZE

References switch_streams(), YY_BUF_SIZE, yy_create_buffer(), YY_CURRENT_BUFFER, yy_delete_buffer(), yy_switch_to_buffer(), and yyout.

Referenced by switch_streams(), switch_streams(), and yylex().

◆ switch_streams() [2/2]

void yyFlexLexer::switch_streams ( std::istream *  new_in = 0,
std::ostream *  new_out = 0 
)
virtual

Implements FlexLexer.

Definition at line 948 of file flex_scanner.cpp.

948 {
949 if (!new_in) {
950 new_in = &yyin;
951 }
952
953 if (!new_out) {
954 new_out = &yyout;
955 }
956
957 switch_streams(*new_in, *new_out);
958}
virtual void switch_streams(std::istream &new_in, std::ostream &new_out)

References switch_streams(), yyin, and yyout.

◆ yy_create_buffer() [1/2]

YY_BUFFER_STATE yyFlexLexer::yy_create_buffer ( std::istream &  file,
int  size 
)
virtual

Allocate and initialize an input buffer state.

Parameters
fileA readable stream.
sizeThe character buffer size in bytes. When in doubt, use YY_BUF_SIZE.
Returns
the allocated buffer state.

Implements FlexLexer.

Definition at line 1331 of file flex_scanner.cpp.

1331 {
1333
1334 b = (YY_BUFFER_STATE)yyalloc(sizeof(struct yy_buffer_state));
1335 if (!b) YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()");
1336
1337 b->yy_buf_size = size;
1338
1339 /* yy_ch_buf has to be 2 characters longer than the size given because
1340 * we need to put in 2 end-of-buffer characters.
1341 */
1342 b->yy_ch_buf = (char*)yyalloc((yy_size_t)(b->yy_buf_size + 2));
1343 if (!b->yy_ch_buf)
1344 YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()");
1345
1346 b->yy_is_our_buffer = 1;
1347
1348 yy_init_buffer(b, file);
1349
1350 return b;
1351}
void yy_init_buffer(yy_buffer_state *b, std::istream &s)
struct yy_buffer_state * YY_BUFFER_STATE
#define yyalloc
#define YY_FATAL_ERROR(msg)
size_t yy_size_t

References yy_buffer_state::yy_buf_size, yy_buffer_state::yy_ch_buf, yy_create_buffer(), YY_FATAL_ERROR, yy_init_buffer(), yy_buffer_state::yy_is_our_buffer, and yyalloc.

◆ yy_create_buffer() [2/2]

YY_BUFFER_STATE yyFlexLexer::yy_create_buffer ( std::istream *  file,
int  size 
)
virtual

Delegate creation of buffers to the new version that takes an istream reference.

Parameters
fileA readable stream.
sizeThe character buffer size in bytes. When in doubt, use YY_BUF_SIZE.
Returns
the allocated buffer state.

Implements FlexLexer.

Definition at line 1361 of file flex_scanner.cpp.

1361 {
1362 return yy_create_buffer(*file, size);
1363}

References yy_create_buffer().

Referenced by switch_streams(), yy_create_buffer(), yy_create_buffer(), and yyrestart().

◆ yy_delete_buffer()

void yyFlexLexer::yy_delete_buffer ( yy_buffer_state b)
virtual

Destroy the buffer.

Parameters
ba buffer created with yy_create_buffer()

Implements FlexLexer.

Definition at line 1369 of file flex_scanner.cpp.

1369 {
1370 if (!b) return;
1371
1372 if (b == YY_CURRENT_BUFFER) /* Not sure if we should pop here. */
1374
1375 if (b->yy_is_our_buffer) yyfree((void*)b->yy_ch_buf);
1376
1377 yyfree((void*)b);
1378}
#define YY_CURRENT_BUFFER_LVALUE

References yy_buffer_state::yy_ch_buf, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yy_delete_buffer(), yy_buffer_state::yy_is_our_buffer, and yyfree.

Referenced by switch_streams(), yy_delete_buffer(), yypop_buffer_state(), and ~yyFlexLexer().

◆ yy_flush_buffer()

void yyFlexLexer::yy_flush_buffer ( yy_buffer_state b)
protected

Discard all buffered characters. On the next scan, YY_INPUT will be called.

Parameters
bthe buffer state to be flushed, usually YY_CURRENT_BUFFER.

Definition at line 1411 of file flex_scanner.cpp.

1411 {
1412 if (!b) return;
1413
1414 b->yy_n_chars = 0;
1415
1416 /* We always need two end-of-buffer characters. The first causes
1417 * a transition to the end-of-buffer state. The second causes
1418 * a jam in that state.
1419 */
1422
1423 b->yy_buf_pos = &b->yy_ch_buf[0];
1424
1425 b->yy_at_bol = 1;
1427
1429}
void yy_load_buffer_state()
#define YY_BUFFER_NEW
#define YY_END_OF_BUFFER_CHAR

References yy_buffer_state::yy_at_bol, yy_buffer_state::yy_buf_pos, YY_BUFFER_NEW, yy_buffer_state::yy_buffer_status, yy_buffer_state::yy_ch_buf, YY_CURRENT_BUFFER, YY_END_OF_BUFFER_CHAR, yy_flush_buffer(), yy_load_buffer_state(), and yy_buffer_state::yy_n_chars.

Referenced by yy_flush_buffer(), yy_init_buffer(), and yywrap().

◆ yy_get_next_buffer()

int yyFlexLexer::yy_get_next_buffer ( )
protected

Definition at line 998 of file flex_scanner.cpp.

998 {
999 char* dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1000 char* source = (yytext_ptr);
1001 int number_to_move, i;
1002 int ret_val;
1003
1004 if ((yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1])
1005 YY_FATAL_ERROR("fatal flex scanner internal error--end of buffer missed");
1006
1007 if (YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer ==
1008 0) { /* Don't try to fill the buffer, so this is an EOF. */
1009 if ((yy_c_buf_p) - (yytext_ptr)-YY_MORE_ADJ == 1) {
1010 /* We matched a single character, the EOB, so
1011 * treat this as a final EOF.
1012 */
1013 return EOB_ACT_END_OF_FILE;
1014 }
1015
1016 else {
1017 /* We matched some text prior to the EOB, first
1018 * process it.
1019 */
1020 return EOB_ACT_LAST_MATCH;
1021 }
1022 }
1023
1024 /* Try to read more data. */
1025
1026 /* First move last chars to start of buffer. */
1027 number_to_move = (int)((yy_c_buf_p) - (yytext_ptr)-1);
1028
1029 for (i = 0; i < number_to_move; ++i) *(dest++) = *(source++);
1030
1031 if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING)
1032 /* don't do the read, it's not guaranteed to return an EOF,
1033 * just force an EOF
1034 */
1035 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1036
1037 else {
1038 int num_to_read =
1039 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1040
1041 while (num_to_read <= 0) { /* Not enough room in the buffer - grow it. */
1042
1043 /* just a shorter name for the current buffer */
1045
1046 int yy_c_buf_p_offset = (int)((yy_c_buf_p)-b->yy_ch_buf);
1047
1048 if (b->yy_is_our_buffer) {
1049 int new_size = b->yy_buf_size * 2;
1050
1051 if (new_size <= 0)
1052 b->yy_buf_size += b->yy_buf_size / 8;
1053 else
1054 b->yy_buf_size *= 2;
1055
1056 b->yy_ch_buf = (char*)
1057 /* Include room in for 2 EOB chars. */
1058 yyrealloc((void*)b->yy_ch_buf, (yy_size_t)(b->yy_buf_size + 2));
1059 } else
1060 /* Can't grow it, we don't own it. */
1061 b->yy_ch_buf = NULL;
1062
1063 if (!b->yy_ch_buf)
1064 YY_FATAL_ERROR("fatal error - scanner input buffer overflow");
1065
1066 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1067
1068 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1069 }
1070
1071 if (num_to_read > YY_READ_BUF_SIZE) num_to_read = YY_READ_BUF_SIZE;
1072
1073 /* Read in more data. */
1074 YY_INPUT((&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1075 (yy_n_chars), num_to_read);
1076
1077 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1078 }
1079
1080 if ((yy_n_chars) == 0) {
1081 if (number_to_move == YY_MORE_ADJ) {
1082 ret_val = EOB_ACT_END_OF_FILE;
1083 yyrestart(yyin);
1084 }
1085
1086 else {
1087 ret_val = EOB_ACT_LAST_MATCH;
1089 }
1090 }
1091
1092 else
1093 ret_val = EOB_ACT_CONTINUE_SCAN;
1094
1095 if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1096 /* Extend the array by 50%, plus the number we really need. */
1097 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1098 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char*)yyrealloc(
1099 (void*)YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t)new_size);
1100 if (!YY_CURRENT_BUFFER_LVALUE->yy_ch_buf)
1101 YY_FATAL_ERROR("out of dynamic memory in yy_get_next_buffer()");
1102 /* "- 2" to take care of EOB's */
1103 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int)(new_size - 2);
1104 }
1105
1106 (yy_n_chars) += number_to_move;
1109
1110 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1111
1112 return ret_val;
1113}
void yyrestart(std::istream *s)
#define YY_MORE_ADJ
#define yytext_ptr
#define EOB_ACT_END_OF_FILE
#define YY_READ_BUF_SIZE
#define YY_INPUT(buf, result, max_size)
#define yyrealloc
#define EOB_ACT_LAST_MATCH
#define YY_BUFFER_EOF_PENDING
#define EOB_ACT_CONTINUE_SCAN

References EOB_ACT_CONTINUE_SCAN, EOB_ACT_END_OF_FILE, EOB_ACT_LAST_MATCH, yy_buffer_state::yy_buf_size, YY_BUFFER_EOF_PENDING, yy_c_buf_p, yy_buffer_state::yy_ch_buf, YY_CURRENT_BUFFER_LVALUE, YY_END_OF_BUFFER_CHAR, YY_FATAL_ERROR, yy_get_next_buffer(), YY_INPUT, yy_buffer_state::yy_is_our_buffer, YY_MORE_ADJ, yy_n_chars, YY_READ_BUF_SIZE, yyin, yyrealloc, yyrestart(), and yytext_ptr.

Referenced by yy_get_next_buffer(), and yyinput().

◆ yy_get_previous_state()

yy_state_type yyFlexLexer::yy_get_previous_state ( )
protected

Definition at line 1117 of file flex_scanner.cpp.

1117 {
1118 yy_state_type yy_current_state;
1119 char* yy_cp;
1120
1121 yy_current_state = (yy_start);
1122
1123 for (yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp) {
1124 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1125 if (yy_accept[yy_current_state]) {
1126 (yy_last_accepting_state) = yy_current_state;
1128 }
1129 while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) {
1130 yy_current_state = (int)yy_def[yy_current_state];
1131 if (yy_current_state >= 77) yy_c = yy_meta[yy_c];
1132 }
1133 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1134 }
1135
1136 return yy_current_state;
1137}
int yy_state_type
Definition FlexLexer.h:56
char * yy_last_accepting_cpos
Definition FlexLexer.h:193
yy_state_type yy_last_accepting_state
Definition FlexLexer.h:192
static const flex_int16_t yy_base[78]
char * yy_cp
static const flex_int16_t yy_nxt[220]
static const flex_int16_t yy_def[78]
static const flex_int16_t yy_chk[220]
flex_uint8_t YY_CHAR
static const YY_CHAR yy_ec[256]
static const YY_CHAR yy_meta[47]
static const flex_int16_t yy_accept[77]
#define YY_SC_TO_UI(c)

References yy_accept, yy_base, yy_c_buf_p, yy_chk, yy_cp, yy_def, yy_ec, yy_get_previous_state(), yy_last_accepting_cpos, yy_last_accepting_state, yy_meta, YY_MORE_ADJ, yy_nxt, YY_SC_TO_UI, yy_start, and yytext_ptr.

Referenced by yy_get_previous_state().

◆ yy_init_buffer()

void yyFlexLexer::yy_init_buffer ( yy_buffer_state b,
std::istream &  s 
)
protected

Definition at line 1384 of file flex_scanner.cpp.

1386{
1387 int oerrno = errno;
1388
1389 yy_flush_buffer(b);
1390
1391 b->yy_input_file = file.rdbuf();
1392 b->yy_fill_buffer = 1;
1393
1394 /* If b is the current buffer, then yy_init_buffer was _probably_
1395 * called from yyrestart() or through yy_get_next_buffer.
1396 * In that case, we don't want to reset the lineno or column.
1397 */
1398 if (b != YY_CURRENT_BUFFER) {
1399 b->yy_bs_lineno = 1;
1400 b->yy_bs_column = 0;
1401 }
1402
1403 b->yy_is_interactive = 0;
1404 errno = oerrno;
1405}
void yy_flush_buffer(yy_buffer_state *b)
std::streambuf * yy_input_file

References yy_buffer_state::yy_bs_column, yy_buffer_state::yy_bs_lineno, YY_CURRENT_BUFFER, yy_buffer_state::yy_fill_buffer, yy_flush_buffer(), yy_init_buffer(), yy_buffer_state::yy_input_file, and yy_buffer_state::yy_is_interactive.

Referenced by yy_create_buffer(), yy_init_buffer(), yyrestart(), and yywrap().

◆ yy_load_buffer_state()

void yyFlexLexer::yy_load_buffer_state ( )
protected

◆ yy_pop_state()

void yyFlexLexer::yy_pop_state ( )
protected

Definition at line 1540 of file flex_scanner.cpp.

1540 {
1541 if (--(yy_start_stack_ptr) < 0)
1542 YY_FATAL_ERROR("start-condition stack underflow");
1543
1544 BEGIN((yy_start_stack)[(yy_start_stack_ptr)]);
1545}
#define BEGIN

References BEGIN, YY_FATAL_ERROR, yy_pop_state(), yy_start_stack, and yy_start_stack_ptr.

Referenced by yy_pop_state().

◆ yy_push_state()

void yyFlexLexer::yy_push_state ( int  new_state)
protected

Definition at line 1518 of file flex_scanner.cpp.

1518 {
1519 if ((yy_start_stack_ptr) >= (yy_start_stack_depth)) {
1520 yy_size_t new_size;
1521
1523 new_size = (yy_size_t)(yy_start_stack_depth) * sizeof(int);
1524
1525 if (!(yy_start_stack))
1526 (yy_start_stack) = (int*)yyalloc(new_size);
1527
1528 else
1529 (yy_start_stack) = (int*)yyrealloc((void*)(yy_start_stack), new_size);
1530
1531 if (!(yy_start_stack))
1532 YY_FATAL_ERROR("out of memory expanding start-condition stack");
1533 }
1534
1535 (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START;
1536
1537 BEGIN(_new_state);
1538}
#define YY_START_STACK_INCR
#define YY_START

References BEGIN, YY_FATAL_ERROR, yy_push_state(), YY_START, yy_start_stack, yy_start_stack_depth, YY_START_STACK_INCR, yy_start_stack_ptr, yyalloc, and yyrealloc.

Referenced by yy_push_state().

◆ yy_switch_to_buffer()

void yyFlexLexer::yy_switch_to_buffer ( yy_buffer_state new_buffer)
virtual

Switch to a different input buffer.

Parameters
new_bufferThe new input buffer.

Implements FlexLexer.

Definition at line 1290 of file flex_scanner.cpp.

1290 {
1291 /* TODO. We should be able to replace this entire function body
1292 * with
1293 * yypop_buffer_state();
1294 * yypush_buffer_state(new_buffer);
1295 */
1297 if (YY_CURRENT_BUFFER == new_buffer) return;
1298
1299 if (YY_CURRENT_BUFFER) {
1300 /* Flush out information for old buffer. */
1301 *(yy_c_buf_p) = (yy_hold_char);
1302 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1303 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1304 }
1305
1306 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1308
1309 /* We don't actually know whether we did this switch during
1310 * EOF (yywrap()) processing, but the only time this flag
1311 * is looked at is after yywrap() is called, so it's safe
1312 * to go ahead and always set it.
1313 */
1315}
void yyensure_buffer_stack(void)

References yy_c_buf_p, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yy_did_buffer_switch_on_eof, yy_hold_char, yy_load_buffer_state(), yy_n_chars, yy_switch_to_buffer(), and yyensure_buffer_stack().

Referenced by switch_streams(), and yy_switch_to_buffer().

◆ yy_top_state()

int yyFlexLexer::yy_top_state ( )
protected

Definition at line 1547 of file flex_scanner.cpp.

1547 {
1548 return (yy_start_stack)[(yy_start_stack_ptr)-1];
1549}

References yy_start_stack, yy_start_stack_ptr, and yy_top_state().

Referenced by yy_top_state().

◆ yy_try_NUL_trans()

yy_state_type yyFlexLexer::yy_try_NUL_trans ( yy_state_type  current_state)
protected

Definition at line 1144 of file flex_scanner.cpp.

1144 {
1145 int yy_is_jam;
1146 char* yy_cp = (yy_c_buf_p);
1147
1148 YY_CHAR yy_c = 1;
1149 if (yy_accept[yy_current_state]) {
1150 (yy_last_accepting_state) = yy_current_state;
1152 }
1153 while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state) {
1154 yy_current_state = (int)yy_def[yy_current_state];
1155 if (yy_current_state >= 77) yy_c = yy_meta[yy_c];
1156 }
1157 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1158 yy_is_jam = (yy_current_state == 76);
1159
1160 return yy_is_jam ? 0 : yy_current_state;
1161}

References yy_accept, yy_base, yy_c_buf_p, yy_chk, yy_cp, yy_def, yy_last_accepting_cpos, yy_last_accepting_state, yy_meta, yy_nxt, and yy_try_NUL_trans().

Referenced by yy_try_NUL_trans().

◆ yyensure_buffer_stack()

void yyFlexLexer::yyensure_buffer_stack ( void  )
protected

Definition at line 1479 of file flex_scanner.cpp.

1479 {
1480 yy_size_t num_to_alloc;
1481
1482 if (!(yy_buffer_stack)) {
1483 /* First allocation is just for 2 elements, since we don't know if this
1484 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1485 * immediate realloc on the next call.
1486 */
1487 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
1489 num_to_alloc * sizeof(struct yy_buffer_state*));
1490 if (!(yy_buffer_stack))
1491 YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()");
1492
1493 memset((yy_buffer_stack), 0,
1494 num_to_alloc * sizeof(struct yy_buffer_state*));
1495
1496 (yy_buffer_stack_max) = num_to_alloc;
1497 (yy_buffer_stack_top) = 0;
1498 return;
1499 }
1500
1501 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1) {
1502 /* Increase the buffer to prepare for a possible push. */
1503 yy_size_t grow_size = 8 /* arbitrary grow size */;
1504
1505 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1507 (yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*));
1508 if (!(yy_buffer_stack))
1509 YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()");
1510
1511 /* zero only the new slots.*/
1512 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0,
1513 grow_size * sizeof(struct yy_buffer_state*));
1514 (yy_buffer_stack_max) = num_to_alloc;
1515 }
1516}

References yy_buffer_stack, yy_buffer_stack_max, yy_buffer_stack_top, YY_FATAL_ERROR, yyalloc, yyensure_buffer_stack(), and yyrealloc.

Referenced by yy_switch_to_buffer(), yyensure_buffer_stack(), yypush_buffer_state(), and yyrestart().

◆ yyinput()

int yyFlexLexer::yyinput ( )
protected

Definition at line 1199 of file flex_scanner.cpp.

1199 {
1200 int c;
1201
1202 *(yy_c_buf_p) = (yy_hold_char);
1203
1204 if (*(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR) {
1205 /* yy_c_buf_p now points to the character we want to return.
1206 * If this occurs *before* the EOB characters, then it's a
1207 * valid NUL; if not, then we've hit the end of the buffer.
1208 */
1209 if ((yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)])
1210 /* This was really a NUL. */
1211 *(yy_c_buf_p) = '\0';
1212
1213 else { /* need more input */
1214 int offset = (int)((yy_c_buf_p) - (yytext_ptr));
1215 ++(yy_c_buf_p);
1216
1217 switch (yy_get_next_buffer()) {
1218 case EOB_ACT_LAST_MATCH:
1219 /* This happens because yy_g_n_b()
1220 * sees that we've accumulated a
1221 * token and flags that we need to
1222 * try matching the token before
1223 * proceeding. But for input(),
1224 * there's no matching to consider.
1225 * So convert the EOB_ACT_LAST_MATCH
1226 * to EOB_ACT_END_OF_FILE.
1227 */
1228
1229 /* Reset buffer status. */
1230 yyrestart(yyin);
1231
1232 /*FALLTHROUGH*/
1233
1234 case EOB_ACT_END_OF_FILE: {
1235 if (yywrap()) return 0;
1236
1237 if (!(yy_did_buffer_switch_on_eof)) YY_NEW_FILE;
1238#ifdef __cplusplus
1239 return yyinput();
1240#else
1241 return input();
1242#endif
1243 }
1244
1246 (yy_c_buf_p) = (yytext_ptr) + offset;
1247 break;
1248 }
1249 }
1250 }
1251
1252 c = *(unsigned char*)(yy_c_buf_p); /* cast for 8-bit char's */
1253 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1254 (yy_hold_char) = *++(yy_c_buf_p);
1255
1256 return c;
1257}
virtual int yywrap()
int yy_get_next_buffer()
#define YY_NEW_FILE

References EOB_ACT_CONTINUE_SCAN, EOB_ACT_END_OF_FILE, EOB_ACT_LAST_MATCH, yy_c_buf_p, YY_CURRENT_BUFFER_LVALUE, yy_did_buffer_switch_on_eof, YY_END_OF_BUFFER_CHAR, yy_get_next_buffer(), yy_hold_char, yy_n_chars, YY_NEW_FILE, yyin, yyinput(), yyrestart(), yytext_ptr, and yywrap().

Referenced by yyinput(), and yywrap().

◆ yylex()

virtual int yyFlexLexer::yylex ( )
virtual

Implements FlexLexer.

References switch_streams().

◆ yypop_buffer_state()

void yyFlexLexer::yypop_buffer_state ( void  )

Removes and deletes the top of the stack, if present. The next element becomes the new top.

Definition at line 1463 of file flex_scanner.cpp.

1463 {
1464 if (!YY_CURRENT_BUFFER) return;
1465
1468 if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top);
1469
1470 if (YY_CURRENT_BUFFER) {
1473 }
1474}

References yy_buffer_stack_top, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yy_delete_buffer(), yy_did_buffer_switch_on_eof, yy_load_buffer_state(), and yypop_buffer_state().

Referenced by yypop_buffer_state().

◆ yypush_buffer_state()

void yyFlexLexer::yypush_buffer_state ( yy_buffer_state new_buffer)

Pushes the new state onto the stack. The new state becomes the current state. This function will allocate the stack if necessary.

Parameters
new_bufferThe new state.

Definition at line 1437 of file flex_scanner.cpp.

1437 {
1438 if (new_buffer == NULL) return;
1439
1441
1442 /* This block is copied from yy_switch_to_buffer. */
1443 if (YY_CURRENT_BUFFER) {
1444 /* Flush out information for old buffer. */
1445 *(yy_c_buf_p) = (yy_hold_char);
1446 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1447 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1448 }
1449
1450 /* Only push if top exists. Otherwise, replace top. */
1452 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1453
1454 /* copied from yy_switch_to_buffer. */
1457}

References yy_buffer_stack_top, yy_c_buf_p, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yy_did_buffer_switch_on_eof, yy_hold_char, yy_load_buffer_state(), yy_n_chars, yyensure_buffer_stack(), and yypush_buffer_state().

Referenced by yypush_buffer_state().

◆ yyrestart() [1/2]

void yyFlexLexer::yyrestart ( std::istream &  input_file)
virtual

Immediately switch to a different input stream.

Parameters
input_fileA readable stream.
Note
This function does not reset the start condition to INITIAL .

Implements FlexLexer.

Definition at line 1264 of file flex_scanner.cpp.

1264 {
1265 if (!YY_CURRENT_BUFFER) {
1268 }
1269
1270 yy_init_buffer(YY_CURRENT_BUFFER, input_file);
1272}

References YY_BUF_SIZE, yy_create_buffer(), YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yy_init_buffer(), yy_load_buffer_state(), yyensure_buffer_stack(), yyin, and yyrestart().

◆ yyrestart() [2/2]

void yyFlexLexer::yyrestart ( std::istream *  input_file)
virtual

Delegate to the new version that takes an istream reference.

Parameters
input_fileA readable stream.
Note
This function does not reset the start condition to INITIAL .

Implements FlexLexer.

Definition at line 1279 of file flex_scanner.cpp.

1279 {
1280 if (!input_file) {
1281 input_file = &yyin;
1282 }
1283 yyrestart(*input_file);
1284}

References yyin, and yyrestart().

Referenced by yy_get_next_buffer(), yyinput(), yyrestart(), and yyrestart().

◆ yyunput()

void yyFlexLexer::yyunput ( int  c,
char *  buf_ptr 
)
protected

Definition at line 1164 of file flex_scanner.cpp.

1164 {
1165 char* yy_cp;
1166
1167 yy_cp = (yy_c_buf_p);
1168
1169 /* undo effects of setting up yytext */
1170 *yy_cp = (yy_hold_char);
1171
1172 if (yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf +
1173 2) { /* need to shift things up to make room */
1174 /* +2 for EOB chars. */
1175 int number_to_move = (yy_n_chars) + 2;
1176 char* dest = &YY_CURRENT_BUFFER_LVALUE
1177 ->yy_ch_buf[YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1178 char* source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1179
1180 while (source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf) *--dest = *--source;
1181
1182 yy_cp += (int)(dest - source);
1183 yy_bp += (int)(dest - source);
1184 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) =
1185 (int)YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1186
1187 if (yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2)
1188 YY_FATAL_ERROR("flex scanner push-back overflow");
1189 }
1190
1191 *--yy_cp = (char)c;
1192
1193 (yytext_ptr) = yy_bp;
1194 (yy_hold_char) = *yy_cp;
1195 (yy_c_buf_p) = yy_cp;
1196}
char * yy_bp

References yy_bp, yy_c_buf_p, yy_cp, YY_CURRENT_BUFFER_LVALUE, YY_FATAL_ERROR, yy_hold_char, yy_n_chars, yytext_ptr, and yyunput().

Referenced by yyunput(), and yywrap().

◆ yywrap()

virtual int yyFlexLexer::yywrap ( )
virtual

Member Data Documentation

◆ yy_buffer_stack

yy_buffer_state** yyFlexLexer::yy_buffer_stack
protected

Stack as an array.

Definition at line 186 of file FlexLexer.h.

Referenced by ctor_common(), yyensure_buffer_stack(), and ~yyFlexLexer().

◆ yy_buffer_stack_max

size_t yyFlexLexer::yy_buffer_stack_max
protected

capacity of stack.

Definition at line 185 of file FlexLexer.h.

Referenced by ctor_common(), and yyensure_buffer_stack().

◆ yy_buffer_stack_top

size_t yyFlexLexer::yy_buffer_stack_top
protected

index of top of stack.

Definition at line 184 of file FlexLexer.h.

Referenced by ctor_common(), yyensure_buffer_stack(), yypop_buffer_state(), and yypush_buffer_state().

◆ yy_c_buf_p

char* yyFlexLexer::yy_c_buf_p
protected

◆ yy_did_buffer_switch_on_eof

int yyFlexLexer::yy_did_buffer_switch_on_eof
protected

◆ yy_full_lp

int yyFlexLexer::yy_full_lp
protected

Definition at line 200 of file FlexLexer.h.

◆ yy_full_match

char* yyFlexLexer::yy_full_match
protected

Definition at line 198 of file FlexLexer.h.

◆ yy_full_state

int* yyFlexLexer::yy_full_state
protected

Definition at line 199 of file FlexLexer.h.

◆ yy_hold_char

char yyFlexLexer::yy_hold_char
protected

◆ yy_init

int yyFlexLexer::yy_init
protected

Definition at line 177 of file FlexLexer.h.

Referenced by ctor_common().

◆ yy_last_accepting_cpos

char* yyFlexLexer::yy_last_accepting_cpos
protected

Definition at line 193 of file FlexLexer.h.

Referenced by yy_get_previous_state(), and yy_try_NUL_trans().

◆ yy_last_accepting_state

yy_state_type yyFlexLexer::yy_last_accepting_state
protected

Definition at line 192 of file FlexLexer.h.

Referenced by yy_get_previous_state(), and yy_try_NUL_trans().

◆ yy_looking_for_trail_begin

int yyFlexLexer::yy_looking_for_trail_begin
protected

Definition at line 203 of file FlexLexer.h.

Referenced by ctor_common().

◆ yy_lp

int yyFlexLexer::yy_lp
protected

Definition at line 202 of file FlexLexer.h.

◆ yy_more_flag

int yyFlexLexer::yy_more_flag
protected

Definition at line 205 of file FlexLexer.h.

Referenced by ctor_common().

◆ yy_more_len

int yyFlexLexer::yy_more_len
protected

Definition at line 206 of file FlexLexer.h.

Referenced by ctor_common().

◆ yy_more_offset

int yyFlexLexer::yy_more_offset
protected

Definition at line 207 of file FlexLexer.h.

Referenced by ctor_common().

◆ yy_n_chars

int yyFlexLexer::yy_n_chars
protected

◆ yy_prev_more_offset

int yyFlexLexer::yy_prev_more_offset
protected

Definition at line 208 of file FlexLexer.h.

Referenced by ctor_common().

◆ yy_start

int yyFlexLexer::yy_start
protected

Definition at line 178 of file FlexLexer.h.

Referenced by ctor_common(), and yy_get_previous_state().

◆ yy_start_stack

int* yyFlexLexer::yy_start_stack
protected

Definition at line 155 of file FlexLexer.h.

Referenced by ctor_common(), yy_pop_state(), yy_push_state(), yy_top_state(), and ~yyFlexLexer().

◆ yy_start_stack_depth

int yyFlexLexer::yy_start_stack_depth
protected

Definition at line 154 of file FlexLexer.h.

Referenced by ctor_common(), and yy_push_state().

◆ yy_start_stack_ptr

int yyFlexLexer::yy_start_stack_ptr
protected

Definition at line 153 of file FlexLexer.h.

Referenced by ctor_common(), yy_pop_state(), yy_push_state(), and yy_top_state().

◆ yy_state_buf

yy_state_type* yyFlexLexer::yy_state_buf
protected

Definition at line 195 of file FlexLexer.h.

Referenced by ctor_common(), and ~yyFlexLexer().

◆ yy_state_ptr

yy_state_type* yyFlexLexer::yy_state_ptr
protected

Definition at line 196 of file FlexLexer.h.

◆ yyin

std::istream yyFlexLexer::yyin
protected

◆ yyout

std::ostream yyFlexLexer::yyout
protected

Definition at line 166 of file FlexLexer.h.

Referenced by LexerOutput(), switch_streams(), and switch_streams().


The documentation for this class was generated from the following files: