cprover
smt2_tokenizert Class Reference

#include <smt2_tokenizer.h>

+ Inheritance diagram for smt2_tokenizert:
+ Collaboration diagram for smt2_tokenizert:

Classes

class  smt2_errort
 

Public Types

using tokent = enum { NONE, END_OF_FILE, STRING_LITERAL, NUMERAL, SYMBOL, KEYWORD, OPEN, CLOSE }
 

Public Member Functions

 smt2_tokenizert (std::istream &_in)
 
tokent next_token ()
 
tokent peek ()
 
const std::string & get_buffer () const
 
bool token_is_quoted_symbol () const
 
smt2_errort error (const std::string &message)
 generate an error exception, pre-filled with a message More...
 
smt2_errort error ()
 generate an error exception More...
 

Protected Member Functions

void skip_to_end_of_list ()
 skip any tokens until all parentheses are closed or the end of file is reached More...
 

Protected Attributes

std::istream * in
 
unsigned line_no
 
std::string buffer
 
bool quoted_symbol = false
 
bool peeked
 
tokent token
 

Private Member Functions

tokent get_decimal_numeral ()
 
tokent get_hex_numeral ()
 
tokent get_bin_numeral ()
 
tokent get_simple_symbol ()
 
tokent get_quoted_symbol ()
 
tokent get_string_literal ()
 
void get_token_from_stream ()
 read a token from the input stream and store it in 'token' More...
 

Static Private Member Functions

static bool is_simple_symbol_character (char)
 

Detailed Description

Definition at line 17 of file smt2_tokenizer.h.

Member Typedef Documentation

◆ tokent

using smt2_tokenizert::tokent = enum { NONE, END_OF_FILE, STRING_LITERAL, NUMERAL, SYMBOL, KEYWORD, OPEN, CLOSE }

Definition at line 59 of file smt2_tokenizer.h.

Constructor & Destructor Documentation

◆ smt2_tokenizert()

smt2_tokenizert::smt2_tokenizert ( std::istream &  _in)
inlineexplicit

Definition at line 20 of file smt2_tokenizer.h.

Member Function Documentation

◆ error() [1/2]

smt2_errort smt2_tokenizert::error ( )
inline

generate an error exception

Definition at line 101 of file smt2_tokenizer.h.

◆ error() [2/2]

smt2_errort smt2_tokenizert::error ( const std::string &  message)
inline

generate an error exception, pre-filled with a message

Definition at line 95 of file smt2_tokenizer.h.

◆ get_bin_numeral()

smt2_tokenizert::tokent smt2_tokenizert::get_bin_numeral ( )
private

Definition at line 86 of file smt2_tokenizer.cpp.

◆ get_buffer()

const std::string& smt2_tokenizert::get_buffer ( ) const
inline

Definition at line 84 of file smt2_tokenizer.h.

◆ get_decimal_numeral()

smt2_tokenizert::tokent smt2_tokenizert::get_decimal_numeral ( )
private

Definition at line 59 of file smt2_tokenizer.cpp.

◆ get_hex_numeral()

smt2_tokenizert::tokent smt2_tokenizert::get_hex_numeral ( )
private

Definition at line 115 of file smt2_tokenizer.cpp.

◆ get_quoted_symbol()

smt2_tokenizert::tokent smt2_tokenizert::get_quoted_symbol ( )
private

Definition at line 144 of file smt2_tokenizer.cpp.

◆ get_simple_symbol()

smt2_tokenizert::tokent smt2_tokenizert::get_simple_symbol ( )
private

Definition at line 26 of file smt2_tokenizer.cpp.

◆ get_string_literal()

smt2_tokenizert::tokent smt2_tokenizert::get_string_literal ( )
private

Definition at line 172 of file smt2_tokenizer.cpp.

◆ get_token_from_stream()

void smt2_tokenizert::get_token_from_stream ( )
private

read a token from the input stream and store it in 'token'

Definition at line 213 of file smt2_tokenizer.cpp.

◆ is_simple_symbol_character()

bool smt2_tokenizert::is_simple_symbol_character ( char  ch)
staticprivate

Definition at line 13 of file smt2_tokenizer.cpp.

◆ next_token()

smt2_tokenizert::tokent smt2_tokenizert::next_token ( )

Definition at line 203 of file smt2_tokenizer.cpp.

◆ peek()

tokent smt2_tokenizert::peek ( )
inline

Definition at line 72 of file smt2_tokenizer.h.

◆ skip_to_end_of_list()

void smt2_tokenizert::skip_to_end_of_list ( )
protected

skip any tokens until all parentheses are closed or the end of file is reached

◆ token_is_quoted_symbol()

bool smt2_tokenizert::token_is_quoted_symbol ( ) const
inline

Definition at line 89 of file smt2_tokenizer.h.

Member Data Documentation

◆ buffer

std::string smt2_tokenizert::buffer
protected

Definition at line 109 of file smt2_tokenizer.h.

◆ in

std::istream* smt2_tokenizert::in
protected

Definition at line 107 of file smt2_tokenizer.h.

◆ line_no

unsigned smt2_tokenizert::line_no
protected

Definition at line 108 of file smt2_tokenizer.h.

◆ peeked

bool smt2_tokenizert::peeked
protected

Definition at line 111 of file smt2_tokenizer.h.

◆ quoted_symbol

bool smt2_tokenizert::quoted_symbol = false
protected

Definition at line 110 of file smt2_tokenizer.h.

◆ token

tokent smt2_tokenizert::token
protected

Definition at line 112 of file smt2_tokenizer.h.


The documentation for this class was generated from the following files: