The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
preprocessor Class Referenceabstract

Base class for preprocessing an input. More...

Inheritance diagram for preprocessor:
Inheritance graph

Public Member Functions

preprocessorget_old_preprocessor ()
 Preprocesses and sends some text to the target_ buffer. More...
 
virtual bool get_chunk ()=0
 
virtual int is_macro ()
 retruns 1 if this parses a macro, -1 if this doesnt parse text (if this is no preprocessor_data). 0 otherwise (this parses a file). More...
 
virtual ~preprocessor ()
 Restores the old preprocessing context of target_. More...
 

Protected Member Functions

 preprocessor (preprocessor_streambuf &)
 Sets up a new preprocessor for stream buffer t. More...
 

Protected Attributes

preprocessor_streambuftarget_
 

Private Attributes

preprocessor *const old_preprocessor_
 
std::string old_textdomain_
 
std::string old_location_
 
int old_linenum_
 

Detailed Description

Base class for preprocessing an input.

Definition at line 196 of file preprocessor.cpp.

Constructor & Destructor Documentation

preprocessor::preprocessor ( preprocessor_streambuf t)
protected

Sets up a new preprocessor for stream buffer t.

Saves the current preprocessing context of target_. It will be automatically restored on destruction.

Definition at line 403 of file preprocessor.cpp.

References preprocessor_streambuf::current_, preprocessor_streambuf::depth_, and target_.

preprocessor::~preprocessor ( )
virtual

Restores the old preprocessing context of target_.

Appends location and domain directives to the buffer, so that the parser notices these changes.

Definition at line 419 of file preprocessor.cpp.

References preprocessor_streambuf::buffer_, preprocessor_streambuf::current_, preprocessor_streambuf::depth_, preprocessor_streambuf::linenum_, preprocessor_streambuf::location_, old_linenum_, old_location_, old_preprocessor_, old_textdomain_, target_, and preprocessor_streambuf::textdomain_.

Member Function Documentation

virtual bool preprocessor::get_chunk ( )
pure virtual
preprocessor* preprocessor::get_old_preprocessor ( )
inline

Preprocesses and sends some text to the target_ buffer.

Returns
false when the input has no data left.

Definition at line 210 of file preprocessor.cpp.

References old_preprocessor_.

Referenced by preprocessor_streambuf::get_current_file().

virtual int preprocessor::is_macro ( )
inlinevirtual

retruns 1 if this parses a macro, -1 if this doesnt parse text (if this is no preprocessor_data). 0 otherwise (this parses a file).

Reimplemented in preprocessor_data.

Definition at line 213 of file preprocessor.cpp.

Referenced by preprocessor_streambuf::get_current_file().

Member Data Documentation

int preprocessor::old_linenum_
private

Definition at line 201 of file preprocessor.cpp.

Referenced by ~preprocessor().

std::string preprocessor::old_location_
private

Definition at line 200 of file preprocessor.cpp.

Referenced by ~preprocessor().

preprocessor* const preprocessor::old_preprocessor_
private

Definition at line 198 of file preprocessor.cpp.

Referenced by get_old_preprocessor(), and ~preprocessor().

std::string preprocessor::old_textdomain_
private

Definition at line 199 of file preprocessor.cpp.

Referenced by ~preprocessor().

preprocessor_streambuf& preprocessor::target_
protected

The documentation for this class was generated from the following file: