diff options
Diffstat (limited to 'LuaSL/src/LuaSL_lexer.l')
-rw-r--r-- | LuaSL/src/LuaSL_lexer.l | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/LuaSL/src/LuaSL_lexer.l b/LuaSL/src/LuaSL_lexer.l index 91e4264..2166743 100644 --- a/LuaSL/src/LuaSL_lexer.l +++ b/LuaSL/src/LuaSL_lexer.l | |||
@@ -19,22 +19,17 @@ | |||
19 | %option backup debug perf-report perf-report verbose warn | 19 | %option backup debug perf-report perf-report verbose warn |
20 | %option align full | 20 | %option align full |
21 | 21 | ||
22 | SPACE [ \r\n\t]* | 22 | HEX [[:xdigit:]] |
23 | 23 | NAME [[:alpha:]](_|[[:alpha:]]|[[:digit:]])* | |
24 | LETTER [A-Za-z] | 24 | INTEGER [[:digit:]]+ |
25 | DECIMAL [0-9] | ||
26 | HEX [0-9A-Fa-f] | ||
27 | |||
28 | NAME {LETTER}(_|{LETTER}|{DECIMAL})* | ||
29 | INTEGER {DECIMAL}+ | ||
30 | EXPONANT [eE][+-]?{INTEGER} | 25 | EXPONANT [eE][+-]?{INTEGER} |
31 | FLOAT {INTEGER}("."{INTEGER})?{EXPONANT}? | 26 | FLOAT {INTEGER}("."{INTEGER})?{EXPONANT}? |
32 | 27 | ||
33 | %% | 28 | %% |
34 | 29 | ||
35 | /* Basic tokens */ | 30 | /* Basic tokens */ |
36 | {SPACE} %{ ECHO; /* Skip blanks. */ %} | 31 | [[:space:]]+ %{ /* ECHO; yylval->spaceValue = strdup(yytext); return LSL_SPACE; */ %} |
37 | {NAME} %{ ECHO; /* yylval->nameValue=strdup(yytext); return LSL_NAME; */ %} | 32 | {NAME} %{ ECHO; /* yylval->nameValue = strdup(yytext); return LSL_NAME; */ %} |
38 | {INTEGER} %{ ECHO; yylval->integerValue = atoi(yytext); return LSL_INTEGER; %} | 33 | {INTEGER} %{ ECHO; yylval->integerValue = atoi(yytext); return LSL_INTEGER; %} |
39 | {FLOAT} %{ ECHO; /* yylval->floatValue = atof(yytext); return LSL_FLOAT; */ %} | 34 | {FLOAT} %{ ECHO; /* yylval->floatValue = atof(yytext); return LSL_FLOAT; */ %} |
40 | 35 | ||
@@ -74,12 +69,12 @@ int yywrap(yyscan_t yyscanner) | |||
74 | { | 69 | { |
75 | #ifdef FLEX_SCANNER | 70 | #ifdef FLEX_SCANNER |
76 | #ifndef LL_WINDOWS | 71 | #ifndef LL_WINDOWS |
77 | // get gcc to stop complaining about lack of use of yyunput | 72 | // Get gcc to stop complaining about lack of use of yyunput and input. |
78 | (void) yyunput; | 73 | (void) yyunput; |
79 | (void) input; | 74 | (void) input; |
80 | #endif | 75 | #endif |
81 | #endif | 76 | #endif |
82 | // TODO - If we are getting files from stdin, or multiple -f arguments, we should loop through them asd return 0. Return 1 when there are no more files. | 77 | // TODO - If we are getting files from stdin, or multiple -f arguments, we should loop through them and return 0. Return 1 when there are no more files. |
83 | return(1); | 78 | return(1); |
84 | } | 79 | } |
85 | 80 | ||