Fix codegen error (Java) when a lexer has only fragment tokens

Solves issue #1999.
This commit is contained in:
Bráulio Bezerra 2017-09-09 12:02:42 -03:00
parent 1203794259
commit dc77aacfcd
2 changed files with 4 additions and 1 deletions

View File

@ -153,4 +153,5 @@ YYYY/MM/DD, github id, Full name, email
2017/06/25, alimg, Alim Gökkaya, alim.gokkaya@gmail.com
2017/07/11, dhalperi, Daniel Halperin, daniel@halper.in
2017/07/27, shirou, WAKAYAMA Shirou, shirou.faw@gmail.com
2017/07/09, neatnerd, Mike Arshinskiy, neatnerd@users.noreply.github.com
2017/07/09, neatnerd, Mike Arshinskiy, neatnerd@users.noreply.github.com
2017/09/09, brauliobz, Bráulio Bezerra, brauliobezerra@gmail.com

View File

@ -894,8 +894,10 @@ public class <lexer.name> extends <superClass; null="Lexer"> {
protected static final DFA[] _decisionToDFA;
protected static final PredictionContextCache _sharedContextCache =
new PredictionContextCache();
<if(lexer.tokens)>
public static final int
<lexer.tokens:{k | <k>=<lexer.tokens.(k)>}; separator=", ", wrap, anchor>;
<endif>
<if(lexer.channels)>
public static final int
<lexer.channels:{c | <c>=<lexer.channels.(c)>}; separator=", ", wrap, anchor>;