libdrmconf
0.10.4
A library to program DMR radios.
|
The lexer class divides a text stream into tokens. More...
#include <csvreader.hh>
Classes | |
struct | State |
Current state of lexer. More... | |
struct | Token |
The token. More... | |
Public Member Functions | |
CSVLexer (QTextStream &stream, QObject *parent=nullptr) | |
Constructs a lexer for the given stream. | |
void | push () |
Saves the current lexer state. | |
void | pop () |
Restores the last lexer state. | |
Token | next () |
Reads the next token from the stream. | |
const QString & | errorMessage () const |
Returns the last error message. | |
Protected Member Functions | |
Token | lex () |
Internal used function to get the next token. More... | |
Protected Attributes | |
QString | _errorMessage |
The error message. | |
QTextStream & | _stream |
The text stream to read from. | |
QVector< State > | _stack |
The stack of saved lexer states. | |
QString | _currentLine |
The current line count. | |
Static Protected Attributes | |
static QVector< QPair< QRegExp, Token::TokenType > > | _pattern |
The list of patterns to match. More... | |
The lexer class divides a text stream into tokens.
|
protected |
Internal used function to get the next token.
Also returns ignored tokens like whitespace and comment.
|
staticprotected |
The list of patterns to match.