Closed GoogleCodeExporter closed 9 years ago
It has to be decided yet if the order of interface elements should be like this:
O1: (attribute|method|broadcast)* (contract)? (constant|type)?
or like this:
O2: (attribute|method|broadcast|contract|constant|type)?
or like this:
O3: (attribute|method|broadcast|constant|type)? (contract)?
I tend to option O3, rationale: It would be useful to define constants and
types before the attributes/methods/broadcasts which use them. And the contract
is based on the definition of the other interface elements, not vice versa. So
the contract should be at the end.
----
For backward compatibility, we probably should implement O3b with a deprecated
marking at the contract, if it is not at the end:
O3b: (attribute|method|broadcast|constant|type)? (contract)? (constant|type)?
Original comment by klaus.birken@gmail.com
on 20 May 2014 at 12:03
Implementation sketch by Markus Mühlbrandt (slightly adapted):
FInterface returns FInterface:
{FInterface}
(comment=FAnnotationBlock)?
'interface' name=ID
('extends' base=[FInterface|FQN])?
('manages'
managedInterfaces+=[FInterface|FQN]
(',' managedInterfaces+=[FInterface|FQN])*
)?
'{'
('version' version=FVersion)?
(attributes+=FAttribute | methods+=FMethod |
broadcasts+=FBroadcast | types+=FType | constants+=FConstantDef)*
(contract=FContract)?
'}';
Original comment by klaus.birken@gmail.com
on 20 May 2014 at 12:05
Original comment by klaus.birken@gmail.com
on 9 Dec 2014 at 10:10
Implemented by commit 4497780 on develop. We also allow constant and type
definitions in a type collection to be in arbitrary order.
Now, a contract should be always at the end of an interface definition.
However, we support constant and type definitions after the contract, but their
location will be marked as deprecated (warning).
Original comment by klaus.birken@gmail.com
on 15 Dec 2014 at 2:42
Original comment by klaus.birken@gmail.com
on 19 Dec 2014 at 2:33
Original comment by klaus.birken@gmail.com
on 25 Jan 2015 at 11:16
Original issue reported on code.google.com by
klaus.birken@gmail.com
on 20 May 2014 at 12:00