Initial commit

Includes: runtime base from a previous project, syn(tax) module with
parser and lexer

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2020-09-01 17:32:48 -07:00
commit 178ed4a952
24 changed files with 1139 additions and 0 deletions

27
src/syn/lexer.l Normal file
View File

@@ -0,0 +1,27 @@
%%
[\n;]+ "EOL"
[a-zA-Z_][a-zA-Z0-9_]* "IDENT"
:[a-zA-Z_][a-zA-Z0-9_]* "SYM"
[0-9]+ "NUM"
"([^"]|\\[rnt"'\\])+"|'([^"]|\\[rnt"'\\])+' "STRING"
\|\| "||"
&& "&&"
< "<"
> ">"
<= "<="
>= ">="
!= "!="
== "=="
\+ "+"
\* "*"
/ "/"
- "-"
\( "("
\) ")"
\[ "["
\] "]"
\. "."
, ","
[\t ]+ ;