Java Reference
In-Depth Information
ConstructorDeclaration:
ConstructorModifiers opt ConstructorDeclarator
Throws opt ConstructorBody
which defines one right-hand side for the nonterminal ConstructorDeclaration .
When the words “one of” follow the colon in a grammar definition, they signify that each
of the terminal symbols on the following line or lines is an alternative definition.
For example, the lexical grammar contains the production:
ZeroToThree: one of
0 1 2 3
which is merely a convenient abbreviation for:
ZeroToThree:
0
1
2
3
When an alternative in a lexical production appears to be a token, it represents the sequence
of characters that would make up such a token.
Thus, the definition:
BooleanLiteral: one of
true false
in a lexical grammar production is shorthand for:
BooleanLiteral:
t r u e
f a l s e
The right-hand side of a lexical production may specify that certain expansions are not per-
mitted by using the phrase “but not” and then indicating the expansions to be excluded.
For example, this occurs in the productions for InputCharacter 3.4 ) and Identifier
3.8 ) :
Search WWH ::




Custom Search