Hello,

I trust you are well.

I am working on building a LALR parser for ABNF grammars using Bison and am
running into shift/reduce conflicts pertaining to whitespace.

The rule that is causing this issue is the alternation rule (from the RFC
for ABNF <https://datatracker.ietf.org/doc/html/rfc5234>):
alternation = concatenation *(*c-wsp "/" *c-wsp concatenation)
concatenation = repetition *(1*c-wsp repetition)     /* I have just set
repetition to be a character value for simplicity */
c-wsp = WSP / (c-nl WSP)
c-nl = comment / CRLF
comment =  ";" *(WSP / VCHAR) CRLF

I have attached my current Bison grammar. I believe I know what is causing
the conflict but am having some trouble coming to a solution. Any advice
would be greatly appreciated.

Best,
Josh

Attachment: abnf.y
Description: Binary data

Reply via email to