mCRL2
Loading...
Searching...
No Matches
atermpp::text_aterm_istream Class Referencefinal

Reads terms in textual format from an input stream. More...

#include <aterm_io_text.h>

Inheritance diagram for atermpp::text_aterm_istream:
atermpp::aterm_istream atermpp::aterm_stream

Public Member Functions

 text_aterm_istream (std::istream &os)
 
void get (aterm &t) override
 Reads an aterm from this stream.
 
- Public Member Functions inherited from atermpp::aterm_istream
virtual ~aterm_istream ()
 
virtual void get (aterm &t)=0
 Reads an aterm from this stream.
 
- Public Member Functions inherited from atermpp::aterm_stream
virtual ~aterm_stream ()
 
void set_transformer (aterm_transformer transformer)
 Sets the given transformer to be applied to following writes.
 
aterm_transformerget_transformer () const
 

Private Member Functions

aterm parse_aterm (int &character)
 Parse a term from the input stream and return it.
 
aterm parse_aterm_appl (const std::string &function_name, int &character)
 Parses an "f"(t0, ..., tn) application as an aterm.
 
aterm_int parse_aterm_int (int &character)
 Parses an std::size_t as an aterm_int.
 
aterm_list parse_aterm_list (int &character, char begin, char end)
 Parses a list of arguments [...] as terms.
 
std::string parse_quoted_string (int &character)
 Reads a quoted string from the stream.
 
std::string parse_unquoted_string (int &character)
 Reads an unquoted string from the stream.
 
std::string print_parse_error_position ()
 
int next_char (bool skip_whitespace=true, bool required=false)
 

Private Attributes

std::istream & m_stream
 
std::size_t m_line = 0
 The line number of the current character.
 
std::size_t m_column = 0
 The column of the current character.
 
std::size_t m_history_limit = 64
 Determines the maximum number of characters that are stored.
 
std::deque< char > m_history
 Stores the characters that have been read so-far.
 
int character
 The last character that was read.
 

Additional Inherited Members

- Protected Attributes inherited from atermpp::aterm_stream
aterm_transformerm_transformer = identity
 

Detailed Description

Reads terms in textual format from an input stream.

Definition at line 38 of file aterm_io_text.h.

Constructor & Destructor Documentation

◆ text_aterm_istream()

atermpp::text_aterm_istream::text_aterm_istream ( std::istream &  os)

Definition at line 89 of file aterm_io_text.cpp.

Member Function Documentation

◆ get()

void atermpp::text_aterm_istream::get ( aterm t)
overridevirtual

Reads an aterm from this stream.

Implements atermpp::aterm_istream.

Definition at line 95 of file aterm_io_text.cpp.

◆ next_char()

int atermpp::text_aterm_istream::next_char ( bool  skip_whitespace = true,
bool  required = false 
)
private
Returns
The first character that is not whitespace or end-of-file (EOF).
Parameters
skip_whitespace,returnsthe next non space character.
requiredThrow error when the next character is EOL.

Definition at line 266 of file aterm_io_text.cpp.

◆ parse_aterm()

aterm atermpp::text_aterm_istream::parse_aterm ( int &  character)
private

Parse a term from the input stream and return it.

Definition at line 164 of file aterm_io_text.cpp.

◆ parse_aterm_appl()

aterm atermpp::text_aterm_istream::parse_aterm_appl ( const std::string &  function_name,
int &  character 
)
private

Parses an "f"(t0, ..., tn) application as an aterm.

Definition at line 191 of file aterm_io_text.cpp.

◆ parse_aterm_int()

aterm_int atermpp::text_aterm_istream::parse_aterm_int ( int &  character)
private

Parses an std::size_t as an aterm_int.

Definition at line 201 of file aterm_io_text.cpp.

◆ parse_aterm_list()

aterm_list atermpp::text_aterm_istream::parse_aterm_list ( int &  character,
char  begin,
char  end 
)
private

Parses a list of arguments [...] as terms.

Definition at line 224 of file aterm_io_text.cpp.

◆ parse_quoted_string()

std::string atermpp::text_aterm_istream::parse_quoted_string ( int &  character)
private

Reads a quoted string from the stream.

Returns
The parsed string and the first character after this string that is not whitespace.

Definition at line 313 of file aterm_io_text.cpp.

◆ parse_unquoted_string()

std::string atermpp::text_aterm_istream::parse_unquoted_string ( int &  character)
private

Reads an unquoted string from the stream.

Definition at line 356 of file aterm_io_text.cpp.

◆ print_parse_error_position()

std::string atermpp::text_aterm_istream::print_parse_error_position ( )
private
Returns
A string indicating the parse error position.

Definition at line 255 of file aterm_io_text.cpp.

Member Data Documentation

◆ character

int atermpp::text_aterm_istream::character
private

The last character that was read.

Definition at line 81 of file aterm_io_text.h.

◆ m_column

std::size_t atermpp::text_aterm_istream::m_column = 0
private

The column of the current character.

Definition at line 76 of file aterm_io_text.h.

◆ m_history

std::deque<char> atermpp::text_aterm_istream::m_history
private

Stores the characters that have been read so-far.

Definition at line 79 of file aterm_io_text.h.

◆ m_history_limit

std::size_t atermpp::text_aterm_istream::m_history_limit = 64
private

Determines the maximum number of characters that are stored.

Definition at line 78 of file aterm_io_text.h.

◆ m_line

std::size_t atermpp::text_aterm_istream::m_line = 0
private

The line number of the current character.

Definition at line 75 of file aterm_io_text.h.

◆ m_stream

std::istream& atermpp::text_aterm_istream::m_stream
private

Definition at line 73 of file aterm_io_text.h.


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