commit before attempting to compile flex scanner with C++ instead of C
git-svn-id: svn://anubis/fart/trunk@114 7f9b0f55-74a9-4bce-be96-3c2cd072584d
This commit is contained in:
parent
3aed1c21ca
commit
6e67597dc7
@ -1,6 +1,10 @@
|
||||
|
||||
%{
|
||||
|
||||
#include "nodes.h"
|
||||
#define YYSTYPE refptr<Node>
|
||||
#include "parser.tab.hh"
|
||||
|
||||
%}
|
||||
|
||||
%%
|
||||
@ -29,8 +33,8 @@
|
||||
\< return LESS;
|
||||
\> return GREATER;
|
||||
|
||||
-?[0-9]+ return DEC_NUMBER;
|
||||
-?[0-9]*\.[0-9]+ return REAL_NUMBER;
|
||||
-?[0-9]+ yylval = new NumberNode(atoi(yytext)); return DEC_NUMBER;
|
||||
-?[0-9]*\.[0-9]+ yylval = new NumberNode(atof(yytext)); return REAL_NUMBER;
|
||||
|
||||
ambient return AMBIENT;
|
||||
box return BOX;
|
||||
|
@ -16,7 +16,6 @@ extern "C" {
|
||||
}
|
||||
|
||||
extern FILE * yyin;
|
||||
extern char * yytext;
|
||||
|
||||
void yyerror(const char * str)
|
||||
{
|
||||
@ -218,12 +217,8 @@ material_item: AMBIENT vector {
|
||||
}
|
||||
;
|
||||
|
||||
number: DEC_NUMBER {
|
||||
$$ = new NumberNode(atoi(yytext));
|
||||
}
|
||||
| REAL_NUMBER {
|
||||
$$ = new NumberNode(atof(yytext));
|
||||
}
|
||||
number: DEC_NUMBER { $$ = $1; }
|
||||
| REAL_NUMBER { $$ = $1; }
|
||||
;
|
||||
|
||||
options: OPTIONS LCURLY options_items RCURLY {
|
||||
@ -241,13 +236,13 @@ options_items: /* empty */
|
||||
;
|
||||
|
||||
options_item: WIDTH DEC_NUMBER {
|
||||
$$ = new WidthNode(atoi(yytext));
|
||||
$$ = new WidthNode($2->getNumber());
|
||||
}
|
||||
| HEIGHT DEC_NUMBER {
|
||||
$$ = new HeightNode(atoi(yytext));
|
||||
$$ = new HeightNode($2->getNumber());
|
||||
}
|
||||
| MULTISAMPLE DEC_NUMBER {
|
||||
$$ = new MultisampleNode(atoi(yytext));
|
||||
$$ = new MultisampleNode($2->getNumber());
|
||||
}
|
||||
;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user