X-Git-Url: https://ginac.de/ginac.git//ginac.git?a=blobdiff_plain;f=ginac%2Finput_parser.yy;h=f9ead9e11b8a6d5d446bf96697dd2fdb7bcfab2c;hb=d6df01f083f2cc1d965f2893ef18b0eb67c4bfb5;hp=c5c78d2dd9cf4656e44d9825f851c1018c01fd7b;hpb=3229ec7c42ffc173f94f1c3bffbc30308c93e571;p=ginac.git diff --git a/ginac/input_parser.yy b/ginac/input_parser.yy index c5c78d2d..f9ead9e1 100644 --- a/ginac/input_parser.yy +++ b/ginac/input_parser.yy @@ -4,7 +4,7 @@ * This file must be processed with yacc/bison. */ /* - * GiNaC Copyright (C) 1999-2002 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2005 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 @@ -29,9 +29,10 @@ %{ #include -#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" @@ -57,7 +58,7 @@ ex attach_index(const ex & base, ex i, bool covariant); /* 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 '=' @@ -78,7 +79,7 @@ ex attach_index(const ex & base, ex i, bool covariant); */ %% -input : exp { +input : exp T_EOF { try { parsed_ex = $1; YYACCEPT; @@ -87,7 +88,6 @@ input : exp { YYERROR; } } - | error {yyclearin; yyerrok;} ; exp : T_NUMBER {$$ = $1;}