]> www.ginac.de Git - ginac.git/commitdiff
synced to 1.0
authorChristian Bauer <Christian.Bauer@uni-mainz.de>
Thu, 24 Oct 2002 18:14:55 +0000 (18:14 +0000)
committerChristian Bauer <Christian.Bauer@uni-mainz.de>
Thu, 24 Oct 2002 18:14:55 +0000 (18:14 +0000)
ginac/input_lexer.ll
ginac/input_parser.yy

index 4a5a65015e31ac983b64a92a18b1e8fb7457f694..139d6907aa58b2a237922cbf247e33dbb59eb17b 100644 (file)
@@ -87,7 +87,7 @@ AN    [0-9a-zA-Z_]
  */
 
 %%
-[ \t]+                 /* skip whitespace */
+[ \t\n]+               /* skip whitespace */
 
                        /* special values */
 Pi                     ginac_yylval = Pi; return T_LITERAL;
@@ -123,6 +123,9 @@ Digits                      ginac_yylval = (long)Digits; return T_DIGITS;
                                return T_SYMBOL;
                        }
 
+                       /* end of input */
+<<EOF>>                        return T_EOF;
+
                        /* everything else */
 .                      return *yytext;
 
index ecdc317e6ee08dd706c8228887c15ee94cbc4203..9b8799dd74423678f84959ea391975498d824ebe 100644 (file)
@@ -58,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 '='
@@ -79,7 +79,7 @@ ex attach_index(const ex & base, ex i, bool covariant);
  */
 
 %%
-input  : exp {
+input  : exp T_EOF {
                try {
                        parsed_ex = $1;
                        YYACCEPT;
@@ -88,7 +88,6 @@ input : exp {
                        YYERROR;
                }
        }
-       | error         {yyclearin; yyerrok;}
        ;
 
 exp    : T_NUMBER              {$$ = $1;}