aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src/LuaSL_lexer.l
diff options
context:
space:
mode:
Diffstat (limited to 'LuaSL/src/LuaSL_lexer.l')
-rw-r--r--LuaSL/src/LuaSL_lexer.l31
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
11LPAREN "("
12RPAREN ")"
13PLUS "+"
14MULTIPLY "*"
15
16NUMBER [0-9]+
17WS [ \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