added location directives to flex and bison sources

git-svn-id: svn://anubis/fart/trunk@127 7f9b0f55-74a9-4bce-be96-3c2cd072584d
This commit is contained in:
Josh Holtrop committed 2009-02-18 01:35:09 +00:00
1 parent b9cc1fe9f9
commit aaaac6d887
2 files changed
+8 -3

No files matched your search

+3 -2
View File
@@ -1,5 +1,6 @@
%option nounput
%option bison-locations
%{
@@ -35,8 +36,8 @@
\< return LESS;
\> return GREATER;
-?[0-9]+ yylval = new IntegerNode(atoi(yytext)); return DEC_NUMBER;
-?[0-9]*\.[0-9]+ yylval = new NumberNode(atof(yytext)); return REAL_NUMBER;
-?[0-9]+ *yylval = new IntegerNode(atoi(yytext)); return DEC_NUMBER;
-?[0-9]*\.[0-9]+ *yylval = new NumberNode(atof(yytext)); return REAL_NUMBER;
ambient return AMBIENT;
box return BOX;
+5 -1
View File
@@ -7,9 +7,10 @@
#include "util/refptr.h"
#include "nodes.h"
#include "parser.h"
#include "parser.tab.hh" /* bison-generated header with YY[SL]TYPE */
using namespace std;
int yylex(void);
int yylex(YYSTYPE *, YYLTYPE *);
extern FILE * yyin;
@@ -27,6 +28,9 @@ static refptr<Node> parsed_scene_node;
%}
%pure-parser
%locations
%token PLUS;
%token MINUS;
%token STAR;