diff options
| author | Alasdair Armstrong | 2018-01-05 17:26:07 +0000 |
|---|---|---|
| committer | Alasdair Armstrong | 2018-01-05 17:26:07 +0000 |
| commit | 2cf9dc9d40794912ce8af7d776326b271f52d942 (patch) | |
| tree | fc7472ff4292de363dcbc313b53d760c323e28c9 /src/parse_ast.ml | |
| parent | 8147deaf0bccdbb19d4c020583fc8a5c7b6197e8 (diff) | |
Added bitfield syntax to replicate register bits type
For example:
bitfield cr : vector(8, dec, bit) = {
CR0 : 7 .. 4,
LT : 7,
CR1 : 3 .. 2,
CR2 : 1,
CR3 : 0,
}
The difference this creates a newtype wrapper around the vector type,
then generates getters and setters for all the fields once, rather
than having to handle this construct separately in every backend.
Diffstat (limited to 'src/parse_ast.ml')
| -rw-r--r-- | src/parse_ast.ml | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/parse_ast.ml b/src/parse_ast.ml index e84e8a60..362333f3 100644 --- a/src/parse_ast.ml +++ b/src/parse_ast.ml @@ -429,8 +429,7 @@ type_def_aux = (* Type definition body *) | TD_record of id * name_scm_opt * typquant * ((atyp * id)) list * bool (* struct type definition *) | TD_variant of id * name_scm_opt * typquant * (type_union) list * bool (* union type definition *) | TD_enum of id * name_scm_opt * (id) list * bool (* enumeration type definition *) - | TD_register of id * atyp * atyp * ((index_range * id)) list (* register mutable bitfield type definition *) - + | TD_bitfield of id * atyp * (id * index_range) list (* register mutable bitfield type definition *) type val_spec_aux = (* Value type specification *) |
