Daniel F Moisset
2005-07-04 23:53:01 UTC
Hi,
I've been implementing the REFERENCE class until I crashed against a
problem: "reference" is also a reserved word in 1.x. So, you should be
able to write:
a: reference INTEGER
-- This should emit a warning about 2.x compatibility
a: REFERENCE [INTEGER]
-- This refers to generic class REFERENCE in base cluster.
The implementation for this is gonna be ugly, one way or another. The
options I'm considering are:
* Make the distinction between reserved word/identifier based on
capitalization. This breaks in a special case the case-insensitive
eiffel tradition, and might break strangely capitalized 1.1 code
(however, I can't remember ever seeing Eiffel code with non-capitalized
class names).
* Modify slightly the parser grammar:
Type ::= ...other cases...
| "reference" Class_type
| "reference" "[" Type "]"
where the second one has the same semantics as REFERENCE[the other
type].
Do you have any preference over any of these? I have a slight
inclination towards the second one. Other cleaner ideas would be nice
too.
Cheers,
D.
I've been implementing the REFERENCE class until I crashed against a
problem: "reference" is also a reserved word in 1.x. So, you should be
able to write:
a: reference INTEGER
-- This should emit a warning about 2.x compatibility
a: REFERENCE [INTEGER]
-- This refers to generic class REFERENCE in base cluster.
The implementation for this is gonna be ugly, one way or another. The
options I'm considering are:
* Make the distinction between reserved word/identifier based on
capitalization. This breaks in a special case the case-insensitive
eiffel tradition, and might break strangely capitalized 1.1 code
(however, I can't remember ever seeing Eiffel code with non-capitalized
class names).
* Modify slightly the parser grammar:
Type ::= ...other cases...
| "reference" Class_type
| "reference" "[" Type "]"
where the second one has the same semantics as REFERENCE[the other
type].
Do you have any preference over any of these? I have a slight
inclination towards the second one. Other cleaner ideas would be nice
too.
Cheers,
D.