lestes::lang::cplus::lex::unit_part Class Reference

Part of translation unit. More...

#include <unit_part.hh>

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

Inheritance graph
[legend]
List of all members.

Public Member Functions

void start_of_line (void)
 Sets start of line flag.
ptr< condition_stackconditions_get (void) const
 Returns associated condition stack.
ptr< expanderexpander_get (void) const
 Returs associated expander.
ptr< line_controlline_control_get (void) const
 Returs the line control.
ptr< pp_tokenread (void)
 Reads next token.

Static Public Member Functions

static ptr< unit_partcreate (const ptr< file_info > &a_file, const ptr< data_source > &a_data, const ptr< encoder > &a_encoder, const ptr< macro_storage > &a_macros)
 Returns new unit, initializes with file information, data source and encoder.

Protected Member Functions

 unit_part (const ptr< file_info > &a_file, const ptr< data_source > &a_data, const ptr< encoder > &a_encoder, const ptr< macro_storage > &a_macros)
 Creates new unit, initializes with file information, data source and encoding.
virtual void gc_mark (void)
 Marks the object.

Private Member Functions

 unit_part (const unit_part &)
 Hides copy constructor.
unit_partoperator= (const unit_part &)
 Hides assignment operator.

Private Attributes

bool start
 Start of line flag.
srp< condition_stackconditions
 Conditions stack.
srp< encoderenc
 Character set encoder.
srp< data_sourceds
 Data source.
srp< pre_lexplx
 Operations prior to lexical analysis.
srp< line_controllic
 Line control.
srp< pp_lexppl
 Flex wrapper.
srp< expanderexp
 Expander.

Detailed Description

Part of translation unit.

Represents a part of translation unit, which is either the original source file itself, or any file included by the source file.


Constructor & Destructor Documentation

lestes::lang::cplus::lex::unit_part::unit_part ( const ptr< file_info > &  a_file,
const ptr< data_source > &  a_data,
const ptr< encoder > &  a_encoder,
const ptr< macro_storage > &  a_macros 
) [protected]

Creates new unit, initializes with file information, data source and encoding.

Creates the object.

Precondition:
a_file != NULL

a_data != NULL

a_encoder != NULL

a_macros != NULL

Parameters:
a_file The file information.
a_data The data source.
a_encoder The encoder for the source.
a_macros The defined macros.

lestes::lang::cplus::lex::unit_part::unit_part ( const unit_part  )  [private]

Hides copy constructor.


Member Function Documentation

void lestes::lang::cplus::lex::unit_part::start_of_line ( void   ) 

Sets start of line flag.

Sets start of line flag to help pp_lex switch to read tokens within include. The flag is cleared automatically after first call to read().

ptr< condition_stack > lestes::lang::cplus::lex::unit_part::conditions_get ( void   )  const

Returns associated condition stack.

Returns associated condition stack.

Returns:
The condition stack.

ptr< expander > lestes::lang::cplus::lex::unit_part::expander_get ( void   )  const

Returs associated expander.

Returns the associated expander.

Returns:
The expander connected to this unit part.

ptr< line_control > lestes::lang::cplus::lex::unit_part::line_control_get ( void   )  const

Returs the line control.

Returns the associated line control.

Returns:
The line control.

ptr< pp_token > lestes::lang::cplus::lex::unit_part::read ( void   )  [virtual]

Reads next token.

Reads next token from the unit part. Updates token location by the relative location.

Returns:
The next token in the unit part.

Implements lestes::lang::cplus::lex::pp_filter.

ptr< unit_part > lestes::lang::cplus::lex::unit_part::create ( const ptr< file_info > &  a_file,
const ptr< data_source > &  a_data,
const ptr< encoder > &  a_encoder,
const ptr< macro_storage > &  a_macros 
) [static]

Returns new unit, initializes with file information, data source and encoder.

Returns new instance, initializes with file information, stream and encoding.

Parameters:
a_file The file information for the unit part.
a_data The data source.
a_encoder The encoder for the source.
a_macros The defined macros.
Returns:
New instance of the class.

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

Marks the object.

Marks the object.

Reimplemented from lestes::lang::cplus::lex::pp_filter.

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

Hides assignment operator.


Member Data Documentation

bool lestes::lang::cplus::lex::unit_part::start [private]

Start of line flag.

srp<condition_stack> lestes::lang::cplus::lex::unit_part::conditions [private]

Conditions stack.

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

Character set encoder.

srp<data_source> lestes::lang::cplus::lex::unit_part::ds [private]

Data source.

srp<pre_lex> lestes::lang::cplus::lex::unit_part::plx [private]

Operations prior to lexical analysis.

srp<line_control> lestes::lang::cplus::lex::unit_part::lic [private]

Line control.

srp<pp_lex> lestes::lang::cplus::lex::unit_part::ppl [private]

Flex wrapper.

srp<expander> lestes::lang::cplus::lex::unit_part::exp [private]

Expander.


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