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, 7 months ago) by root
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +4 -5 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.1 %{
2     #include <stdio.h>
3    
4 root 1.3 #include "doom3map_parser.tab.h++"
5 root 1.1
6     %}
7 root 1.3 %x IN_COMMENT
8 root 1.1
9 root 1.2
10     DIGIT [0-9]
11    
12    
13 root 1.1 %%
14    
15 root 1.3 <INITIAL>{
16 root 1.4 "/*" BEGIN(IN_COMMENT);
17 root 1.3 }
18     <IN_COMMENT>{
19 root 1.4 "*/" BEGIN(INITIAL);
20 root 1.3 [^*\n]+
21     "*"
22 root 1.4 \n yylineno++;
23 root 1.3 }
24    
25 root 1.1 \[.*\] ;
26     \"[^\"]*\" { yylval.string = strndup (yytext + 1, yyleng - 2); return STRING; }
27 root 1.4 -?{DIGIT}+ { yylval.num = atof (yytext); return NUMBER; }
28 root 1.3 [-+]?{DIGIT}+"."{DIGIT}* { yylval.num = atof (yytext); return NUMBER; }
29 root 1.1
30 root 1.2 \/\/.* ;
31 root 1.1
32     [\040\t\r,] ;
33     \n yylineno++;
34    
35 root 1.2 [\;\{\}()] return yytext[0];
36 root 1.1
37 root 1.3 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 root 1.1
45     %%
46    
47     int yywrap ()
48     {
49     return 1;
50     }
51    
52