* Rules begins with lower case
* Token types begins with upper case letter
* Lexer rules are given in upper case.
* x | y | z - match any alternative: x or y or z
* x? - x is optional
* x* - x can present zero or more times
* x+ - x can present one or more times
* Lexer rules are always tokens and should be given in upper case. Methods related to lexer rules are prefixed with 'm'.
Reference: The defenitive antlr reference - building domain specific languages
Its really interesting
ReplyDeleteEclipse has its own plugin with it;