syntax.hh
/*
syntax.hh, copyright (c) 2006 by Vincent Fourmond:
The class for describing syntax errors
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details (in the COPYING file).
*/
namespace SCalc {
class SyntaxError : public ParserResult {
protected:
std::string original;
std::string message;
int start;
int end;
public:
virtual int is_syntax_error() { return 1;};
SyntaxError(Session * s, const char * str,
const char *error, int st, int en);
std::string original_string() { return original;};
std::string error_message() { return message;};
int start_pos() { return start;};
int end_pos() { return end;};
virtual std::string pretty_print();
};
};
SCalc::Session
A class representing a whole session.
Definition: session.hh:75
SCalc::SyntaxError::original_string
std::string original_string()
The original string on which the error occured.
Definition: syntax.hh:41
SCalc::SyntaxError::is_syntax_error
virtual int is_syntax_error()
Yes, this is a syntax error.
Definition: syntax.hh:35
SCalc::ParserResult
The result of an SCalc::Session::eval().
Definition: expression.hh:36
SCalc::SyntaxError
A syntax error This class represents a syntax error. You can get several informations about this erro...
Definition: syntax.hh:26
SCalc::SyntaxError::start_pos
int start_pos()
The starting position.
Definition: syntax.hh:45
SCalc::SyntaxError::pretty_print
virtual std::string pretty_print()
Pretty prints the error message Returns a std::string containing a nice display of the error message...
SCalc::SyntaxError::error_message
std::string error_message()
The error message.
Definition: syntax.hh:43
SCalc::SyntaxError::end_pos
int end_pos()
The end position.
Definition: syntax.hh:47
SCalc
Definition: session.hh:45