Closed twd2 closed 6 years ago
Please provide some syntax that ts
can be empty.
A modified decaf grammar:
// ...
ElseClause : /* empty */ // higher priority
| ELSE Stmt
{
$$.stmt = $2.stmt;
}
;
// ...
Note that the priority is swapped.
It seems that we should warn, closing.
https://github.com/paulzfm/LL1-Parser-Gen/blob/688381a09a262b31091665838e89143e3d607e4f/src/main/scala/JavaCodeFile.scala#L227
Before write this line, should we check if
ts
is empty? If it is empty, the production is unused, and should we warn about it?Currently, in some situation, this program may generate a
Table.java
like this:This two lines make Java compiler unhappy.