Merge pull request #2800 from Agrabski/patch-1

Make sample grammar for lexer modes more readable
This commit is contained in:
Terence Parr 2020-11-24 10:22:01 -08:00 committed by GitHub
commit bbf042619e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -249,6 +249,7 @@ YYYY/MM/DD, github id, Full name, email
2020/02/21, StochasticTinkr, Daniel Pitts, github@coloraura.com
2020/03/17, XsongyangX, Song Yang, songyang1218@gmail.com
2020/04/07, deniskyashif, Denis Kyashif, denis.kyashif@gmail.com
2020/04/10, agrabski, Adam Grabski, adam.gr@outlook.com
2020/04/23, martinvw, Martin van Wingerden, martin@martinvw.nl
2020/04/30, TristonianJones, Tristan Swadell, tswadell@google.com
2020/05/06, iammosespaulr, Moses Paul R, iammosespaulr@gmail.com

View File

@ -246,7 +246,8 @@ The mode commands alter the mode stack and hence the mode of the lexer. The 'mor
```
// Default "mode": Everything OUTSIDE of a tag
COMMENT : '<!--' .*? '-->' ;
CDATA : '<![CDATA[' .*? ']]>' ;OPEN : '<' -> pushMode(INSIDE) ;
CDATA : '<![CDATA[' .*? ']]>' ;
OPEN : '<' -> pushMode(INSIDE) ;
...
XMLDeclOpen : '<?xml' S -> pushMode(INSIDE) ;
SPECIAL_OPEN: '<?' Name -> more, pushMode(PROC_INSTR) ;