aboutsummaryrefslogtreecommitdiff
path: root/works/life/compile-principle-experiment/4/lex.l
diff options
context:
space:
mode:
Diffstat (limited to 'works/life/compile-principle-experiment/4/lex.l')
-rw-r--r--works/life/compile-principle-experiment/4/lex.l20
1 files changed, 0 insertions, 20 deletions
diff --git a/works/life/compile-principle-experiment/4/lex.l b/works/life/compile-principle-experiment/4/lex.l
deleted file mode 100644
index e7731ca..0000000
--- a/works/life/compile-principle-experiment/4/lex.l
+++ /dev/null
@@ -1,20 +0,0 @@
-%{
-#include "main.h"
-#include "syn.h"
-%}
-%option noyywrap
-%%
-[ \t] { ; } /* skip blanks and tabs */
-[0-9]+\.?|[0-9]*\.[0-9]+ {
- Symbol *s = cru_symbol_install("", UNDEF, (SymbolValue)0.0);
- sscanf(yytext, "%lf", &s->value.val);
- yylval.sym = s;
- return NUMBER; }
-[a-zA-Z][a-zA-Z0-9]* {
- Symbol *s;
- if ((s=cru_symbol_lookup(yytext)) == 0)
- s = cru_symbol_install(yytext, UNDEF, (SymbolValue)0.0);
- yylval.sym = s;
- return s->type == UNDEF ? VAR : s->type; }
-\n { lineno++; return '\n'; } /* everything else */
-. { return yytext[0]; }