diff options
Diffstat (limited to '')
-rw-r--r-- | LuaSL/src/LuaSL_lexer.l | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/LuaSL/src/LuaSL_lexer.l b/LuaSL/src/LuaSL_lexer.l new file mode 100644 index 0000000..f55d458 --- /dev/null +++ b/LuaSL/src/LuaSL_lexer.l | |||
@@ -0,0 +1,31 @@ | |||
1 | %{ | ||
2 | |||
3 | #include "LuaSL_type_parser.h" | ||
4 | #include "LuaSL_yaccer.tab.h" | ||
5 | |||
6 | %} | ||
7 | |||
8 | %option reentrant noyywrap never-interactive nounistd | ||
9 | %option bison-bridge | ||
10 | |||
11 | LPAREN "(" | ||
12 | RPAREN ")" | ||
13 | PLUS "+" | ||
14 | MULTIPLY "*" | ||
15 | |||
16 | NUMBER [0-9]+ | ||
17 | WS [ \r\n\t]* | ||
18 | |||
19 | %% | ||
20 | |||
21 | {WS} { /* Skip blanks. */ } | ||
22 | {NUMBER} { sscanf(yytext,"%d",&yylval->value); return TOKEN_NUMBER; } | ||
23 | |||
24 | {MULTIPLY} { return TOKEN_MULTIPLY; } | ||
25 | {PLUS} { return TOKEN_PLUS; } | ||
26 | {LPAREN} { return TOKEN_LPAREN; } | ||
27 | {RPAREN} { return TOKEN_RPAREN; } | ||
28 | . { } | ||
29 | |||
30 | %% | ||
31 | |||