Skip to content

Commit

Permalink
reorganize mem
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Aug 8, 2024
1 parent 42dea0a commit 293bea0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions ocaml/parser/common.ml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ let string_of_access_pat pats : string =

let rec string_of_type typ =
match typ with
| CharRefAll -> "char * {ref-all}"
| Void -> "void"
| Bool -> "_Bool"
| Char -> "char"
Expand Down
5 changes: 1 addition & 4 deletions ocaml/parser/gimpleParser.mly
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ var_decl:
;

ground_typ:
| CHAR_REF_ALL { CharRefAll }
| VOID { Void }
| BOOL { Bool }
| CHAR { Char }
Expand Down Expand Up @@ -203,10 +204,6 @@ mem:
| MULOP loc { Deref (Mem (Void, $2)) }
| MEM LANGLE typ RANGLE LSQUARE loc RSQUARE
{ Mem ($3, $6) }
| MEM LANGLE typ RANGLE LSQUARE LPAREN CHAR_REF_ALL RPAREN ANDOP loc RSQUARE
{ Ref (Mem ($3, $10)) }
| MEM LANGLE typ RANGLE LSQUARE LPAREN CHAR_REF_ALL RPAREN loc RSQUARE
{ Mem ($3, $9) }
;

loc:
Expand Down
2 changes: 1 addition & 1 deletion ocaml/parser/syntax.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type access_t = string
type attribute_t = access_t list

type type_t = Void | Bool | Char | Uchar | Short | Ushort | Int | Uint
| Long | Ulong | Llong | Ullong
| Long | Ulong | Llong | Ullong | CharRefAll
| Sword of int | Uword of int | Bools of int | Ubools of int
| Const of type_t | Pointer of type_t | Struct of string
| Vector of Z.t * type_t | Array of Z.t * type_t
Expand Down
2 changes: 1 addition & 1 deletion ocaml/parser/syntax.mli
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type access_t = string
type attribute_t = access_t list

type type_t = Void | Bool | Char | Uchar | Short | Ushort | Int | Uint
| Long | Ulong | Llong | Ullong
| Long | Ulong | Llong | Ullong | CharRefAll
| Sword of int | Uword of int | Bools of int | Ubools of int
| Const of type_t | Pointer of type_t | Struct of string
| Vector of Z.t * type_t | Array of Z.t * type_t
Expand Down

0 comments on commit 293bea0

Please sign in to comment.