no semicolon allowd after package clause.
semicolon allowed after import statement.
no doubled semicolons allowed
R=ken
OCL=34674
CL=34674
%left '{'
+%left NotSemi
+%left ';'
+
%%
file:
loadsys
| imports import
import:
- LIMPORT import_stmt
-| LIMPORT '(' import_stmt_list osemi ')'
-| LIMPORT '(' ')'
+ LIMPORT import_stmt osemi
+| LIMPORT '(' import_stmt_list osemi ')' osemi
+| LIMPORT '(' ')' osemi
import_stmt:
import_here import_package import_there
* declarations
*/
xdcl:
- common_dcl
-| xfndcl
+ common_dcl osemi
+| xfndcl osemi
{
$$ = list1($1);
}
-| ';'
+| error osemi
{
$$ = nil;
}
-| error xdcl
+| ';'
{
- $$ = $2;
+ yyerror("empty top-level declaration");
+ $$ = nil;
}
common_dcl:
* optional things
*/
osemi:
+ %prec NotSemi
| ';'
ocomma: