Next: Lexical Considerations
Up: The Proteus NS Grammar
The goals for the design of the Proteus 2 grammar were:
- The grammar should have no conflicts when using a bison-like
parser generator (LALR(1) with precedence).
- The grammar should be simplified as much as possible to allow easy
parsing and implementation of the Proteus language
- Several constructs of the old Proteus grammer should be preserved:
- Sequences will be delineated with [ and ]
- Tuples will be delineated with ( and ).
- The set and sequence generator will have have the form:
``[ Iterator | Predicate : expr
where the ``| Predicate'' clause is optional.
This change makes the ordering of the items in a generator more like the
ordering of a for statement in other languages. This make nested
generators easier for programmers to read.