- Newlines -> NEWLINE
- | Newlines NEWLINE
- Statementlist -> Statements ${ $0 = $<S; }$
- | Newlines Statements ${ $0 = $<S1; }$
-
- Statements -> Statements Statement ${
- {
- struct statement **s;
- $0 = $<1;
- s = &$0;
- while (*s)
- s = &(*s)->next;
- *s = $<2;
- }
- }$
- | Statement ${ $0 = $<1; }$
- | ERROR ${ printf("statement ERROR\n"); $0 = NULL; }$
-
- Open -> {
- | Newlines {
- Close -> }
- | Newlines }
- Block -> Open Statementlist Close ${ $0 = $<S; }$
- | Open SimpleStatements } ${ $0 = $<S; }$
- | : SimpleStatements ${ $0 = $<SS; }$
- | : StatementBlock ${ $0 = $<SB; }$
- StatementBlock -> Statementlist ${ $0 = $<Sl; }$
+
+ Statementlist -> Statementlist Statement ${
+ {
+ struct statement **s;
+ $0 = $<1;
+ s = &$0;
+ while (*s)
+ s = &(*s)->next;
+ *s = $<2;
+ }
+ }$
+ | Statement ${ $0 = $<1; }$
+
+ Block -> { IN OptNL Statementlist OUT OptNL } ${ $0 = $<Stat; }$
+ | { SimpleStatements } ${ $0 = $<S; }$
+ | { SimpleStatements ; } ${ $0 = $<S; }$
+ | : IN OptNL Statementlist OUT ${ $0 = $<Sl; }$
+ | : SimpleStatements EOL ${ $0 = $<Si; }$
+ | : SimpleStatements ; ${ $0 = $<Si; }$