* This file must be processed with yacc/bison. */
/*
- * GiNaC Copyright (C) 1999-2002 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2003 Johannes Gutenberg University Mainz, Germany
*
* 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
%{
#include <stdexcept>
-#include "input_lexer.h"
#include "ex.h"
+#include "input_lexer.h"
#include "relational.h"
+#include "operators.h"
#include "symbol.h"
#include "lst.h"
#include "power.h"
/* Tokens (T_LITERAL means a literal value returned by the parser, but not
of class numeric or symbol (e.g. a constant or the FAIL object)) */
-%token T_NUMBER T_SYMBOL T_LITERAL T_DIGITS T_EQUAL T_NOTEQ T_LESSEQ T_GREATEREQ
+%token T_EOF T_NUMBER T_SYMBOL T_LITERAL T_DIGITS T_EQUAL T_NOTEQ T_LESSEQ T_GREATEREQ
/* Operator precedence and associativity */
%right '='
*/
%%
-input : exp {
+input : exp T_EOF {
try {
parsed_ex = $1;
YYACCEPT;
YYERROR;
}
}
- | error {yyclearin; yyerrok;}
;
exp : T_NUMBER {$$ = $1;}