Thea
Public Member Functions | Public Attributes | List of all members
ParseError Class Reference

Thrown by TextInputStream and other parsers on unexpected input. More...

#include <TextInputStream.hpp>

Inheritance diagram for ParseError:
TextInputStream::TokenException TextInputStream::BadMSVCSpecial TextInputStream::WrongString TextInputStream::WrongSymbol TextInputStream::WrongTokenType

Public Member Functions

 ParseError ()
 Default constructor. More...
 
 ParseError (std::string const &src_, int l, int c, std::string const &m)
 Initialize from a file path, line number, character number and error message. More...
 
 ParseError (std::string const &src_, int64 b, std::string const &m)
 Initialize from a file path, byte position and error message. More...
 
 ~ParseError () throw ()
 Destructor. More...
 

Public Attributes

int64 byte
 For a binary file, the location of the parse error. More...
 
int character
 Character number (in the line) of the start of the token which caused the exception. More...
 
int line
 For a text file, the line number is the line number of start of token which caused the exception. More...
 
std::string src
 Path to the file being parsed or a short description of the source string. More...
 

Detailed Description

Thrown by TextInputStream and other parsers on unexpected input.

Definition at line 171 of file TextInputStream.hpp.

Constructor & Destructor Documentation

Default constructor.

Definition at line 196 of file TextInputStream.hpp.

ParseError ( std::string const &  src_,
int  l,
int  c,
std::string const &  m 
)

Initialize from a file path, line number, character number and error message.

Definition at line 199 of file TextInputStream.hpp.

ParseError ( std::string const &  src_,
int64  b,
std::string const &  m 
)

Initialize from a file path, byte position and error message.

Definition at line 203 of file TextInputStream.hpp.

~ParseError ( )
throw (
)

Destructor.

Definition at line 207 of file TextInputStream.hpp.

Member Data Documentation

int64 byte

For a binary file, the location of the parse error.

-1 if unknown.

Definition at line 180 of file TextInputStream.hpp.

int character

Character number (in the line) of the start of the token which caused the exception.

1 is the first character in the line. May be -1 if unknown.

Definition at line 193 of file TextInputStream.hpp.

int line

For a text file, the line number is the line number of start of token which caused the exception.

1 is the first line of the file. -1 means unknown. Note that you can use TextInputStream::Settings::startingLineNumberOffset to shift the effective line number that is reported by that class.

Definition at line 187 of file TextInputStream.hpp.

std::string src

Path to the file being parsed or a short description of the source string.

Empty means unknown.

Definition at line 177 of file TextInputStream.hpp.


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