summaryrefslogtreecommitdiff
path: root/i/marvin/src/config/lexer.ll
diff options
context:
space:
mode:
Diffstat (limited to 'i/marvin/src/config/lexer.ll')
-rw-r--r--i/marvin/src/config/lexer.ll30
1 files changed, 18 insertions, 12 deletions
diff --git a/i/marvin/src/config/lexer.ll b/i/marvin/src/config/lexer.ll
index 96a90b3..34522dc 100644
--- a/i/marvin/src/config/lexer.ll
+++ b/i/marvin/src/config/lexer.ll
@@ -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
//
@@ -23,7 +23,7 @@
//
// }}}
#include "config/config.hh"
-#include "config/parser_extra.hh"
+#include "config/config_parser.hh"
#include "utils/any.hh"
#include "parser.hh"
%}
@@ -75,17 +75,19 @@ FLOATNUM {FLOAT1}|{FLOAT2}
yyextra->tmp.clear ();
}
-[=\n()] return yytext[0];
+\n {
+ yyextra->line++;
+ return yytext[0];
+}
-"img:" return IMG;
-"data:" return DATA;
+[=()] return yytext[0];
[ \t]+ /* Skip. */
#.* /* Skip comments. */
. {
- yylval->c = yytext[0];
- std::cout << "UNKNOWN " << yytext[0] << std::endl;
+ yyextra->error (std::string ("unexpected character \'") \
+ + yytext[0] + '\'');
return UNKNOWN;
}
@@ -98,14 +100,18 @@ FLOATNUM {FLOAT1}|{FLOAT2}
<strst>\\n yyextra->tmp += '\n';
<strst>\\r yyextra->tmp += '\r';
<strst>\\t yyextra->tmp += '\t';
-<strst>\\(.|\n) yyextra->tmp += yytext[1];
+<strst>\\. yyextra->tmp += yytext[1];
+<strst>\\\n {
+ yyextra->line++;
+ yyextra->tmp += yytext[1];
+}
<strst>. yyextra->tmp += yytext[0];
<strst>\n {
- yylval->c = yytext[0];
+ yyextra->error ("unexpected end of line inside string");
+ yyextra->line++;
return UNKNOWN;
}
-
%%
/* vim:ft=lex: