[Next] [Previous] [Top] [Contents] [Index]
Dylan Reference Manual
A BNF
General Notes
Dylan syntax can be parsed with an LALR(1) grammar.
This appendix uses some special notation to make the presentation of the grammar more readable.
- The opt suffix means that the preceding item is optional.
- A trailing ellipsis (...) is used in two different ways to signal possible repetition.
- If there is only one item on the line preceding the ellipsis, the item may appear one or more times.
- If more than one item precedes the ellipsis, the last of these items is designated a separator; the rest may appear one or more times, with the separator appearing after each occurrence but the last. (When only one item appears, the separator does not appear.)
- Identifiers for grammar rules are written with uppercase letters when the identifier is used in the phrase grammar but defined in the lexical grammar.
- The grammar does not use distinct identifiers for grammar rules that differ only in alphabetic case.
Lexical Notes
In the lexical grammar, the various elements that come together to form a single token on the right-hand sides of rules must not be separated by white-space, so that the end result will be a single token. This is in contrast to the phrase grammar, where each element is already a complete token or a series of complete tokens.
Arbitrary white-space is permitted between tokens, but it is required only as necessary to separate tokens that might otherwise blend together.
Case is not significant except within character and string literals. The grammars do not reflect this, using one case or the other, but it is still true.
- General Notes
-
- Lexical Notes
-
- Lexical Grammar
-
- Phrase Grammar
-
Dylan Reference Manual - 17 OCT 1995
[Next] [Previous] [Top] [Contents] [Index]
Generated with Harlequin WebMaker