summaryrefslogtreecommitdiff
path: root/e.l
diff options
context:
space:
mode:
authorthing1 <thing1@seacrossedlovers.xyz>2025-02-18 22:00:20 +0000
committerthing1 <thing1@seacrossedlovers.xyz>2025-02-18 22:00:20 +0000
commitecfbc703dc930a20d56562451f4aa807175503e2 (patch)
tree7c1dd2742363625f59e4d9f7ba62a8d9594cd463 /e.l
init commitHEADmaster
Diffstat (limited to 'e.l')
-rw-r--r--e.l57
1 files changed, 57 insertions, 0 deletions
diff --git a/e.l b/e.l
new file mode 100644
index 0000000..fe43408
--- /dev/null
+++ b/e.l
@@ -0,0 +1,57 @@
+%{
+#include "types.h"
+#include "y.tab.h"
+#include <stdlib.h>
+%}
+
+%option noyywrap
+%option yylineno
+
+%%
+[0-9]+ {
+ yylval.intlit = atoi(yytext);
+ return INTLIT;
+}
+
+[A-Z] {
+ yylval.funcname = yytext[0];
+ return FUNCTIONNAME;
+}
+
+
+[a-z] {
+ yylval.varname = yytext[0];
+ return VARNAME;
+}
+
+[-=+*/{}:] {
+ return yytext[0];
+}
+
+dec {
+ return FUNCTIONDEC;
+}
+
+print {
+ return PRINT;
+}
+
+input {
+ return INPUT;
+}
+
+ret {
+ return RET;
+}
+
+jmp {
+ return JMP;
+}
+
+jnz {
+ return JNZ;
+}
+
+
+[:\n\t\v ] {;}
+%%