Website Summary Files Commits Branches @commit @diff @stats
path: root / spasm / src / asm / lexer.re
diff options
context:
space:
mode:
Commitf9654d32bc456d20de03b7eb20888120a59e405d (patch)
Author
 Dimitar Trendafilov <dimitar@coherent-labs.com>
2018-11-12 23:42:48 +0200
Committer
 Dimitar Trendafilov <dimitar@coherent-labs.com>
2018-11-12 23:42:48 +0200
Files3e1095601a75fe0157142ac92734d3c61d813ad1 /spasm/src/asm/lexer.re
IPL-f9654d32bc456d20de03b7eb20888120a59e405d.tar
IPL-f9654d32bc456d20de03b7eb20888120a59e405d.tar.gz
IPL-f9654d32bc456d20de03b7eb20888120a59e405d.zip
Parentf81f1c56cc01ec3d91a73ec7314519ac59abd5b4 (diff)
The assembler works closes to the instruction set spec
1 files changed, 10 insertions, 23 deletions
-rw-r--r--spasm/src/asm/lexer.re33
diff --git a/spasm/src/asm/lexer.re b/spasm/src/asm/lexer.re
index c6f87ea..c54d54f 100644
--- a/spasm/src/asm/lexer.re
+++ b/spasm/src/asm/lexer.re
@@ -106,35 +106,35 @@ XINTEGER {
continue;
}
-"+" {
+"add" {
ts.push_token (Token (Token::plus, lineno));
token_start = cursor;
continue;
}
-"-" {
+"sub" {
ts.push_token (Token (Token::minus, lineno));
token_start = cursor;
continue;
}
-"*" {
+"mul" {
ts.push_token (Token (Token::multiply, lineno));
token_start = cursor;
continue;
}
-"/" {
+"div" {
ts.push_token (Token (Token::divide, lineno));
token_start = cursor;
continue;
}
-"%" {
+"mod" {
ts.push_token (Token (Token::modulus, lineno));
token_start = cursor;
@@ -142,21 +142,21 @@ XINTEGER {
}
"jmpt" {
- ts.push_token (Token (Token::gotrue, lineno));
+ ts.push_token (Token (Token::jmpt, lineno));
token_start = cursor;
continue;
}
"jmpf" {
- ts.push_token (Token (Token::gofalse, lineno));
+ ts.push_token (Token (Token::jmpf, lineno));
token_start = cursor;
continue;
}
"jmp" {
- ts.push_token (Token (Token::go, lineno));
+ ts.push_token (Token (Token::jmp, lineno));
token_start = cursor;
continue;
@@ -176,26 +176,13 @@ XINTEGER {
continue;
}
-"load" {
- ts.push_token (Token (Token::load, lineno));
- token_start = cursor;
-
- continue;
- }
-
-"store" {
- ts.push_token (Token (Token::store, lineno));
- token_start = cursor;
-
- continue;
- }
-"<=" {
+"leq" {
ts.push_token (Token (Token::lesseq, lineno));
token_start = cursor;
continue;
}
-"<" {
+"less" {
ts.push_token (Token (Token::less, lineno));
token_start = cursor;