summaryrefslogtreecommitdiff
path: root/asm/asmlex.mll
diff options
context:
space:
mode:
authorAlex AUVOLAT <alex.auvolat@ens.fr>2014-01-09 16:58:57 +0100
committerAlex AUVOLAT <alex.auvolat@ens.fr>2014-01-09 16:58:57 +0100
commit36a354fc8b914f6b96cba19a67c8f6ce712ac656 (patch)
treeffb35f531a1230143f87af4ff5ac870e65164a7a /asm/asmlex.mll
parent8d87eacbcb26e7abc429d7824e90c617f172045e (diff)
downloadSystDigit-Projet-36a354fc8b914f6b96cba19a67c8f6ce712ac656.tar.gz
SystDigit-Projet-36a354fc8b914f6b96cba19a67c8f6ce712ac656.zip
Basic operating system...
Diffstat (limited to 'asm/asmlex.mll')
-rw-r--r--asm/asmlex.mll4
1 files changed, 4 insertions, 0 deletions
diff --git a/asm/asmlex.mll b/asm/asmlex.mll
index 7be493e..7459966 100644
--- a/asm/asmlex.mll
+++ b/asm/asmlex.mll
@@ -94,6 +94,10 @@ rule token = parse
with Not_found -> ID id }
| "0x" (((hexdigit)+) as n)
{ INT (read_16 n) }
+ | "'\\n'" { INT (Char.code '\n') }
+ | "'\\t'" { INT (Char.code '\t') }
+ | "'\\r'" { INT (Char.code '\r') }
+ | "'" (_ as c) "'" { INT (Char.code c) }
| (digit)+ as n { INT (int_of_string n) }
| "0b" (['0' '1']+ as n) { INT (read_2 n) }
| ['A'-'Z']+ as name { try REG (List.assoc name regs) with Not_found -> raise (Asm_error ("no reg " ^ name))}