lestes::lang::cplus::syn::one_manager Class Reference

Inheritance diagram for lestes::lang::cplus::syn::one_manager:

Inheritance graph
[legend]
List of all members.

Public Member Functions

ptr< bison_tokenyylex ()
ptr< bison_tokenprev_yylex ()
ptr< bison_tokenpeek ()
void back_up ()
void start (int)
void commit (int)
void rollback ()
ptr< bison_pack_tokenpack (int, const ptr< source_location > &)
void unpack ()
bool in_disambiguation () const
void install_undo_action (ptr< action > a)
bool failing_get () const
void failing_set_true ()

Static Public Member Functions

static ptr< one_managercreate (const ptr< streamer > &a_src)
static void init ()
 Initializes the maps.

Protected Member Functions

 one_manager (const ptr< streamer > &)
void gc_mark ()
 Marks the keystone.
void find_closing (int closing, int opening, const ptr< source_location > &loc)
 Finds closing token (e.g. parenthesis); opening token must be specified too.

Protected Attributes

bool run_hinter
bool failing
srp< token_list_typetoken_list
token_list_iterator token_list_pos
srp< list< srp< transaction > > > open_transactions
static::std::set< int > error_stmt_end_set
 Contains a set of skeletal tokens used in error recovery.

Private Attributes

srp< streamersrc
srp< bison_tokenlast_token

Constructor & Destructor Documentation

lestes::lang::cplus::syn::one_manager::one_manager ( const ptr< streamer > &  s  )  [protected]

Immediately adds first token from the tokeniser into token_list.


Member Function Documentation

void lestes::lang::cplus::syn::one_manager::gc_mark ( void   )  [inline, protected, virtual]

Marks the keystone.

Marks all directly reachable parts of the class. The method must be overriden for each inherited class. It should contain abc.gc_mark() for each field abc of the inherited class and call to gc_mark() of the direct ancestor of the class. Does nothing for keystone, only stops processing of ancestors.

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

void lestes::lang::cplus::syn::one_manager::find_closing ( int  closing,
int  opening,
const ptr< source_location > &  loc 
) [protected]

Finds closing token (e.g. parenthesis); opening token must be specified too.

Reads tokens using yylex() to find closing parenthesis/bracket/brace.

Tokens are read until one with closing type is found. Each occurence of token with opening type requires its counterpart with closing type to be read before a token with the closing type is considered to be terminating.

When EOF is read before all occurences of opening tokens are closed, errors are reported.

The position in the stream is left to point just after the terminating token. This is needed for pack() to work. This method is called exclusively from there.

When closing == opening nesting is not done and very first occurence of a token with such value is considered closing.

A location must be provided for cases when the unclosed opening token lies before tokens read by the method. It is used for error reporting only.

Parameters:
closing type of token considered to be closing [parenthesis]
opening type of token considered to be opening [parenthesis]
loc location used to error reports that are out of "scope"

static ptr<one_manager> lestes::lang::cplus::syn::one_manager::create ( const ptr< streamer > &  a_src  )  [inline, static]

void lestes::lang::cplus::syn::one_manager::init (  )  [static]

Initializes the maps.

ptr< bison_token > lestes::lang::cplus::syn::one_manager::yylex (  ) 

ptr< bison_token > lestes::lang::cplus::syn::one_manager::prev_yylex (  ) 

ptr< bison_token > lestes::lang::cplus::syn::one_manager::peek (  ) 

void lestes::lang::cplus::syn::one_manager::back_up (  ) 

void lestes::lang::cplus::syn::one_manager::start ( int   ) 

void lestes::lang::cplus::syn::one_manager::commit ( int   ) 

void lestes::lang::cplus::syn::one_manager::rollback (  ) 

ptr< bison_pack_token > lestes::lang::cplus::syn::one_manager::pack ( int  pack_type,
const ptr< source_location > &  start_loc 
)

Packs tokens from the stream to form a pack token with given type. The actual packing method used depends on the type of the desired token.

Some packing methods need to report the error as being located before the first token of the pack. It is passed in start_loc in these cases. Note that we cannot rely on prev_yylex() here, because there may have been no previous calls to yylex(). However, the parser (which usually calls us) can be pretty sure.

Parameters:
pack_type Type of desired token pack. Determines the packing method used.
start_loc Location that is passed to some of the packing method for error reporting.

void lestes::lang::cplus::syn::one_manager::unpack (  ) 

bool lestes::lang::cplus::syn::one_manager::in_disambiguation (  )  const

void lestes::lang::cplus::syn::one_manager::install_undo_action ( ptr< action a  ) 

bool lestes::lang::cplus::syn::one_manager::failing_get (  )  const

void lestes::lang::cplus::syn::one_manager::failing_set_true (  ) 


Member Data Documentation

srp<streamer> lestes::lang::cplus::syn::one_manager::src [private]

srp<bison_token> lestes::lang::cplus::syn::one_manager::last_token [private]

bool lestes::lang::cplus::syn::one_manager::run_hinter [protected]

bool lestes::lang::cplus::syn::one_manager::failing [protected]

srp<token_list_type> lestes::lang::cplus::syn::one_manager::token_list [protected]

token_list_iterator lestes::lang::cplus::syn::one_manager::token_list_pos [protected]

srp< list< srp<transaction> > > lestes::lang::cplus::syn::one_manager::open_transactions [protected]

std::set< int > lestes::lang::cplus::syn::one_manager::error_stmt_end_set [protected]

Contains a set of skeletal tokens used in error recovery.


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