ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libgender/doom3map_lexer.l
Revision: 1.4
Committed: Sat Nov 6 00:52:36 2004 UTC (19 years, 6 months ago) by root
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +4 -5 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 %{
2 #include <stdio.h>
3
4 #include "doom3map_parser.tab.h++"
5
6 %}
7 %x IN_COMMENT
8
9
10 DIGIT [0-9]
11
12
13 %%
14
15 <INITIAL>{
16 "/*" BEGIN(IN_COMMENT);
17 }
18 <IN_COMMENT>{
19 "*/" BEGIN(INITIAL);
20 [^*\n]+
21 "*"
22 \n yylineno++;
23 }
24
25 \[.*\] ;
26 \"[^\"]*\" { yylval.string = strndup (yytext + 1, yyleng - 2); return STRING; }
27 -?{DIGIT}+ { yylval.num = atof (yytext); return NUMBER; }
28 [-+]?{DIGIT}+"."{DIGIT}* { yylval.num = atof (yytext); return NUMBER; }
29
30 \/\/.* ;
31
32 [\040\t\r,] ;
33 \n yylineno++;
34
35 [\;\{\}()] return yytext[0];
36
37 model return MODEL;
38
39 interAreaPortals return IAPO;
40 nodes return NODES;
41 shadowModel return SHADOWMODEL;
42
43 [A-Za-z0-9_]+ { yylval.string = strndup (yytext, yyleng); return ID; }
44
45 %%
46
47 int yywrap ()
48 {
49 return 1;
50 }
51
52