Re: (BNF) EBNF to BNF-grammar

haberg@math.su.se (Hans Aberg)
13 Aug 2006 01:30:30 -0400

          From comp.compilers

Related articles
(BNF) EBNF to BNF-grammar WeikEngOff@aol.com (Udo) (2006-08-12)
Re: (BNF) EBNF to BNF-grammar haberg@math.su.se (2006-08-13)
Re: (BNF) EBNF to BNF-grammar DrDiettrich1@aol.com (Hans-Peter Diettrich) (2006-08-13)
| List of all articles for this month |
From: haberg@math.su.se (Hans Aberg)
Newsgroups: comp.compilers
Date: 13 Aug 2006 01:30:30 -0400
Organization: Mathematics
References: 06-08-061
Keywords: EBNF
Posted-Date: 13 Aug 2006 01:30:30 EDT

  "Udo" <WeikEngOff@aol.com> wrote:


> I'm looking for a BNF grammar for converting EBNF to BNF. Any hints?


Waite, Goos, "Compiler Construction", Appendix A, p. 383, gives some EBNF
to BNF translation rules. With a somewhat different notation:
    1. a (b) c := a x c, x: b.
    2. a[b]c := a c | a(b)c.
    3. a u+ c := a x c, x: u | x u.
    4. a u* c := a[u+]c.
    5. a || t := a(t a)*.
where a, b, c are arbitrary RHS rules, x a unique non-terminal, u a single
or parenthesized grammar symbol, and t a terminal.


--
    Hans Aberg



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.