fart/parser/parser.lex
Josh Holtrop 96f2b7d276 added ambient_occlusion global scene option to parser and vim keywords; added ambient_occlusion scene file
git-svn-id: svn://anubis/fart/trunk@263 7f9b0f55-74a9-4bce-be96-3c2cd072584d
2010-06-29 19:37:53 +00:00

90 lines
2.5 KiB
Plaintext

%option nounput
%option bison-locations
%{
#include "nodes.h"
#include "parser.h"
#include "parser.tab.hh"
%}
%%
\+ return PLUS;
- return MINUS;
\* return STAR;
\/ return DIVIDE;
% return MOD;
; return SEMICOLON;
: return COLON;
\? return QUESTION;
\$ return DOLLAR;
\. return DOT;
\" return DQUOTE;
\' return SQUOTE;
, return COMMA;
\{ return LCURLY;
\} return RCURLY;
\[ return LBRACKET;
\] return RBRACKET;
\( return LPAREN;
\) return RPAREN;
\< 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;
ambient return AMBIENT;
ambient_occlusion return AMBIENT_OCCLUSION;
box return BOX;
camera return CAMERA;
color return COLOR;
cyl return CYL;
define return DEFINE;
diffuse return DIFFUSE;
exposure return EXPOSURE;
height return HEIGHT;
intersect return INTERSECT;
jitter return JITTER;
light return LIGHT;
look_at return LOOKAT;
material return MATERIAL;
max_depth return MAXDEPTH;
multisample return MULTISAMPLE;
options return OPTIONS;
plane return PLANE;
position return POSITION;
radius return RADIUS;
reflectance return REFLECTANCE;
rotate return ROTATE;
scale return SCALE;
scene return SCENE;
shininess return SHININESS;
size return SIZE;
specular return SPECULAR;
sphere return SPHERE;
subtract return SUBTRACT;
translate return TRANSLATE;
transparency return TRANSPARENCY;
union return UNION;
up return UP;
vfov return VFOV;
width return WIDTH;
[a-zA-Z_][a-zA-Z_0-9]* {
*yylval = new IdentifierNode(yytext);
return IDENTIFIER;
}
\n yylloc->first_line++; yylloc->last_line++;
[ \t\v] /* ignore whitespace */
. return yytext[0];
%%