summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabriel Kerneis2014-01-07 19:32:36 +0100
committerGabriel Kerneis2014-01-07 19:32:36 +0100
commit30db6c5227126b13455bccc8f68602ad658f6b92 (patch)
tree10d2e93a040c3f56e972dfd684300d140d113e8a /src
parent0c681811b78e77c1297ceb70a166e2a7615d9991 (diff)
Lex bitzero and bitone literals
Diffstat (limited to 'src')
-rw-r--r--src/lexer.mll2
-rw-r--r--src/parser.mly6
2 files changed, 7 insertions, 1 deletions
diff --git a/src/lexer.mll b/src/lexer.mll
index 0b50cd4d..7ee37035 100644
--- a/src/lexer.mll
+++ b/src/lexer.mll
@@ -60,6 +60,8 @@ let kw_table =
[
("and", (fun _ -> And));
("as", (fun _ -> As));
+ ("bitzero", (fun _ -> Bitzero));
+ ("bitone", (fun _ -> Bitone));
("bits", (fun _ -> Bits));
("by", (fun _ -> By));
("case", (fun _ -> Case));
diff --git a/src/parser.mly b/src/parser.mly
index be69fc00..c00eddc3 100644
--- a/src/parser.mly
+++ b/src/parser.mly
@@ -123,7 +123,7 @@ let star = "*"
/*Terminals with no content*/
-%token And As Bits By Case Clause Const Dec Default Deinfix Effect EFFECT End Enumerate Else Extern
+%token And As Bitzero Bitone Bits By Case Clause Const Dec Default Deinfix Effect EFFECT End Enumerate Else Extern
%token False Forall Foreach Function_ If_ In IN Inc Let_ Member Nat Order Pure Rec Register
%token Rreg Wreg Rmem Wmem Undef Unspec Nondet
%token Scattered Struct Switch Then True TwoStarStar Type TYPE Typedef Undefined Union With Val
@@ -394,6 +394,10 @@ lit:
{ lloc (L_hex $1) }
| Undefined
{ lloc L_undef }
+ | Bitzero
+ { lloc L_zero }
+ | Bitone
+ { lloc L_one }
atomic_pat: