-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmdl.l
64 lines (47 loc) · 1.16 KB
/
mdl.l
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/* Initial C code */
%{
#include "y.tab.h"
%}
ID [a-zA-Z][a-zA-Z0-9_]*
%%
[ \t\n ]+ ;
\-?[0-9]+ |
\-?[0-9]+\. |
\-?[0-9]+\.[0-9]+ |
\-?\.[0-9]+ { yylval.val = atof(yytext);return DOUBLE;}
"//".* { return COMMENT;}
"light" {return LIGHT;}
"constants" {return CONSTANTS;}
"save_coord_system" {return SAVE_COORDS;}
"camera" {return CAMERA;}
"ambient" {return AMBIENT;}
"torus" { return TORUS;}
"sphere" { return SPHERE;}
"box" {return BOX;}
"line" {return LINE;}
"mesh" {return MESH;}
"texture" {return TEXTURE;}
"set" {return SET;}
"move" {return MOVE;}
"scale" {return SCALE;}
"rotate" {return ROTATE;}
"basename" {return BASENAME;}
"save_knobs" {return SAVE_KNOBS;}
"tween" {return TWEEN;}
"frames" {return FRAMES;}
"vary" {return VARY;}
"push" {return PUSH;}
"pop" {return POP;}
"save" {return SAVE;}
"generate_rayfiles" {return GENERATE_RAYFILES;}
"shading" {return SHADING;}
phong|flat|gouraud|raytrace|wireframe {
strcpy(yylval.string, yytext); return SHADING_TYPE;}
"setknobs" {return SETKNOBS;}
"focal" {return FOCAL;}
"display" {return DISPLAY;}
"web" {return WEB;}
":" {return CO;}
[a-zA-Z][\.a-zA-Z0-9_]* {
strcpy(yylval.string, yytext); return STRING;}
%%