summaryrefslogtreecommitdiff
path: root/i/marvin/src/config/parser.yy
diff options
context:
space:
mode:
Diffstat (limited to 'i/marvin/src/config/parser.yy')
-rw-r--r--i/marvin/src/config/parser.yy26
1 files changed, 12 insertions, 14 deletions
diff --git a/i/marvin/src/config/parser.yy b/i/marvin/src/config/parser.yy
index 1aeb986..dc2be24 100644
--- a/i/marvin/src/config/parser.yy
+++ b/i/marvin/src/config/parser.yy
@@ -1,9 +1,9 @@
%{
-// robert - programme du robot 2005. {{{
+// marvin - programme du robot 2006. {{{
//
-// Copyright (C) 2005 Nicolas Schodet
+// Copyright (C) 2006 Nicolas Schodet
//
-// Robot APB Team/Efrei 2005.
+// Robot APB Team/Efrei 2006.
// Web: http://assos.efrei.fr/robot/
// Email: robot AT efrei DOT fr
//
@@ -22,28 +22,25 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// }}}
-#define YYPARSE_PARAM scanner
-#define YYLEX_PARAM scanner
-
#include "config/config.hh"
#include "config/config_data.hh"
-#include "config/parser_extra.hh"
+#include "config/config_parser.hh"
// Fichiers d'en-tête générés.
#include "parser.hh"
#include "lexer.hh"
-#include <iostream> // XXX à virer.
-
-void yyerror (const char *);
-
#undef yyextra
#define yyextra (yyget_extra (scanner))
+void yyerror (void *scanner, const char *e);
+
%}
%error-verbose
%pure-parser
+%lex-param {void *scanner}
+%parse-param {void *scanner}
%defines
%union {
char c;
@@ -64,7 +61,6 @@ void yyerror (const char *);
%token<f> FLOAT
%token<s> ID STRING
%token<b> BOOLEAN
-%token IMG DATA
%type<a> int_list
%type<a> float_list
@@ -159,9 +155,11 @@ string_list:
%%
-void yyerror (const char *e)
+/// Traite une erreur de Bison.
+void
+yyerror (void *scanner, const char *e)
{
- std::cerr << e << std::endl;
+ yyextra->error (e);
}
/* Shut up warning for this wrongly declared static function. */