ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/libgender/doom3map_lexer.l
Revision: 1.3
Committed: Sat Nov 6 00:44:50 2004 UTC (21 years, 11 months ago) by root
Branch: MAIN
Changes since 1.2: +21 -3 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     "/*" BEGIN(IN_COMMENT);
17     }
18     <IN_COMMENT>{
19     "*/" BEGIN(INITIAL);
20     [^*\n]+
21     "*"
22     \n yylineno++;
23     }
24    
25 root 1.1 \[.*\] ;
26     \"[^\"]*\" { yylval.string = strndup (yytext + 1, yyleng - 2); return STRING; }
27 root 1.3 {DIGIT}+ { yylval.num = atof (yytext); return NUMBER; }
28     [-+]?{DIGIT}+"."{DIGIT}* { yylval.num = atof (yytext); return NUMBER; }
29 root 1.2
30 root 1.1
31 root 1.2 \/\/.* ;
32 root 1.1
33     [\040\t\r,] ;
34     \n yylineno++;
35    
36 root 1.2 [\;\{\}()] return yytext[0];
37 root 1.1
38 root 1.3 model return MODEL;
39    
40     interAreaPortals return IAPO;
41     nodes return NODES;
42     shadowModel return SHADOWMODEL;
43    
44     [A-Za-z0-9_]+ { yylval.string = strndup (yytext, yyleng); return ID; }
45 root 1.1
46     %%
47    
48     int yywrap ()
49     {
50     return 1;
51     }
52    
53