Thread View: comp.lang.modula2
3 messages
3 total messages
Started by nagler Robert Nagler
Tue, 10 Mar 1987 17:56
FYI: M2 Comments
Author: nagler Robert Nagler
Date: Tue, 10 Mar 1987 17:56
Date: Tue, 10 Mar 1987 17:56
13 lines
1178 bytes
1178 bytes
Did any language implementers out there ever notice that Wirth does not define the syntax of a "comment" in the "Syntax of Modula-2" in the back of PIM2. They don't appear in the railroad diagrams, either. He mentions them on page 16 (3rd edition), but even there he doesn't mention that they can be nested. I realized this after playing with EBNF for some language stuff and found it very difficult to describe "arbitrary sequences of characters" in EBNF. My question is: "Was it an oversight or was it intentionally avoided?" Rob PS. Don't bother looking in the index, they aren't mentioned there.
Re: FYI: M2 Comments
Author: Charles D. Farnum
Date: Tue, 10 Mar 1987 18:46
Date: Tue, 10 Mar 1987 18:46
19 lines
1801 bytes
1801 bytes
In article <8703101615.AA14931@frey.olsen.uucp> nagler@seismo.CSS.GOV@olsen.UUCP (Robert Nagler) writes: >Did any language implementers out there ever notice that Wirth does >not define the syntax of a "comment" in the "Syntax of Modula-2" in >the back of PIM2. They don't appear in the railroad diagrams, either. You'll also notice that spaces, tabs, and newlines aren't included in the syntax descriptions. Doing so would be very tedious --- a comment can appear between any two symbols of the program. Some heirarchy is generally imposed to keep things manageable, both in the descriptions and in compilers; at the syntactic level, details concerning the composition of individual tokens and whitespace (blanks, tabs, newlines, comments, etc) are generally ignored, having already been covered in some lexical description. Wirth does include the spelling of numeric constants and identifiers in his ``syntax description'', but this is not normal. The definition of comments, including the fact that they nest, is in section 3, part 5 of the Report (bottom of page 145 in the 3rd edition of PIM-2). /charlie
Re: FYI: M2 Comments
Author: tla
Date: Fri, 13 Mar 1987 16:20
Date: Fri, 13 Mar 1987 16:20
46 lines
2110 bytes
2110 bytes
> Did any language implementers out there ever notice that > Wirth does not define the syntax of a "comment" in the > "Syntax of Modula-2" in the back of PIM2. They don't > appear in the railroad diagrams, either. He mentions > them on page 16 (3rd edition), but even there he > doesn't mention that they can be nested. I realized this > after playing with EBNF for some language stuff and found > it very difficult to describe "arbitrary sequences of > characters" in EBNF. > > My question is: "Was it an oversight or was it intentionally > avoided?" > > Rob > > PS. Don't bother looking in the index, they aren't mentioned > there. There is one more reference, (ed 3) page 145, where it IS stated that comments CAN be nested. And both ARE in my index under "comment". You may have missed it because of its being in the second column or maybe is was missing from the older first printing (mine is the "Third, corrected edition". I find the odd ordering of the index annoying ie a b c d e f rather than a d b e c f The columns are toooo far apart for the first ordering to be easy to use. Does anyone LIKE it? Back to comments, I imagine they are missing from the syntax (both EBNF and railroad) because they are not considered a part of the "language" ie they are removed and replaced by white space during lexical analysis and not seen by the parser. -- Terry L Anderson AT&T Bell Laboratories -- Liberty Corners UUCP: ...!ihnp4!daimler!kaiser!tla TeleMail: Terry.Anderson (201) 580-4428
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads