This is a valid grammar, and it parses just the single character: a. However, isNullable will return neither true nor false for its nullability. The problem is that the implementation for isNullable is attempting to approximate a least-fixed-point solution by linear graph traversal, and I'm pretty sure that isn't doable. (if it were, a lot of static program analysis would be much faster!) The function needs to be reimplemented to use explicit constraint solving.
For example:
S ::= S | 'a'
This is a valid grammar, and it parses just the single character:
a
. However,isNullable
will return neithertrue
norfalse
for its nullability. The problem is that the implementation forisNullable
is attempting to approximate a least-fixed-point solution by linear graph traversal, and I'm pretty sure that isn't doable. (if it were, a lot of static program analysis would be much faster!) The function needs to be reimplemented to use explicit constraint solving.