racket/parser-tools

`cfg-parser` BNF inaccurate wrt implementation

Opened this issue · 0 comments

IIUC, the syntax block for the cfg-parser says that it takes 0 or more clauses, where a clause is any one of those 6 options. It seems that cfg-parser requires at least one clause, and necessarily a grammar clause at that, to even generate valid syntax. Furthermore, I believe the grammar form claims it admits parse rules for 0 or more non-terminals, but the implementation requires at least one parse rule, and I believe that each RHS actually requires one or more grammar-ids, rather than 0 as stated.

See:

@defform/subs[#:literals (grammar tokens start end precs src-pos
suppress expected-SR-conflicts expected-RR-conflicts
debug yacc-output prec)
(cfg-parser clause ...)
([clause (grammar (non-terminal-id
((grammar-id ...) maybe-prec expr)
...)
...)
(tokens group-id ...)
(start non-terminal-id ...)
(end token-id ...)
(@#,racketidfont{error} expr)
(src-pos)])]{

*IIUC