Wilhelm Sorban
Wilhelm Sorban

Reputation: 1131

How to correctly translate BNF to GoldParser?

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!

Upvotes: 1

Views: 164

Answers (1)

npostavs
npostavs

Reputation: 5037

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

Upvotes: 1

Related Questions