###### top level grammar
DeclareStruct -> struct IDENTIFIER FieldBlock ${ {
- struct type *t =
- add_type(c, $2.txt, &structure_prototype);
- int cnt = 0;
- struct fieldlist *f;
-
- for (f = $3; f; f=f->prev)
- cnt += 1;
-
- t->structure.nfields = cnt;
- t->structure.fields = calloc(cnt, sizeof(struct field));
- f = $3;
- while (cnt > 0) {
- cnt -= 1;
- t->structure.fields[cnt] = f->f;
- f->f.init = val_prepare(Tnone);
- f = f->prev;
- }
- } }$
+ struct type *t =
+ add_type(c, $2.txt, &structure_prototype);
+ int cnt = 0;
+ struct fieldlist *f;
+
+ for (f = $3; f; f=f->prev)
+ cnt += 1;
+
+ t->structure.nfields = cnt;
+ t->structure.fields = calloc(cnt, sizeof(struct field));
+ f = $3;
+ while (cnt > 0) {
+ cnt -= 1;
+ t->structure.fields[cnt] = f->f;
+ f->f.init = val_prepare(Tnone);
+ f = f->prev;
+ }
+ } }$
$void
Open -> {