15#ifndef CPROVER_SOLVERS_SMT2_SMT2_TOKENIZER_H
16#define CPROVER_SOLVERS_SMT2_SMT2_TOKENIZER_H
std::ostringstream _reason
The reason this exception was generated.
cprover_exception_baset(std::string reason)
This constructor is marked protected to ensure this class isn't used directly.
Exception thrown by the tokenizer (and the parser built on top of it) to report a syntactic error at ...
smt2_errort(const std::string &_message, unsigned _line_no)
unsigned get_line_no() const
smt2_errort(unsigned _line_no)
token_kindt kind
The kind of token; see token_kindt.
std::string text
The source text of the token (excluding any delimiters): the symbol name for SYMBOL/KEYWORD,...
unsigned line_no
The source line number on which the token ends.
tokent(token_kindt _kind)
bool quoted_symbol
True iff kind == SYMBOL and the symbol was given in |...| quoted form; always false for other token k...
tokent get_string_literal()
Read a STRING_LITERAL of the form "..." from the stream, applying SMT-LIB v2.6 quote-doubling: a "" i...
std::optional< tokent > peeked
Token that has been peeked but not yet consumed.
tokent get_decimal_numeral()
Read a NUMERAL of the form "[0-9.]+" from the stream.
tokent next_token()
Consume and return the next token.
unsigned current_line_no() const
Line number to attribute a diagnostic to: the line of the peeked token if there is one,...
enum { NONE, END_OF_FILE, STRING_LITERAL, NUMERAL, SYMBOL, KEYWORD, OPEN, CLOSE } token_kindt
smt2_tokenizert(std::istream &_in)
smt2_errort error() const
generate an error exception
tokent get_bin_numeral()
Read a NUMERAL of the form "#b[01]+" from the stream.
tokent get_simple_symbol()
Read a SYMBOL of the form "[A-Za-z~!@$%^&*_\-+=<>.?/][...]*" from the stream.
tokent get_quoted_symbol()
Read a quoted SYMBOL of the form |...| from the stream.
const tokent & peek()
Return the next token without consuming it.
smt2_errort error(const std::string &message) const
generate an error exception, pre-filled with a message
unsigned line_no
Number of the source line currently being read.
tokent read_token()
Read a single token directly from the input stream.
void skip_to_end_of_list()
skip any tokens until all parentheses are closed or the end of file is reached
tokent get_hex_numeral()
Read a NUMERAL of the form "#x[0-9a-fA-F]+" from the stream.
bool is_smt2_simple_symbol_character(char)