help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: stupid format question


From: Hans Aberg
Subject: Re: stupid format question
Date: Fri, 28 Feb 2003 10:34:54 +0100

[Please reply to Help Bison.]

At 17:07 -0500 2003/02/27, Urdaneta, Alfonso E (N-Summitt Technologies) wrote:
>I have an IEEE language definition that looks like so:
>
>noun-field:
>    { noun |
>      noun-name } [ "USING" label-identifier ];
...
>Can anyone point me in the right direction ?

You might try the following:

EBNF rewritten to BNF (using Bison notation):
  (a) := x, where x: a           -- Parenthesis
  a? := | a                      -- Optional.
  [a] := | a                     -- Optional, alternative notation.
  a+ := x, where x: a | x a      -- One or more.
  a* := x, where x:   | x a      -- Zero or more.
  a || t := a(ta)*               -- An a followed by zero or more ta.
>From Waite & Goos, "Compiler Construction", Appendix A, p. 383.

E.g.
  noun_field: noun_head noun_body {...};

  noun_head: noun | noun-name {...};

  non_body:
      /* empty */ {...}
    | "USING" label-identifier {...};

  Hans Aberg






reply via email to

[Prev in Thread] Current Thread [Next in Thread]