diff --git a/compiler/heptagon/parsing/hept_lexer.mll b/compiler/heptagon/parsing/hept_lexer.mll index 867e858..f98418c 100644 --- a/compiler/heptagon/parsing/hept_lexer.mll +++ b/compiler/heptagon/parsing/hept_lexer.mll @@ -57,6 +57,7 @@ List.iter (fun (str,tok) -> Hashtbl.add keyword_table str tok) [ "true", BOOL(true); "false", BOOL(false); "pre", PRE; + "and", AND; "or", OR; "not", NOT; "open", OPEN; diff --git a/compiler/heptagon/parsing/hept_parser.mly b/compiler/heptagon/parsing/hept_parser.mly index 68044ac..45e3679 100644 --- a/compiler/heptagon/parsing/hept_parser.mly +++ b/compiler/heptagon/parsing/hept_parser.mly @@ -47,7 +47,7 @@ open Hept_parsetree %token PRAGMA %token TYPE FUN NODE RETURNS VAR VAL OPEN END CONST UNSAFE EXTERNAL %token FBY PRE SWITCH EVERY -%token OR STAR NOT +%token AND OR STAR NOT %token AMPERSAND %token AMPERAMPER %token AUTOMATON @@ -95,7 +95,7 @@ open Hept_parsetree %left ELSE %right ARROW %left OR -%left AMPERSAND +%left AND AMPERSAND %left INFIX0 EQUAL LESS_GREATER %right INFIX1 %right WHEN WHENOT @@ -567,6 +567,8 @@ _exp: { mk_op_call "or" [$1; $3] } | exp STAR exp { mk_op_call "*" [$1; $3] } + | exp AND exp + { mk_op_call "&" [$1; $3] } | exp AMPERSAND exp { mk_op_call "&" [$1; $3] } | exp SUBTRACTIVE exp