[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: stupid format question
From: |
Urdaneta, Alfonso E (N-Summitt Technologies) |
Subject: |
RE: stupid format question |
Date: |
Fri, 28 Feb 2003 23:03:28 +0100 |
thank you so much.
btw, is that book any good ?
-----Original Message-----
From: Hans Aberg [mailto:address@hidden
Sent: Friday, February 28, 2003 4:35 AM
To: Urdaneta, Alfonso E (N-Summitt Technologies)
Cc: 'address@hidden'
Subject: Re: stupid format question
[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