Code Block |
---|
| ZeroOrManyWithHangingSeparator = "(" RuleExpression ";" Separator ";" "?" ")" "*" |
RuleExpression.ZeroOrManyWithHangingSeparator
is the same as ZeroOrManyWithSeparator
, except that it allows for a hanging separator – a separator located at the end of the list (not followed by an element).
For example:
Code Block |
---|
syntax EnumMemberDeclarations = (EnumMemberDeclaration; ","; ?)*; |
This example parses code such as:
Code Block |
---|
UriEscaped = 1, Unescaped, SafeUnescaped, |
or:
Code Block |
---|
UriEscaped = 1, Unescaped, SafeUnescaped |
that is the code either with a comma at the end of the list or without it.
Using the ZeroOrManyWithSeparator
rule would prohibit a comma at the end of the list.
See also
RuleExpression
RuleExpression.ZeroOrMany
RuleExpression.OneOrMany
RuleExpression.ZeroOrManyWithSeparator
RuleExpression.OneOrManyWithSeparator
RuleExpression.OneOrManyWithHangingSeparator