An expression ! More...
#include <expression.hh>


Public Member Functions | |
| Expression (Session *s) | |
| virtual int | is_expression () |
| Yes, this is an expression: | |
| virtual double | evaluate (const double *values, const double *s=NULL)=0 |
| Evaluate the expression. | |
| virtual void | dump (::std::ostream &stream=::std::cerr) |
| Dumps the contents of the expression to a stream. | |
| virtual std::set< int > | used_variables () |
| Variable used by an expression. | |
| int | evaluable () |
| Tells if this expression can be evaluated. | |
| double | evaluate () |
| If it can be evaluated, returns the given value. | |
| virtual int | is_null () |
| virtual int | is_id () |
| If Id, then the value is always 1. | |
| virtual int | is_const () |
| If const, then the value is always 1. | |
| virtual int | is_valid () |
| virtual Expression * | derive (int id) |
| Derive an expression with regards to one variable. | |
| virtual Expression * | copy () |
| Returns a freshly allocated copy of the expression. | |
| virtual std::string | pretty_print ()=0 |
| Pretty prints to a string. | |
| virtual Expression * | simplify () |
| Simplifies the expression. | |
| virtual double * | mass_evaluate (int nb, double *target, const double **variables) |
| Evaluates the Expression for different parameters. | |
Static Public Member Functions | |
Oper5e77ef400008 (at your option) any later version.
00009
00010 This program is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00013 GNU General Public License for more details (in the COPYING file).
00014
00015 */
00016
00017 namespace SCalc {
00018
00026 class SyntaxError : public ParserResult {
00027 protected:
00028 std::string original;
00029 std::string message;
00030 int start;
00031 int end;
00032 public:
00033
00035 virtual int is_syntax_error() { return 1;};
00036
00037 SyntaxError(Session * s, const char * str,
00038 const char *error, int st, int en);
00039
00041 std::string original_string() { return original;};
00043 std::string error_message() { return message;};
00045 int start_pos() { return start;};
00047 int end_pos() { return end;};
00048
00056 virtual std::string pretty_print();
00057 };
00058 };
Generated by 1.7.1
| |