CBMC
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) const
 generate an error exception, pre-filled with a message More...
 
smt2_errort error () const
 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...
 

Detailed Description

Definition at line 15 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 66 of file smt2_tokenizer.h.

Constructor & Destructor Documentation

◆ smt2_tokenizert()

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

Definition at line 18 of file smt2_tokenizer.h.

Member Function Documentation

◆ error() [1/2]

smt2_errort smt2_tokenizert::error ( ) const
inline

generate an error exception

Definition at line 108 of file smt2_tokenizer.h.

◆ error() [2/2]

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

generate an error exception, pre-filled with a message

Definition at line 102 of file smt2_tokenizer.h.

◆ get_bin_numeral()

smt2_tokenizert::tokent smt2_tokenizert::get_bin_numeral ( )
private

Definition at line 84 of file smt2_tokenizer.cpp.

◆ get_buffer()

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

Definition at line 91 of file smt2_tokenizer.h.

◆ get_decimal_numeral()

smt2_tokenizert::tokent smt2_tokenizert::get_decimal_numeral ( )
private

Definition at line 57 of file smt2_tokenizer.cpp.

◆ get_hex_numeral()

smt2_tokenizert::tokent smt2_tokenizert::get_hex_numeral ( )
private

Definition at line 113 of file smt2_tokenizer.cpp.

◆ get_quoted_symbol()

smt2_tokenizert::tokent smt2_tokenizert::get_quoted_symbol ( )
private

Definition at line 142 of file smt2_tokenizer.cpp.

◆ get_simple_symbol()

smt2_tokenizert::tokent smt2_tokenizert::get_simple_symbol ( )
private

Definition at line 24 of file smt2_tokenizer.cpp.

◆ get_string_literal()

smt2_tokenizert::tokent smt2_tokenizert::get_string_literal ( )
private

Definition at line 170 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 211 of file smt2_tokenizer.cpp.

◆ next_token()

smt2_tokenizert::tokent smt2_tokenizert::next_token ( )

Definition at line 201 of file smt2_tokenizer.cpp.

◆ peek()

tokent smt2_tokenizert::peek ( )
inline

Definition at line 79 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 96 of file smt2_tokenizer.h.

Member Data Documentation

◆ buffer

std::string smt2_tokenizert::buffer
protected

Definition at line 116 of file smt2_tokenizer.h.

◆ in

std::istream* smt2_tokenizert::in
protected

Definition at line 114 of file smt2_tokenizer.h.

◆ line_no

unsigned smt2_tokenizert::line_no
protected

Definition at line 115 of file smt2_tokenizer.h.

◆ peeked

bool smt2_tokenizert::peeked
protected

Definition at line 118 of file smt2_tokenizer.h.

◆ quoted_symbol

bool smt2_tokenizert::quoted_symbol = false
protected

Definition at line 117 of file smt2_tokenizer.h.

◆ token

tokent smt2_tokenizert::token
protected

Definition at line 119 of file smt2_tokenizer.h.


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