Thrown when no rule matches at a position (a lexical error).
More...
#include <lexer.hpp>
|
| | lex_error (const std::string &message, position where) |
| | Builds the error.
|
| |
| | lex_error (const std::string &message, position where, std::vector< token > decided) |
| | Builds the error a stream raises after deciding tokens in the same call.
|
| |
| position | where () const noexcept |
| | Returns the position of the unmatched byte.
|
| |
| const std::vector< token > & | decided () const noexcept |
| | The tokens a token_stream call decided before the error, in order: with the tokens its earlier calls returned, every token before the error, wherever the text was cut. Empty from lexer::tokenize.
|
| |
Thrown when no rule matches at a position (a lexical error).
Carries the position of the offending byte so a caller can report it.
◆ lex_error() [1/2]
| scilex::lex_error::lex_error |
( |
const std::string & |
message, |
|
|
position |
where |
|
) |
| |
|
inline |
Builds the error.
- Parameters
-
| [in] | message | Human-readable cause. |
| [in] | where | Position of the byte that no rule could match. |
◆ lex_error() [2/2]
| scilex::lex_error::lex_error |
( |
const std::string & |
message, |
|
|
position |
where, |
|
|
std::vector< token > |
decided |
|
) |
| |
|
inline |
Builds the error a stream raises after deciding tokens in the same call.
- Parameters
-
| [in] | message | Human-readable cause. |
| [in] | where | Position of the byte that no rule could match. |
| [in] | decided | The tokens the call decided before it, in order. |
◆ decided()
| const std::vector< token > & scilex::lex_error::decided |
( |
| ) |
const |
|
inlinenoexcept |
The tokens a token_stream call decided before the error, in order: with the tokens its earlier calls returned, every token before the error, wherever the text was cut. Empty from lexer::tokenize.
- Returns
- The tokens; a lexeme views the stream's buffer, valid until its next call.
◆ where()
| position scilex::lex_error::where |
( |
| ) |
const |
|
inlinenoexcept |
Returns the position of the unmatched byte.
The documentation for this class was generated from the following file: