lestes::lang::cplus::lex::preprocessor Class Reference

C++ preprocessor. More...

#include <preprocessor.hh>

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

Inheritance graph
[legend]
List of all members.

Public Member Functions

bool pragma_flag_get (void) const
 Returns the pragma flag.
ptr< cpp_tokenread (void)
 Reads next token.

Static Public Member Functions

static ptr< preprocessorcreate (const ptr< file_system > &a_fs, const lstring &file_name)
 Returns new instance.

Protected Member Functions

 preprocessor (const ptr< file_system > &a_fs, const lstring &file_name)
 Creates the object.
virtual void gc_mark (void)
 Marks the object.

Private Member Functions

ptr< lex_literalclassify_number (const ptr< source_location > &loc, const ptr< token_value > &tv)
 Classifies number.
 preprocessor (const preprocessor &)
 Hides copy constructor.
preprocessoroperator= (const preprocessor &)
 Hides assignment operator.

Private Attributes

ulint order
 The order of tokens in translation unit.
srp< file_systemfs
 File system binding.
srp< evaluatoreva
 Evaluator.
srp< space_removerspr
 Whitespace remover.
srp< string_translatorstr
 String translator.
srp< string_joinerstj
 String joiner.

Detailed Description

C++ preprocessor.

Todo:
pt The initialization interface is going to change. Represents the entire C++ preprocessor. Handles conversion from pp_token to cpp_token.


Constructor & Destructor Documentation

lestes::lang::cplus::lex::preprocessor::preprocessor ( const ptr< file_system > &  a_fs,
const lstring &  file_name 
) [protected]

Creates the object.

Creates new preprocessor.

Precondition:
a_fs != NULL
Parameters:
a_fs The file system binding.
file_name The full name of the file to process.

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

Hides copy constructor.


Member Function Documentation

bool lestes::lang::cplus::lex::preprocessor::pragma_flag_get ( void   )  const

Returns the pragma flag.

Returns pragma flag.

Returns:
true If pragma lestes was encountered.

ptr< cpp_token > lestes::lang::cplus::lex::preprocessor::read ( void   ) 

Reads next token.

Reads next token from the translation unit. Converts pp_token to cpp_token, reports error if not possible. Extracts additional information for literals.

Returns:
The next token in translation unit.

ptr< preprocessor > lestes::lang::cplus::lex::preprocessor::create ( const ptr< file_system > &  a_fs,
const lstring &  file_name 
) [static]

Returns new instance.

Returns new preprocessor for given file.

Parameters:
a_fs The file system binding.
file_name The full name of the file to process.

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

Marks the object.

Marks the object.

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

ptr< lex_literal > lestes::lang::cplus::lex::preprocessor::classify_number ( const ptr< source_location > &  loc,
const ptr< token_value > &  num 
) [private]

Classifies number.

Attempts to parse preprocessing number. Returns literal properties.

Precondition:
loc != NULL

num != NULL

The value matches preprocessing number.

Parameters:
loc The location of the number.
num The number to classify.
Returns:
The appropriate literal properties or NULL.

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

Hides assignment operator.


Member Data Documentation

ulint lestes::lang::cplus::lex::preprocessor::order [private]

The order of tokens in translation unit.

srp<file_system> lestes::lang::cplus::lex::preprocessor::fs [private]

File system binding.

srp<evaluator> lestes::lang::cplus::lex::preprocessor::eva [private]

Evaluator.

srp<space_remover> lestes::lang::cplus::lex::preprocessor::spr [private]

Whitespace remover.

srp<string_translator> lestes::lang::cplus::lex::preprocessor::str [private]

String translator.

srp<string_joiner> lestes::lang::cplus::lex::preprocessor::stj [private]

String joiner.


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