Previous | Table of Contents | Next |
To read a token, first skip all blanks, tabs, newlines, carriage returns, vertical tabs, form feeds, comments, and pragmas. Then read the longest sequence of characters that forms an operator or an Id or Literal.
An Id is a case-significant sequence of letters, digits, and underscores that begins with a letter. An Id is a keyword if it appears in the list of keywords, a reserved identifier if it appears in the list of reserved identifiers, and an ordinary identifier otherwise.
In the following grammar, terminals are characters surrounded by double-quotes and the special terminal DQUOTE represents double-quote itself:
Id = Letter {Letter | Digit | _}. Literal = Number | CharLiteral | TextLiteral. CharLiteral = (PrintingChar | Escape | DQUOTE) . TextLiteral = DQUOTE {PrintingChar | Escape | } DQUOTE. Escape = \ n | \ t | \ r | \ f | \ \ | \ | \ DQUOTE | \ OctalDigit OctalDigit OctalDigit. Number = Digit {Digit} | Digit {Digit} _ HexDigit {HexDigit} | Digit {Digit} . Digit {Digit} [Exp]. Exp = (E | e | D | d | X | x) [+ | -] Digit {Digit}. PrintingChar = Letter | Digit | OtherChar. HexDigit = Digit | A | B | C | D | E | F | a | b | c | d | e | f. Digit = 0 | 1 | ... | 9. OctalDigit = 0 | 1 | ... | 7. Letter = A | B | ... | Z | a | b | ... | z. OtherChar = | ! | # | $ | % | & | ( | ) | * | + | , | - | . | / | : | ; | < | = | > | ? | @ | [ | ] | ^ | _ | ` | { | | | } | | ExtendedChar ExtendedChar = any char with ISO-Latin-1 code in [8_ 240.. 8_ 377].
The original definition of Modula-3 was given in SRC Research Report 31, August 1988. It was revised in Report 52, November 1989 and finally published in Systems Programming with Modula-3, November 1989. This edition of the language definition is derived from all of these reports.
Modula-3 was designed by Luca Cardelli, Jim Donahue, Mick Jordan, Bill Kalsow, and Greg Nelson, as a joint project by the Digital Equipment Corporation Systems Research Center and the Olivetti Research Center. Paul Rovner made many contributions as a founding member of the design committee. The language specification was written by Lucille Glassman and Greg Nelson under the watchful supervision of the whole committee.
Maurice Wilkes had the inspiration that sparked the project.
Our technical starting point was Modula-2+, which was designed by Paul Rovner, Roy Levin, John Wick, Andrew Birrell, Butler Lampson, and Garret Swart. We made good use of the ruthlessly complete description of Modula-2+ in Mary-Claire van Leunens Modula-2+ Users Manual. The ideas in the + part of Modula-2+ were mostly derived from the Mesa and Cedar languages developed at Xerox PARC.
Niklaus Wirth designed Modula-2, the starting point of our starting point. He also reviewed the evolving design and made many valuable suggestionsnot one of which was a suggested addition. Indeed, he inspired us with the courage to pull out a number of deep-rooted weeds.
SRC Modula-3 was implemented by Bill Kalsow and Eric Muller. Olivetti Modula-3 was implemented by Mick Jordan, Trevor Morris, David Chase, Steve Glassman, and Marion Sturtevant.
The language and this chapter were greatly improved by the helpful feedback from Bob Ayers, Andrew Black, Regis Crelier, Dan Craft, Hans Eberle, John Ellis, Stu Feldman, Michel Gangnet, Lucille Glassman, David Goldberg, Stephen Harrison, Sam Harbison, Jim Horning, Solange Karsenty, Mike Kupfer, Butler Lampson, Mark Manasse, Tim Mann, Eliot Moss, Dick Orgass, Sharon Perl, Norman Ramsey, Lyle Ramshaw, Eric Roberts, Peter Robinson, Ed Satterthwaite, Jorge Stolfi, Garret Swart, Chuck Thacker, and Ken Zadeck.
We are grateful for the support of Digital Equipment Corporation in general and Bob Taylor and Sam Fuller in particular.
For more information about Modula-3 see http://www.m3.org and http://www.research.digital.com/modula-3/html/.
Previous | Table of Contents | Next |