Discussion:
Wirth's PIM4 ISBN-0-387-50150-9 : Where is ConstantDeclaration?
(too old to reply)
trijezdci
2015-10-12 16:16:39 UTC
Permalink
Raw Message
I am looking at Wirth's "Programming in Modula-2", 4th Edition with ISBN-0-387-50150-9, Appendix 4, page 171ff and I simply cannot find the diagram for ConstantDeclaration.

I have gone over all the diagrams several times, forwards and backwards, and I simply cannot find the one for ConstantDeclaration which is referenced in the diagrams for Definition and Declaration.

Is it just me, have I gone blind, or is this missing from the book?

Can folks here verify this with their copies of PIM4 please?

thanks in advance
Christoph Schlegel
2015-10-12 20:28:51 UTC
Permalink
Raw Message
Post by trijezdci
I am looking at Wirth's "Programming in Modula-2", 4th Edition with ISBN-0-387-50150-9, Appendix 4, page 171ff and I simply cannot find the diagram for ConstantDeclaration.
I have gone over all the diagrams several times, forwards and backwards, and I simply cannot find the one for ConstantDeclaration which is referenced in the diagrams for Definition and Declaration.
Is it just me, have I gone blind, or is this missing from the book?
Can folks here verify this with their copies of PIM4 please?
thanks in advance
I didn't know we don't have to declare constants or - even more interesting - there simply are no const declarations...

Joking aside, my version of PIM4 is in german language, ISBN 3-540-51689-1 (and there are 5 more ISBN numbers in the book which I don't write down here unless anyone wants to know more) and you are right, there is no ConstantDeclaration in Appendix 4. Of course there is Appendix 1 where you find line 12:

ConstantDeclaration = ident " = " ConstExpression .

Guess you found an accidental omission -

Regards,

Christoph
Christoph Schlegel
2015-10-12 20:48:50 UTC
Permalink
Raw Message
Post by Christoph Schlegel
Post by trijezdci
I am looking at Wirth's "Programming in Modula-2", 4th Edition with ISBN-0-387-50150-9, Appendix 4, page 171ff and I simply cannot find the diagram for ConstantDeclaration.
I have gone over all the diagrams several times, forwards and backwards, and I simply cannot find the one for ConstantDeclaration which is referenced in the diagrams for Definition and Declaration.
Is it just me, have I gone blind, or is this missing from the book?
Can folks here verify this with their copies of PIM4 please?
thanks in advance
I didn't know we don't have to declare constants or - even more interesting - there simply are no const declarations...
ConstantDeclaration = ident " = " ConstExpression .
Guess you found an accidental omission -
Regards,
Christoph
In chapter 8 about declaration of constants and variables Wirth logically defines ConstantDeclaration right before ConstExpression. My version of PIM4 has the diagram of "string" before ConstExpression. Yes, it is missing in App4.
Nemo
2015-10-12 21:17:56 UTC
Permalink
Raw Message
Post by Christoph Schlegel
Guess you found an accidental omission -
Indeed. Railroad diagrammes were introduced in PIM3, which is also
missing ConstantDeclaration.
trijezdci
2015-10-13 21:23:33 UTC
Permalink
Raw Message
Post by Nemo
Post by Christoph Schlegel
Guess you found an accidental omission -
Indeed. Railroad diagrammes were introduced in PIM3, which is also
missing ConstantDeclaration.
Not the first time that I found something "accidental", but never mind.

Meanwhile, I have generated diagrams for PIM4 and put them on a page at:

http://modula-2.info/m2pim/pmwiki.php/SyntaxDiagrams/PIM4NonTerminals

Speaking of accidents, the diagram for Variant seemed wrong to me when I created it. It has a bypass which permits Variant to be empty. Not only is it bad practise to have empty productions in a grammar, but it is also nonsensical, allowing any number of occurrences of | in a variant field list.

But I checked the diagram in the annex of the book and it clearly has that bypass. I didn't check then against the EBNF, but now that I look at the result, I did and the EBNF does not permit Variant to be empty, so the diagram in the annex is wrong. I will fix the diagram on the wiki later. Naturally, I can't fix it in the book, but Springer have only recently re-released the book, I bet they still have the errors in there. I guess I should write them a mail.
Loading...