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:
27
src/syn/lexer.l
Normal file
27
src/syn/lexer.l
Normal 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 ]+ ;
|
||||
Reference in New Issue
Block a user