summaryrefslogtreecommitdiff
path: root/lexer.l
diff options
context:
space:
mode:
authorBobby Bingham <koorogi@koorogi.info>2017-01-18 20:12:49 -0600
committerBobby Bingham <koorogi@koorogi.info>2017-01-18 20:21:17 -0600
commit633e6598859fc5104bb28d5cccac845cb5d5198e (patch)
tree575e9343507673d3f515993ee636e602c3d33182 /lexer.l
parent6c6b91f9a6bc5ae203e99ac7abb3a70215488a6f (diff)
nqasm: support binary arithmetic operators in immediate operands
Diffstat (limited to 'lexer.l')
-rw-r--r--lexer.l4
1 files changed, 4 insertions, 0 deletions
diff --git a/lexer.l b/lexer.l
index 324c3da..9b1548d 100644
--- a/lexer.l
+++ b/lexer.l
@@ -78,8 +78,12 @@ HEX [0-9a-f]
<args>@ { return T_DEREF; }
<args>\+ { return T_OPERATOR_ADD; }
<args>- { return T_OPERATOR_SUB; }
+<args>\* { return T_OPERATOR_MUL; }
+<args>\/ { return T_OPERATOR_DIV; }
<args>! { return T_OPERATOR_NOT; }
<args>~ { return T_OPERATOR_INV; }
+<args>\( { return T_LPAREN; }
+<args>\) { return T_RPAREN; }
<args>{DEC}+ { return intlit(yytext, 10, &yylval.lval); }
<args>0x{HEX}+ { return intlit(yytext+2, 16, &yylval.lval); }
<args>{SP}*,{SP}* { return T_COMMA; }