Notation
Grammar
The following notations are used by the Lexer and Syntax grammar snippets:
Notation | Examples | Meaning |
---|---|---|
CAPITAL | KW_IF | A token produced by the lexer |
ItalicCamelCase | Item | A syntactical production |
string | x , while , * | The exact character(s) |
\x | \n, \r, \t, \0 | The character represented by this escape |
x? | pub ? | An optional item |
x* | OuterAttribute* | 0 or more of x |
x+ | MacroMatch+ | 1 or more of x |
xa..b | HEX_DIGIT1..6 | a to b repetitions of x |
| | u8 | u16 , Block | Item | Either one or another |
[ ] | [b B ] | Any of the characters listed |
[ - ] | [a -z ] | Any of the characters in the range |
~[ ] | ~[b B ] | Any characters, except those listed |
~string | ~\n , ~*/ | Any characters, except this sequence |
( ) | (, Parameter) | Groups items |