SCalc
Public Member Functions | Protected Attributes | List of all members
SCalc::SyntaxError Class Reference

A syntax error This class represents a syntax error. You can get several informations about this error, such as the original_string(), the error_message(), the exact location of the error in the string (start_pos() and end_pos()). More...

#include <syntax.hh>

Inheritance diagram for SCalc::SyntaxError:
Inheritance graph
[legend]
Collaboration diagram for SCalc::SyntaxError:
Collaboration graph
[legend]

Public Member Functions

virtual int is_syntax_error ()
 Yes, this is a syntax error.
 SyntaxError (Session *s, const char *str, const char *error, int st, int en)
std::string original_string ()
 The original string on which the error occured.
std::string error_message ()
 The error message.
int start_pos ()
 The starting position.
int end_pos ()
 The end position.
virtual std::string pretty_print ()
 Pretty prints the error message Returns a std::string containing a nice display of the error message, with a series of ^^^^ showing where the error occurred. This function assumes that all characters have the same display size.
- Public Member Functions inherited from SCalc::ParserResult
 ParserResult (Session *s)
 Constructors/desctructors:
Sessionsession ()
 The SCalc::Session object used.
virtual int can_delete ()
virtual int is_expression ()
 Is it a SCalc::Expression ?
Expressionto_expression ()
 Converts to SCalc::Expression.
SyntaxErrorto_syntax_error ()
 Converts to SCalc::SyntaxError.
virtual int is_func_def ()
 Is it a SCalc::FuncDef ?
FuncDefto_func_def ()
 Converts to SCalc::FuncDef.

Protected Attributes

std::string original
std::string message
int start
int end

Detailed Description

A syntax error This class represents a syntax error. You can get several informations about this error, such as the original_string(), the error_message(), the exact location of the error in the string (start_pos() and end_pos()).


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