Path: utzoo!attcan!uunet!mcvax!ukc!reading!cf-cm!ted From: ted@computing-maths.cardiff.ac.uk (Ted Lawson) Newsgroups: comp.lang.eiffel Subject: Suggested modifications to syntax definition in OOSC Keywords: Eiffel syntax Message-ID: <830@cf-cm.UUCP> Date: 22 Jul 89 13:37:58 GMT Organization: University of Wales College of Cardiff, Cardiff, WALES, UK. Lines: 57 There are two parts of the Eiffel grammar published in OOSC that could be represented in ways that reflect their semantics better. Both concern expressions. 1) The production Expression = {Unqualified_expression "." ...} allows tokens other than class features to follow a ".". For example the following nonsensical constructs will be recognised as Expressions "1.2.3" "x.Current.Current" "x.( 1 + 2 )" etc. I suggest this as an alternative: Expression = Unqualified_expression | Expression "." Entity | Expression "." Unqualified_call 2) The syntax defining Multiary_expressions Expression = {Unqualified_expression "." ...} Unqualified_expression = Constant | (omitted) | Operator_expression Multiary_expression = {Expression Multiary ... }+ is (if I understand Bertrand Meyer's use of the {...} notation correctly) semantically rather curious. For example, it means that "123" is a Multiary_expression. An alternative: Multiary_expression = Expression Multiary {Expression Multiary ... }+ or recursively: Multiary_expression = Expression Multiary Expression | Multiary_expression Multiary Expression ================================ Any comments on these remarks are very welcome. Ted Lawson ted@uk.ac.cf.cm