|
|
@ -33,7 +33,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
(* TYPES *)
|
|
|
|
(* TYPES *)
|
|
|
|
%token VOID
|
|
|
|
%token VOID
|
|
|
|
%token BIT (* i1 *)
|
|
|
|
|
|
|
|
%token <int> INT
|
|
|
|
%token <int> INT
|
|
|
|
%token HALF
|
|
|
|
%token HALF
|
|
|
|
%token FLOAT
|
|
|
|
%token FLOAT
|
|
|
@ -241,7 +240,7 @@ instr:
|
|
|
|
| RET tp = typ op = operand { Ret (Some (tp, op)) }
|
|
|
|
| RET tp = typ op = operand { Ret (Some (tp, op)) }
|
|
|
|
| RET VOID { Ret None }
|
|
|
|
| RET VOID { Ret None }
|
|
|
|
| BR LABEL lbl = variable { UncondBranch lbl }
|
|
|
|
| BR LABEL lbl = variable { UncondBranch lbl }
|
|
|
|
| BR BIT op = operand COMMA LABEL lbl1 = variable COMMA LABEL lbl2 = variable { CondBranch (op, lbl1, lbl2) }
|
|
|
|
| BR i=INT op = operand COMMA LABEL lbl1 = variable COMMA LABEL lbl2 = variable { CondBranch (op, lbl1, lbl2) }
|
|
|
|
(* Memory access operations *)
|
|
|
|
(* Memory access operations *)
|
|
|
|
| var = variable EQUALS ALLOCA tp = typ align? { Alloc (var, tp, 1) }
|
|
|
|
| var = variable EQUALS ALLOCA tp = typ align? { Alloc (var, tp, 1) }
|
|
|
|
| var = variable EQUALS LOAD tp = ptr_typ ptr = variable align? { Load (var, tp, ptr) }
|
|
|
|
| var = variable EQUALS LOAD tp = ptr_typ ptr = variable align? { Load (var, tp, ptr) }
|
|
|
|