ExampleFlexLexer Class Reference

#include <FlexLexer.h>

Inheritance diagram for ExampleFlexLexer:

FlexLexer example::Scanner List of all members.

Public Member Functions

 ExampleFlexLexer (std::istream *arg_yyin=0, std::ostream *arg_yyout=0)
virtual ~ExampleFlexLexer ()
void yy_switch_to_buffer (struct yy_buffer_state *new_buffer)
 Switch to a different input buffer.
yy_buffer_stateyy_create_buffer (std::istream *s, int size)
 Allocate and initialize an input buffer state.
void yy_delete_buffer (struct yy_buffer_state *b)
 Destroy the buffer.
void yyrestart (std::istream *s)
 Immediately switch to a different input stream.
void yypush_buffer_state (struct yy_buffer_state *new_buffer)
 Pushes the new state onto the stack.
void yypop_buffer_state (void)
 Removes and deletes the top of the stack, if present.
virtual int yylex ()
 The main scanner function which does all the work.
virtual void switch_streams (std::istream *new_in, std::ostream *new_out)

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, register char *buf_ptr)
int yyinput ()
void yy_load_buffer_state ()
void yy_init_buffer (struct yy_buffer_state *b, std::istream *s)
void yy_flush_buffer (struct yy_buffer_state *b)
 Discard all buffered characters.
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
 index of top of stack.
size_t yy_buffer_stack_max
 capacity of stack.
yy_buffer_state ** yy_buffer_stack
 Stack as an array.
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

Detailed Description

Definition at line 112 of file FlexLexer.h.


Constructor & Destructor Documentation

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

Definition at line 1003 of file scanner.cc.

References yy_buffer_stack, yy_buffer_stack_max, yy_buffer_stack_top, yy_c_buf_p, yy_did_buffer_switch_on_eof, FlexLexer::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, yyin, FlexLexer::yylineno, and yyout.

ExampleFlexLexer::~ExampleFlexLexer (  )  [virtual]

Definition at line 1031 of file scanner.cc.

References Examplefree(), YY_CURRENT_BUFFER, yy_delete_buffer(), yy_start_stack, and yy_state_buf.


Member Function Documentation

void ExampleFlexLexer::yy_switch_to_buffer ( struct yy_buffer_state new_buffer  )  [virtual]

Switch to a different input buffer.

Parameters:
new_buffer The new input buffer.

Implements FlexLexer.

Definition at line 1442 of file scanner.cc.

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, and yyensure_buffer_stack().

Referenced by switch_streams().

YY_BUFFER_STATE ExampleFlexLexer::yy_create_buffer ( std::istream *  file,
int  size 
) [read, virtual]

Allocate and initialize an input buffer state.

Parameters:
file A readable stream.
size The character buffer size in bytes. When in doubt, use YY_BUF_SIZE.
Returns:
the allocated buffer state.

Implements FlexLexer.

Definition at line 1495 of file scanner.cc.

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

Referenced by switch_streams(), and yyrestart().

void ExampleFlexLexer::yy_delete_buffer ( struct yy_buffer_state b  )  [virtual]

Destroy the buffer.

Parameters:
b a buffer created with yy_create_buffer()

Implements FlexLexer.

Definition at line 1527 of file scanner.cc.

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

Referenced by switch_streams(), yypop_buffer_state(), and ~ExampleFlexLexer().

void ExampleFlexLexer::yyrestart ( std::istream *  input_file  )  [virtual]

Immediately switch to a different input stream.

Parameters:
input_file A readable stream.
Note:
This function does not reset the start condition to INITIAL .

Implements FlexLexer.

Definition at line 1421 of file scanner.cc.

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

Referenced by yyinput().

void ExampleFlexLexer::yypush_buffer_state ( struct 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_buffer The new state.

Definition at line 1628 of file scanner.cc.

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, and yyensure_buffer_stack().

void ExampleFlexLexer::yypop_buffer_state ( void   ) 

Removes and deletes the top of the stack, if present.

The next element becomes the new top.

Definition at line 1664 of file scanner.cc.

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

int ExampleFlexLexer::yylex (  )  [virtual]

The main scanner function which does all the work.

Implements FlexLexer.

Definition at line 678 of file scanner.cc.

References example::Parser::token::DOUBLE, ECHO, EOB_ACT_CONTINUE_SCAN, EOB_ACT_END_OF_FILE, EOB_ACT_LAST_MATCH, example::Parser::token::EOL, INITIAL, example::Parser::token::INTEGER, example::Parser::token::STRING, yy_accept, yy_base, YY_BREAK, YY_BUF_SIZE, YY_BUFFER_NEW, YY_BUFFER_NORMAL, yy_chk, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, yy_def, YY_DO_BEFORE_ACTION, yy_ec, YY_END_OF_BUFFER, YY_FATAL_ERROR, yy_meta, YY_MORE_ADJ, YY_NEW_FILE, yy_nxt, YY_RESTORE_YY_MORE_OFFSET, yy_rule_linenum, YY_RULE_SETUP, YY_SC_TO_UI, YY_START, YY_STATE_EOF, yyleng, yyterminate, yytext_ptr, and yywrap.

void ExampleFlexLexer::switch_streams ( std::istream *  new_in,
std::ostream *  new_out 
) [virtual]

Implements FlexLexer.

Definition at line 1038 of file scanner.cc.

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

int ExampleFlexLexer::LexerInput ( char *  buf,
int  max_size 
) [protected, virtual]

Definition at line 1053 of file scanner.cc.

References yyin.

void ExampleFlexLexer::LexerOutput ( const char *  buf,
int  size 
) [protected, virtual]

Definition at line 1080 of file scanner.cc.

References yyout.

void ExampleFlexLexer::LexerError ( const char  msg[]  )  [protected, virtual]

Definition at line 1796 of file scanner.cc.

References YY_EXIT_FAILURE.

void ExampleFlexLexer::yyunput ( int  c,
register char *  buf_ptr 
) [protected]

Definition at line 1296 of file scanner.cc.

References yy_c_buf_p, YY_CURRENT_BUFFER_LVALUE, YY_FATAL_ERROR, yy_hold_char, yy_n_chars, and yytext_ptr.

int ExampleFlexLexer::yyinput (  )  [protected]

Definition at line 1341 of file scanner.cc.

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, yyrestart(), yytext_ptr, and yywrap.

void ExampleFlexLexer::yy_load_buffer_state (  )  [protected]

Definition at line 1477 of file scanner.cc.

References yy_c_buf_p, YY_CURRENT_BUFFER_LVALUE, yy_hold_char, yy_n_chars, yyin, and yytext_ptr.

Referenced by yy_flush_buffer(), yy_switch_to_buffer(), yypop_buffer_state(), yypush_buffer_state(), and yyrestart().

void ExampleFlexLexer::yy_init_buffer ( struct yy_buffer_state b,
std::istream *  s 
) [protected]

Definition at line 1559 of file scanner.cc.

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_buffer_state::yy_input_file, and yy_buffer_state::yy_is_interactive.

Referenced by yy_create_buffer(), and yyrestart().

void ExampleFlexLexer::yy_flush_buffer ( struct yy_buffer_state b  )  [protected]

Discard all buffered characters.

On the next scan, YY_INPUT will be called.

Parameters:
b the buffer state to be flushed, usually YY_CURRENT_BUFFER.

Definition at line 1594 of file scanner.cc.

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_load_buffer_state(), and yy_buffer_state::yy_n_chars.

Referenced by yy_init_buffer().

void ExampleFlexLexer::yy_push_state ( int  new_state  )  [protected]

Definition at line 1742 of file scanner.cc.

References BEGIN, Examplealloc(), Examplerealloc(), YY_FATAL_ERROR, YY_START, yy_start_stack, yy_start_stack_depth, YY_START_STACK_INCR, and yy_start_stack_ptr.

void ExampleFlexLexer::yy_pop_state (  )  [protected]

Definition at line 1771 of file scanner.cc.

References BEGIN, YY_FATAL_ERROR, yy_start_stack, and yy_start_stack_ptr.

int ExampleFlexLexer::yy_top_state (  )  [protected]

Definition at line 1783 of file scanner.cc.

References yy_start_stack, and yy_start_stack_ptr.

yy_state_type ExampleFlexLexer::yy_get_previous_state (  )  [protected]

Definition at line 1230 of file scanner.cc.

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

yy_state_type ExampleFlexLexer::yy_try_NUL_trans ( yy_state_type  current_state  )  [protected]

Definition at line 1268 of file scanner.cc.

References yy_accept, yy_base, yy_c_buf_p, yy_chk, yy_def, yy_last_accepting_cpos, yy_last_accepting_state, yy_meta, and yy_nxt.

int ExampleFlexLexer::yy_get_next_buffer (  )  [protected]

Definition at line 1098 of file scanner.cc.

References EOB_ACT_END_OF_FILE, EOB_ACT_LAST_MATCH, Examplerealloc(), YY_BUFFER_EOF_PENDING, yy_c_buf_p, YY_CURRENT_BUFFER, YY_CURRENT_BUFFER_LVALUE, YY_FATAL_ERROR, YY_MORE_ADJ, yy_n_chars, and yytext_ptr.

Referenced by yyinput().

void ExampleFlexLexer::yyensure_buffer_stack ( void   )  [protected]

Definition at line 1689 of file scanner.cc.

References Examplealloc(), Examplerealloc(), yy_buffer_stack, yy_buffer_stack_max, and yy_buffer_stack_top.

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


Member Data Documentation

int ExampleFlexLexer::yy_start_stack_ptr [protected]

Definition at line 146 of file FlexLexer.h.

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

int ExampleFlexLexer::yy_start_stack_depth [protected]

Definition at line 147 of file FlexLexer.h.

Referenced by ExampleFlexLexer(), and yy_push_state().

int* ExampleFlexLexer::yy_start_stack [protected]

Definition at line 148 of file FlexLexer.h.

Referenced by ExampleFlexLexer(), yy_pop_state(), yy_push_state(), yy_top_state(), and ~ExampleFlexLexer().

std:: istream* ExampleFlexLexer::yyin [protected]

Definition at line 158 of file FlexLexer.h.

Referenced by ExampleFlexLexer(), LexerInput(), yy_load_buffer_state(), yyinput(), and yyrestart().

std:: ostream* ExampleFlexLexer::yyout [protected]

Definition at line 159 of file FlexLexer.h.

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

char ExampleFlexLexer::yy_hold_char [protected]

Definition at line 162 of file FlexLexer.h.

Referenced by yy_load_buffer_state(), yy_switch_to_buffer(), yyinput(), yypush_buffer_state(), and yyunput().

int ExampleFlexLexer::yy_n_chars [protected]

Definition at line 165 of file FlexLexer.h.

Referenced by yy_get_next_buffer(), yy_load_buffer_state(), yy_switch_to_buffer(), yyinput(), yypush_buffer_state(), and yyunput().

char* ExampleFlexLexer::yy_c_buf_p [protected]

Definition at line 168 of file FlexLexer.h.

Referenced by ExampleFlexLexer(), yy_get_next_buffer(), yy_get_previous_state(), yy_load_buffer_state(), yy_switch_to_buffer(), yy_try_NUL_trans(), yyinput(), yypush_buffer_state(), and yyunput().

int ExampleFlexLexer::yy_init [protected]

Definition at line 170 of file FlexLexer.h.

Referenced by ExampleFlexLexer().

int ExampleFlexLexer::yy_start [protected]

Definition at line 171 of file FlexLexer.h.

Referenced by ExampleFlexLexer(), and yy_get_previous_state().

int ExampleFlexLexer::yy_did_buffer_switch_on_eof [protected]

Definition at line 175 of file FlexLexer.h.

Referenced by ExampleFlexLexer(), yy_switch_to_buffer(), yyinput(), yypop_buffer_state(), and yypush_buffer_state().

size_t ExampleFlexLexer::yy_buffer_stack_top [protected]

index of top of stack.

Definition at line 178 of file FlexLexer.h.

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

size_t ExampleFlexLexer::yy_buffer_stack_max [protected]

capacity of stack.

Definition at line 179 of file FlexLexer.h.

Referenced by ExampleFlexLexer(), and yyensure_buffer_stack().

struct yy_buffer_state** ExampleFlexLexer::yy_buffer_stack [read, protected]

Stack as an array.

Definition at line 180 of file FlexLexer.h.

Referenced by ExampleFlexLexer(), and yyensure_buffer_stack().

yy_state_type ExampleFlexLexer::yy_last_accepting_state [protected]

Definition at line 186 of file FlexLexer.h.

Referenced by yy_get_previous_state(), and yy_try_NUL_trans().

char* ExampleFlexLexer::yy_last_accepting_cpos [protected]

Definition at line 187 of file FlexLexer.h.

Referenced by yy_get_previous_state(), and yy_try_NUL_trans().

yy_state_type* ExampleFlexLexer::yy_state_buf [protected]

Definition at line 189 of file FlexLexer.h.

Referenced by ExampleFlexLexer(), and ~ExampleFlexLexer().

yy_state_type* ExampleFlexLexer::yy_state_ptr [protected]

Definition at line 190 of file FlexLexer.h.

char* ExampleFlexLexer::yy_full_match [protected]

Definition at line 192 of file FlexLexer.h.

int* ExampleFlexLexer::yy_full_state [protected]

Definition at line 193 of file FlexLexer.h.

int ExampleFlexLexer::yy_full_lp [protected]

Definition at line 194 of file FlexLexer.h.

int ExampleFlexLexer::yy_lp [protected]

Definition at line 196 of file FlexLexer.h.

int ExampleFlexLexer::yy_looking_for_trail_begin [protected]

Definition at line 197 of file FlexLexer.h.

Referenced by ExampleFlexLexer().

int ExampleFlexLexer::yy_more_flag [protected]

Definition at line 199 of file FlexLexer.h.

Referenced by ExampleFlexLexer().

int ExampleFlexLexer::yy_more_len [protected]

Definition at line 200 of file FlexLexer.h.

Referenced by ExampleFlexLexer().

int ExampleFlexLexer::yy_more_offset [protected]

Definition at line 201 of file FlexLexer.h.

Referenced by ExampleFlexLexer().

int ExampleFlexLexer::yy_prev_more_offset [protected]

Definition at line 202 of file FlexLexer.h.

Referenced by ExampleFlexLexer().


The documentation for this class was generated from the following files:
Generated on Mon Aug 20 13:34:21 2007 for Flex Bison C++ Example by  doxygen 1.5.2