Merge pull request #2680 from listba/patch-1

Documentation: Added Missing lexer/parermodifier clarification in example
This commit is contained in:
Terence Parr 2020-11-24 10:33:29 -08:00 committed by GitHub
commit dce97a050d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -240,6 +240,7 @@ YYYY/MM/DD, github id, Full name, email
2019/09/28, lmy269, Mingyang Liu, lmy040758@gmail.com
2019/10/29, tehbone, Tabari Alexander, tehbone@gmail.com
2019/10/31, a-square, Alexei Averchenko, lex.aver@gmail.com
2019/11/05, listba, Ben List, ben.list89@gmail.com
2019/11/11, foxeverl, Liu Xinfeng, liuxf1986[at]gmail[dot]com
2019/11/17, felixn, Felix Nieuwenhuizhen, felix@tdlrali.com
2019/11/18, mlilback, Mark Lilback, mark@lilback.com

View File

@ -26,8 +26,8 @@ The Javadoc comments are hidden from the parser and are ignored at the moment.
Token names always start with a capital letter and so do lexer rules as defined by Javas `Character.isUpperCase` method. Parser rule names always start with a lowercase letter (those that fail `Character.isUpperCase`). The initial character can be followed by uppercase and lowercase letters, digits, and underscores. Here are some sample names:
```
ID, LPAREN, RIGHT_CURLY // token names/rules
expr, simpleDeclarator, d2, header_file // rule names
ID, LPAREN, RIGHT_CURLY // token names/lexer rules
expr, simpleDeclarator, d2, header_file // parser rule names
```
Like Java, ANTLR accepts Unicode characters in ANTLR names: