lestes::lang::cplus::lex::trigraphs Class Reference

Trigraphs filter. More...

#include <trigraphs.hh>

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

Inheritance graph
[legend]
List of all members.

Public Member Functions

ptr< ucn_tokenread (void)
 Reads next token.

Static Public Member Functions

static ptr< trigraphscreate (void)
 Returns new instance.

Protected Member Functions

 trigraphs (void)
 Creates new instance.
virtual void gc_mark (void)
 Marks the object.

Private Types

enum  state_type {
  START = 0, QUE = 1, QUEQUE = 2, ONE = 3,
  TWO = 4
}
 States of the trigraph processor. More...

Private Member Functions

 trigraphs (const trigraphs &copy)
 Hides copy constructor.
trigraphsoperator= (const trigraphs &rhs)
 Hides assignment operator.

Private Attributes

state_type state
 Current state of the processor.
srp< ucn_tokenfirst
 First buffered token.
srp< ucn_tokensecond
 Second buffered token.

Static Private Attributes

static const ulint translation_length = 128
 Length of map of trigraph translations.
static const ucn translation_map [translation_length]
 Map of trigraph translations, also serves as flags.

Detailed Description

Trigraphs filter.

Maps trigraph sequences to their translations.


Member Enumeration Documentation

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

States of the trigraph processor.

Enumerator:
START  No tokens in buffer.
QUE  One question mark in buffer.
QUEQUE  Two question marks in buffer.
ONE  One ordinary token in buffer.
TWO  Two ordinary tokens in buffer.


Constructor & Destructor Documentation

lestes::lang::cplus::lex::trigraphs::trigraphs ( void   )  [protected]

Creates new instance.

Creates new instance.

Postcondition:
state == START

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

Hides copy constructor.


Member Function Documentation

ptr< ucn_token > lestes::lang::cplus::lex::trigraphs::read ( void   )  [virtual]

Reads next token.

Reads next token after translation of trigraph sequences.

Returns:
Token possibly originating from trigraph.

Implements lestes::lang::cplus::lex::ucn_filter.

ptr< trigraphs > lestes::lang::cplus::lex::trigraphs::create ( void   )  [static]

Returns new instance.

Returns new instance.

Returns:
New instance of the class.

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

Marks the object.

Marks the object.

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

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

Hides assignment operator.


Member Data Documentation

const ulint lestes::lang::cplus::lex::trigraphs::translation_length = 128 [static, private]

Length of map of trigraph translations.

const ucn lestes::lang::cplus::lex::trigraphs::translation_map [static, private]

Initial value:

 {
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         character::ascii_vbar,
        0, 0, 0, 0, 0,
         character::ascii_hat,
         character::ascii_left_bracket,
         character::ascii_right_bracket,
        0, 0, 0,
         character::ascii_tilde,
        0,
         character::ascii_backslash,
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
         character::ascii_left_brace,
         character::ascii_hash,
         character::ascii_right_brace,
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0
}
Map of trigraph translations, also serves as flags.

Trigraph translation map. Defines mapping between ASCII characters. Zero values have no defined translation.

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

Current state of the processor.

srp<ucn_token> lestes::lang::cplus::lex::trigraphs::first [private]

First buffered token.

srp<ucn_token> lestes::lang::cplus::lex::trigraphs::second [private]

Second buffered token.


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