]> www.ginac.de Git - ginac.git/blobdiff - ginac/input_parser.yy
"return" statement was missing in yyerror()
[ginac.git] / ginac / input_parser.yy
index 0bec16c75cc493c2fb4e4c32818df237c803ec48..af46af0a04751e134d18c525b5d2df4349e2708a 100644 (file)
@@ -4,7 +4,7 @@
  *  This file must be processed with yacc/bison. */
 
 /*
- *  GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2001 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
@@ -49,7 +49,7 @@ namespace GiNaC {
 ex parsed_ex;
 
 // Last error message returned by parser
-static string parser_error;
+static std::string parser_error;
 %}
 
 /* Tokens (T_LITERAL means a literal value returned by the parser, but not
@@ -78,8 +78,8 @@ input : exp {
                try {
                        parsed_ex = $1;
                        YYACCEPT;
-               } catch (exception &e) {
-                       parser_error = e.what();
+               } catch (std::exception &err) {
+                       parser_error = err.what();
                        YYERROR;
                }
        }
@@ -146,7 +146,7 @@ row : exp                   {$$ = lst($1);}
 
 %%
 // Get last error encountered by parser
-string get_parser_error(void)
+std::string get_parser_error(void)
 {
        return parser_error;
 }
@@ -160,5 +160,6 @@ using GiNaC::parser_error;
 // Error print routine (store error string in parser_error)
 int ginac_yyerror(char *s)
 {
-       parser_error = string(s) + " at " + string(ginac_yytext);
+       parser_error = std::string(s) + " at " + std::string(ginac_yytext);
+       return 0;
 }