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) |
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 59 of file genericRagelLemonDriver.H.
typedef size_t location_type |
Type for linear addressing within parse content.
Naming as per bison
Definition at line 84 of file genericRagelLemonDriver.H.
Construct null.
Definition at line 34 of file genericRagelLemonDriver.C.
|
default |
Copy construct.
|
default |
Move construct.
|
virtualdefault |
Destructor.
void clear | ( | ) |
Reset references.
Definition at line 45 of file genericRagelLemonDriver.C.
|
inline |
Get reference to the input buffer content.
Definition at line 109 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 54 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 69 of file genericRagelLemonDriver.C.
References s().
std::string::const_iterator cend | ( | ) | const |
Iterator to end of content (sub)string.
Definition at line 83 of file genericRagelLemonDriver.C.
References s().
|
inline |
The relative parse position with the content (sub)string.
Definition at line 130 of file genericRagelLemonDriver.H.
References genericRagelLemonDriver::position_.
|
inline |
The relative parse position with the content (sub)string.
Definition at line 136 of file genericRagelLemonDriver.H.
References genericRagelLemonDriver::position_.
Foam::Ostream & printBuffer | ( | Ostream & | os | ) | const |
Output the input buffer string content.
Definition at line 103 of file genericRagelLemonDriver.C.
References os().
void reportFatal | ( | const std::string & | msg | ) | const |
Report FatalError.
Definition at line 131 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 160 of file genericRagelLemonDriver.C.
References Foam::exit(), Foam::FatalIOError, FUNCTION_NAME, Foam::nl, os(), and Foam::pos().
|
protected |
Reference to the input string.
Definition at line 66 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 72 of file genericRagelLemonDriver.H.
|
protected |
The last known parser position.
Definition at line 75 of file genericRagelLemonDriver.H.
Referenced by genericRagelLemonDriver::parsePosition().