For Programmers: Free Programming Magazines  


Home > Archive > Compilers > September 2007 > Production missing on page 9 of Compiler Construction









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Production missing on page 9 of Compiler Construction
pupeno@pupeno.com

2007-08-31, 11:38 pm

Hello,

I'm reading Compiler Construction, by Niklaus Wirth, available on
http://www.oberon.ethz.ch/WirthPubl/CBEAll.pdf and on page 9 he shows
this little piece of BNF:

E = T | A "+" T.
T = F | T "*" F.
F = V | "(" E ")".
V = "a" | "b" | "c" | "d".

A is being used on the right hand side without it being defined on the
left hand side first. What am I missing?

The only thing I can think of is that it is missing a production at
first, like:

A = E

>From this BNF it writes this "programs" (on page 10):


a*b+c
a+b*c
(a+b)*(c+d)

Thanks.
Hans-Peter Diettrich

2007-09-03, 10:11 pm

pupeno@pupeno.com wrote:

> I'm reading Compiler Construction, by Niklaus Wirth, available on
> http://www.oberon.ethz.ch/WirthPubl/CBEAll.pdf and on page 9 he shows
> this little piece of BNF:
>
> E = T | A "+" T.
> T = F | T "*" F.
> F = V | "(" E ")".
> V = "a" | "b" | "c" | "d".
>
> A is being used on the right hand side without it being defined on the
> left hand side first. What am I missing?


IMO it's a typo, should read 'E'.
E = Expression
T = Term
F = Factor
V = Value
A is not mentioned elsewhere.

DoDi

Adrian Devries

2007-09-03, 10:11 pm

pupeno@pupeno.com schrieb:
> I'm reading Compiler Construction, by Niklaus Wirth, available on
> http://www.oberon.ethz.ch/WirthPubl/CBEAll.pdf and on page 9 he shows
> this little piece of BNF:
>
> E = T | A "+" T.
> T = F | T "*" F.
> F = V | "(" E ")".
> V = "a" | "b" | "c" | "d".


> A is being used on the right hand side without it being defined on the
> left hand side first. What am I missing?


Hello,

I think, it is an erratum. Solution: Within the production 'E = T | A
"+" T.' replace 'A' by 'E'.

The sentence above the cited section reads as follows:

"The symbols E, T, F, and V stand for expression, term, factor, and
variable."

Please confer the german edition of the referenced paper:

Wirth, Niklaus:
Grundlagen und Techniken des Compilerbaus / Niklaus Wirth. -
Bonn; Paris [u. a.]: Addison-Wesley, 1996
ISBN 3-89319-931-4

On page 6 you will find the following productions:

"(...) Die Symbole A, T, F und V stehen f|r Ausdruck, Term, Faktor und
Variable.

A = T | A "+" T.
T = F | T "*" F.
F = V | "(" A ")".
V = "a" | "b" | "c" | "d".

(...)"

Regards,
Adrian Devries
Torben Ęgidius Mogensen

2007-09-03, 10:11 pm

"pupeno@pupeno.com" <pupeno@pupeno.com> writes:


> E = T | A "+" T.
> T = F | T "*" F.
> F = V | "(" E ")".
> V = "a" | "b" | "c" | "d".
>
> A is being used on the right hand side without it being defined on the
> left hand side first. What am I missing?
>
> The only thing I can think of is that it is missing a production at
> first, like:
>
> A = E


Alternatively, you can simply replace the "A" by an "E". It has the
same effect as adding A = E, but it doesn't make the grammar larger.

In all likelyhood, Wirth originally used A for the German/Swiss word
"Ausdruck" (meaning "Expression") and changed it to E for "Expression"
but missed a spot.

Torben
[Thanks also to several other people who sent in similar messages. -John]
Tedbasup

2007-09-05, 3:33 am

Jennifer Lopez On Sofa Shows Tight Ass!
http://www.eyrenet.com/WindowsMedia...mv?movie=148803

Jennifer Lopez Spreading Juicy Pussy Outdoor!
http://www.eyrenet.com/player.php?movie=148803

Halle Berry , Hot anal action!
http://www.eyrenet.com/WatchTube?id=148803

Hilary Duff Dildos Her Pussy!
http://www.eyrenet.com/Watch?q=148803

Halle Berry In Thong Shows Butt!
http://www.eyrenet.com/Play?q=148803
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com