Your rule set:
! -------------------------------------------------------------------
! Properties
! -------------------------------------------------------------------
<Property> ::= <Attributes> <Modifiers> Property ID <Param List>
<Type> <NL> <Property Items> End Property <NL>
<Property Items> ::= <Property Item> <Property Items>
|
<Property Item> ::= Get <NL> <Statements> End Get <NL>
| Set <Param List> <NL> <Statements> End Set <NL>
but the rule "<Property Items> ::= <Property Item> <Property Items> |
" allows an infinit count of property items and even you can have more
than one GET or SET property item.
My version:
<Property> ::= <Attributes> <Modifiers> PropertyDecl
<PropertyDecl> ::= <BidirectionalProperty> | <ReadOnlyProperty> |
<WriteOnlyProperty>
<BidirectionalProperty> ::= Property ID <Param List> <Type> <NL>
<Property Items> End
<ReadOnlyProperty> ::= ReadOnly Property ID <Param List> <Type> <NL>
<Property Get Item> End
<WriteOnlyProperty> ::= WriteOnly Property ID <Param List> <Type> <NL>
<Property Set Item> End
<Property Items> ::= <Property Get Item> <Property Set Item>
<Property Get Item> ::= <Attributes> Get <NL> <Statements> End Get
<NL>
<Property Set Item> ::= <Attributes> Set <Param List> <NL>
<Statements> End Set <NL>
I think, its closer to the existing
vb.net language. You also can
place Attributes on the Get or Set part. And maybe, the grammar should
be extended, because not all types of attributes are allowed on all
elements, but this check can be done later in the compiling chain.
With best regards
Gerhard