lestes::lang::cplus::lex::pre_lex Class Reference

Character level processing. More...

#include <pre_lex.hh>

Inheritance diagram for lestes::lang::cplus::lex::pre_lex:

Inheritance graph
[legend]
List of all members.

Public Member Functions

ptr< ucn_tokenread (void)
 Reads single token.

Static Public Member Functions

static ptr< pre_lexcreate (const ptr< data_source > &a_src, const ptr< encoder > &a_enc)
 Returns new instance, initializes with data source and encoder.

Protected Member Functions

 pre_lex (const ptr< data_source > &a_src, const ptr< encoder > &a_enc)
 Creates new object, initializes with data source and encoder.
virtual void gc_mark (void)
 Marks the object.

Private Types

enum  state_type {
  START, CONT, NEWLINE, ERROR,
  END
}
 Type of state. More...

Private Member Functions

void connect (void)
 Connect all filters.
 pre_lex (const pre_lex &copy)
 Hides copy constructor.
pre_lexoperator= (const pre_lex &rhs)
 Hides assignment operator.

Private Attributes

state_type state
 State of the object.
srp< ucn_tokensaved
 Saved token.
srp< data_sourcesrc
 Data source.
srp< encoderenc
 Source encoder.
srp< special_tokensstok
 Special tokens translator.
srp< line_numberslnum
 Line numbering.
srp< trigraphstrig
 Trigraph translator.
srp< line_joinljoin
 Line joining.

Detailed Description

Character level processing.

Performs operations done prior to lexical analysis.


Member Enumeration Documentation

enum lestes::lang::cplus::lex::pre_lex::state_type [private]

Type of state.

Enumerator:
START  Starting state.
CONT  Continuing state.
NEWLINE  Newline was read.
ERROR  Error was returned.
END  EOF was read.


Constructor & Destructor Documentation

lestes::lang::cplus::lex::pre_lex::pre_lex ( const ptr< data_source > &  a_src,
const ptr< encoder > &  a_enc 
) [protected]

Creates new object, initializes with data source and encoder.

Creates the object.

Postcondition:
state == START
Precondition:
a_src != NULL

a_enc != NULL

Parameters:
a_src The source stream of data.
a_enc The encoder to apply on the source.
Returns:
New instance of the class.

lestes::lang::cplus::lex::pre_lex::pre_lex ( const pre_lex copy  )  [private]

Hides copy constructor.


Member Function Documentation

ptr< ucn_token > lestes::lang::cplus::lex::pre_lex::read ( void   ) 

Reads single token.

Returns next token passed through all actions before lex. Inserts fake newline, if there is none at the end of file. Saves the EOF token to be returned forever.

Returns:
Next token with all fields set to proper values.

ptr< pre_lex > lestes::lang::cplus::lex::pre_lex::create ( const ptr< data_source > &  a_src,
const ptr< encoder > &  a_enc 
) [static]

Returns new instance, initializes with data source and encoder.

Returns new instance, initializes with source and encoding.

Parameters:
a_src The source stream of data.
a_enc The encoder to apply on the source.
Returns:
New instance of the class.

void lestes::lang::cplus::lex::pre_lex::gc_mark ( void   )  [protected, virtual]

Marks the object.

Marks the object.

Reimplemented from lestes::std::mem::keystone.

void lestes::lang::cplus::lex::pre_lex::connect ( void   )  [private]

Connect all filters.

Connects all filters together.

pre_lex& lestes::lang::cplus::lex::pre_lex::operator= ( const pre_lex rhs  )  [private]

Hides assignment operator.


Member Data Documentation

state_type lestes::lang::cplus::lex::pre_lex::state [private]

State of the object.

srp<ucn_token> lestes::lang::cplus::lex::pre_lex::saved [private]

Saved token.

srp<data_source> lestes::lang::cplus::lex::pre_lex::src [private]

Data source.

srp<encoder> lestes::lang::cplus::lex::pre_lex::enc [private]

Source encoder.

srp<special_tokens> lestes::lang::cplus::lex::pre_lex::stok [private]

Special tokens translator.

srp<line_numbers> lestes::lang::cplus::lex::pre_lex::lnum [private]

Line numbering.

srp<trigraphs> lestes::lang::cplus::lex::pre_lex::trig [private]

Trigraph translator.

srp<line_join> lestes::lang::cplus::lex::pre_lex::ljoin [private]

Line joining.


The documentation for this class was generated from the following files:
Generated on Mon Feb 12 18:43:49 2007 for lestes by doxygen 1.5.1-20070107