| DeclareStruct NEWLINE
$void
+ Newlines -> NEWLINE
+ | Newlines NEWLINE
Open -> {
- | NEWLINE Open
+ | Newlines {
Close -> }
- | NEWLINE Close
+ | Newlines }
$*fieldlist
FieldBlock -> Open FieldList } ${ $0 = $<2; }$
| Open SimpleFieldList } ${ $0 = $<2; }$
| : FieldList $$NEWLINE ${ $0 = $<2; }$
- FieldList -> SimpleFieldListLine ${ $0 = $<1; }$
- | FieldList SimpleFieldListLine ${
+ FieldList -> FieldLines ${ $0 = $<1; }$
+ | Newlines FieldLines ${ $0 = $<2; }$
+ FieldLines -> SimpleFieldListLine ${ $0 = $<1; }$
+ | FieldLines SimpleFieldListLine ${
$2->prev = $<1;
$0 = $<2;
}$
SimpleFieldListLine -> SimpleFieldList NEWLINE ${ $0 = $<1; }$
| SimpleFieldListLine NEWLINE ${ $0 = $<1; }$
+ | ERROR NEWLINE ${ tok_err(c, "Syntax error in struct field", &$1); }$
SimpleFieldList -> Field ${ $0 = $<1; }$
| SimpleFieldList ; Field ${
$0->f.type = $<3;
$0->f.init = val_init($3);
}$
- | ERROR ${ tok_err(c, "Syntax error in struct field", &$1); }$
###### forward decls
static void structure_print_type(struct type *t, FILE *f);
| : Statementlist $$NEWLINE ${ $0 = $<2; }$
Statementlist -> ComplexStatements ${ $0 = reorder_bilist($<1); }$
- | NEWLINE Statementlist ${ $0 = $<2; }$
+ | Newlines ComplexStatements ${ $0 = reorder_bilist($<2); }$
ComplexStatements -> ComplexStatements ComplexStatement ${
if ($2 == NULL) {
$void
Ocean -> DeclarationList
- | NEWLINE Ocean
+ | Newlines DeclarationList
DeclarationList -> Declaration
| DeclarationList Declaration
| const SimpleConstList NEWLINE
ConstList -> ConstLines
- | NEWLINE ConstList
+ | Newlines ConstLines
ConstLines -> ConstLines SimpleConstLine
| SimpleConstLine
SimpleConstList -> SimpleConstList ; Const