Generic interface code for Ragel/Lemon combination Subclasses should implement one or more process() methods. More...
Public Types | |
typedef size_t | location_type |
Type for linear addressing within parse content. More... | |
Public Member Functions | |
genericRagelLemonDriver () | |
Construct null. More... | |
genericRagelLemonDriver (const genericRagelLemonDriver &rhs)=default | |
Copy construct. More... | |
genericRagelLemonDriver (genericRagelLemonDriver &&rhs)=default | |
Move construct. More... | |
virtual | ~genericRagelLemonDriver ()=default |
Destructor. More... | |
void | clear () |
Reset references. More... | |
const std::string & | content () const |
Get reference to the input buffer content. More... | |
void | content (const std::string &s, size_t pos=0, size_t len=std::string::npos) |
Set reference to the input buffer content, which acts like a std::string_view. More... | |
std::string::const_iterator | cbegin () const |
Iterator to begin of content (sub)string. More... | |
std::string::const_iterator | cend () const |
Iterator to end of content (sub)string. More... | |
size_t | parsePosition () const |
The relative parse position with the content (sub)string. More... | |
size_t & | parsePosition () |
The relative parse position with the content (sub)string. More... | |
Ostream & | printBuffer (Ostream &os) const |
Output the input buffer string content. More... | |
void | reportFatal (const std::string &msg) const |
Report FatalError. More... | |
void | reportFatal (const std::string &msg, size_t pos) const |
Report FatalError at parser position. More... | |
Protected Attributes | |
std::reference_wrapper< const std::string > | content_ |
Reference to the input string. More... | |
size_t | start_ |
Start position within input string. More... | |
size_t | length_ |
Length of input (sub)string. More... | |
size_t | position_ |
The last known parser position. More... | |
Generic interface code for Ragel/Lemon combination Subclasses should implement one or more process() methods.
The scanner will often be implemented as localized lexer class. The parser may be embedded into the scanner as file-scope, or use a separate interface class.
Definition at line 55 of file genericRagelLemonDriver.H.
typedef size_t location_type |
Type for linear addressing within parse content.
Naming as per bison
Definition at line 91 of file genericRagelLemonDriver.H.
Construct null.
Definition at line 27 of file genericRagelLemonDriver.C.
|
default |
Copy construct.
|
default |
Move construct.
|
virtualdefault |
Destructor.
void clear | ( | ) |
|
inline |
Get reference to the input buffer content.
Definition at line 128 of file genericRagelLemonDriver.H.
References genericRagelLemonDriver::content_.
void content | ( | const std::string & | s, |
size_t | pos = 0 , |
||
size_t | len = std::string::npos |
||
) |
Set reference to the input buffer content, which acts like a std::string_view.
Definition at line 48 of file genericRagelLemonDriver.C.
References Foam::pos(), and s.
std::string::const_iterator cbegin | ( | ) | const |
Iterator to begin of content (sub)string.
Definition at line 62 of file genericRagelLemonDriver.C.
References s.
std::string::const_iterator cend | ( | ) | const |
Iterator to end of content (sub)string.
Definition at line 76 of file genericRagelLemonDriver.C.
References s.
|
inline |
The relative parse position with the content (sub)string.
Definition at line 157 of file genericRagelLemonDriver.H.
References genericRagelLemonDriver::position_.
|
inline |
The relative parse position with the content (sub)string.
Definition at line 165 of file genericRagelLemonDriver.H.
References genericRagelLemonDriver::position_.
Foam::Ostream & printBuffer | ( | Ostream & | os | ) | const |
Output the input buffer string content.
Definition at line 97 of file genericRagelLemonDriver.C.
References Foam::constant::universal::c, stdFoam::cbegin(), stdFoam::cend(), and os().
void reportFatal | ( | const std::string & | msg | ) | const |
Report FatalError.
Definition at line 125 of file genericRagelLemonDriver.C.
References Foam::exit(), Foam::FatalIOError, FUNCTION_NAME, Foam::nl, and os().
void reportFatal | ( | const std::string & | msg, |
size_t | pos | ||
) | const |
Report FatalError at parser position.
Definition at line 154 of file genericRagelLemonDriver.C.
References Foam::constant::universal::c, stdFoam::cbegin(), stdFoam::cend(), Foam::exit(), Foam::FatalIOError, FUNCTION_NAME, Foam::min(), Foam::nl, os(), and Foam::pos().
|
protected |
Reference to the input string.
Definition at line 64 of file genericRagelLemonDriver.H.
Referenced by genericRagelLemonDriver::content().
|
protected |
Start position within input string.
Definition at line 69 of file genericRagelLemonDriver.H.
|
protected |
Length of input (sub)string.
Definition at line 74 of file genericRagelLemonDriver.H.
|
protected |
The last known parser position.
Definition at line 79 of file genericRagelLemonDriver.H.
Referenced by genericRagelLemonDriver::parsePosition().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.