How to correctly translate BNF to GoldParser?

164 views Asked by At

Say I have this in BNF:

a ::= b {c}
    | d {e}

Is there any way to translate to Gold-Parser? Without breaking it up like this:

<a> ::= <b> <c>

<c> ::= 
    | <c> terminal

Side Note: If anybody has a better title/more tags, please edit it, thanks!

1

There are 1 answers

0
npostavs On

Is there any way to translate to Gold-Parser? Without breaking it up

No, it doesn't support the repetition operator ({x}) as part of rule definitions, so you must encode it with multiple rules.

See also Converting EBNF to BNF