cprover
smt2_tokenizert Class Reference

#include <smt2_tokenizer.h>

Inheritance diagram for smt2_tokenizert:
[legend]
Collaboration diagram for smt2_tokenizert:
[legend]

Public Member Functions

 smt2_tokenizert (std::istream &_in)
 
 operator bool ()
 
- Public Member Functions inherited from parsert
virtual void clear ()
 
 parsert ()
 
virtual ~parsert ()
 
bool read (char &ch)
 
virtual bool parse ()=0
 
bool eof ()
 
void parse_error (const std::string &message, const std::string &before)
 
void inc_line_no ()
 
void set_line_no (unsigned _line_no)
 
void set_file (const irep_idt &file)
 
irep_idt get_file () const
 
unsigned get_line_no () const
 
unsigned get_column () const
 
void set_column (unsigned _column)
 
void set_source_location (exprt &e)
 
void set_function (const irep_idt &function)
 
void advance_column (unsigned token_width)
 
- Public Member Functions inherited from messaget
virtual void set_message_handler (message_handlert &_message_handler)
 
message_handlertget_message_handler ()
 
 messaget ()
 
 messaget (const messaget &other)
 
messagetoperator= (const messaget &other)
 
 messaget (message_handlert &_message_handler)
 
virtual ~messaget ()
 
mstreamtget_mstream (unsigned message_level) const
 
mstreamterror () const
 
mstreamtwarning () const
 
mstreamtresult () const
 
mstreamtstatus () const
 
mstreamtstatistics () const
 
mstreamtprogress () const
 
mstreamtdebug () const
 
void conditional_output (mstreamt &mstream, const std::function< void(mstreamt &)> &output_generator) const
 Generate output to mstream using output_generator if the configured verbosity is at least as high as that of mstream. More...
 

Protected Types

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

Protected Member Functions

tokent next_token ()
 
tokent peek ()
 
mstreamterror ()
 

Protected Attributes

std::string buffer
 
bool ok
 
bool peeked
 
tokent token
 
- Protected Attributes inherited from parsert
source_locationt source_location
 
unsigned line_no
 
unsigned previous_line_no
 
unsigned column
 
- Protected Attributes inherited from messaget
message_handlertmessage_handler
 
mstreamt mstream
 

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 ()
 

Static Private Member Functions

static bool is_simple_symbol_character (char)
 

Additional Inherited Members

- Public Types inherited from messaget
enum  message_levelt {
  M_ERROR =1, M_WARNING =2, M_RESULT =4, M_STATUS =6,
  M_STATISTICS =8, M_PROGRESS =9, M_DEBUG =10
}
 
- Static Public Member Functions inherited from messaget
static unsigned eval_verbosity (const std::string &user_input, const message_levelt default_verbosity, message_handlert &dest)
 Parse a (user-)provided string as a verbosity level and set it as the verbosity of dest. More...
 
static mstreamteom (mstreamt &m)
 
static mstreamtendl (mstreamt &m)
 
- Public Attributes inherited from parsert
std::istream * in
 
std::string this_line
 
std::string last_line
 
std::vector< exprtstack
 

Detailed Description

Definition at line 16 of file smt2_tokenizer.h.

Member Typedef Documentation

◆ tokent

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

Definition at line 35 of file smt2_tokenizer.h.

Constructor & Destructor Documentation

◆ smt2_tokenizert()

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

Definition at line 19 of file smt2_tokenizer.h.

References parsert::in, and parsert::line_no.

Member Function Documentation

◆ error()

◆ get_bin_numeral()

smt2_tokenizert::tokent smt2_tokenizert::get_bin_numeral ( )
private

Definition at line 82 of file smt2_tokenizer.cpp.

References buffer, and parsert::in.

Referenced by next_token().

◆ get_decimal_numeral()

smt2_tokenizert::tokent smt2_tokenizert::get_decimal_numeral ( )
private

Definition at line 55 of file smt2_tokenizer.cpp.

References buffer, and parsert::in.

Referenced by next_token().

◆ get_hex_numeral()

smt2_tokenizert::tokent smt2_tokenizert::get_hex_numeral ( )
private

Definition at line 111 of file smt2_tokenizer.cpp.

References buffer, and parsert::in.

Referenced by next_token().

◆ get_quoted_symbol()

smt2_tokenizert::tokent smt2_tokenizert::get_quoted_symbol ( )
private

Definition at line 140 of file smt2_tokenizer.cpp.

References buffer, messaget::eom(), error(), parsert::in, and parsert::line_no.

Referenced by next_token().

◆ get_simple_symbol()

smt2_tokenizert::tokent smt2_tokenizert::get_simple_symbol ( )
private

Definition at line 26 of file smt2_tokenizer.cpp.

References buffer, parsert::in, and is_simple_symbol_character().

Referenced by next_token().

◆ get_string_literal()

smt2_tokenizert::tokent smt2_tokenizert::get_string_literal ( )
private

Definition at line 166 of file smt2_tokenizer.cpp.

References buffer, messaget::eom(), error(), parsert::in, and STRING_LITERAL.

Referenced by next_token().

◆ is_simple_symbol_character()

bool smt2_tokenizert::is_simple_symbol_character ( char  ch)
staticprivate

Definition at line 13 of file smt2_tokenizer.cpp.

Referenced by get_simple_symbol(), and next_token().

◆ next_token()

◆ operator bool()

smt2_tokenizert::operator bool ( )
inline

Definition at line 26 of file smt2_tokenizer.h.

References ok.

◆ peek()

Member Data Documentation

◆ buffer

◆ ok

bool smt2_tokenizert::ok
protected

Definition at line 33 of file smt2_tokenizer.h.

Referenced by error(), operator bool(), and smt2_parsert::parse().

◆ peeked

bool smt2_tokenizert::peeked
protected

Definition at line 33 of file smt2_tokenizer.h.

Referenced by next_token(), and peek().

◆ token

tokent smt2_tokenizert::token
protected

Definition at line 36 of file smt2_tokenizer.h.

Referenced by smt2_parsert::command_sequence(), next_token(), and peek().


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