Appropriate use of "static readonly" or "const" instead of "final"

This commit is contained in:
Sam Harwell 2013-02-24 13:35:26 -06:00
parent c0dfb334a3
commit 65caff9353
1 changed files with 10 additions and 10 deletions

View File

@ -139,15 +139,15 @@ Parser(parser, funcs, atn, sempredFuncs, superClass) ::= <<
Parser_(parser, funcs, atn, sempredFuncs, ctor, superClass) ::= <<
public <if(parser.abstractRecognizer)>abstract <endif>class <parser.name> : <superClass> {
<if(parser.tokens)>
public static final int
public const int
<parser.tokens:{k | <k>=<parser.tokens.(k)>}; separator=", ", wrap, anchor>;
<endif>
public static final string[] tokenNames = {
public static readonly string[] tokenNames = {
<parser.tokenNames:{t | <t>}; null="\"\<INVALID>\"", separator=", ", wrap, anchor>
};
public static final int
public const int
<parser.rules:{r | RULE_<r.name> = <r.index>}; separator=", ", wrap, anchor>;
public static final string[] ruleNames = {
public static readonly string[] ruleNames = {
<parser.ruleNames:{r | "<r>"}; separator=", ", wrap, anchor>
};
@ -823,18 +823,18 @@ using DFA = Antlr4.Runtime.Dfa.DFA;
Lexer(lexer, atn, actionFuncs, sempredFuncs, superClass) ::= <<
public <if(lexer.abstractRecognizer)>abstract <endif>class <lexer.name> : <superClass> {
public static final int
public const int
<lexer.tokens:{k | <k>=<lexer.tokens.(k)>}; separator=", ", wrap, anchor>;
<rest(lexer.modes):{m| public static final int <m> = <i>;}; separator="\n">
<rest(lexer.modes):{m| public const int <m> = <i>;}; separator="\n">
public static string[] modeNames = {
<lexer.modes:{m| "<m>"}; separator=", ", wrap, anchor>
};
public static final string[] tokenNames = {
public static readonly string[] tokenNames = {
"\<INVALID>",
<lexer.tokenNames:{t | <t>}; separator=", ", wrap, anchor>
};
public static final string[] ruleNames = {
public static readonly string[] ruleNames = {
<lexer.ruleNames:{r | "<r>"}; separator=", ", wrap, anchor>
};
@ -864,9 +864,9 @@ public <if(lexer.abstractRecognizer)>abstract <endif>class <lexer.name> : <super
SerializedATN(model) ::= <<
public static final string _serializedATN =
public static readonly string _serializedATN =
"<model.serialized; wrap={"+<\n><\t>"}>";
public static final ATN _ATN =
public static readonly ATN _ATN =
ATNSimulator.Deserialize(_serializedATN.ToCharArray());
static {
<! org.antlr.v4.tool.DOTGenerator dot = new org.antlr.v4.tool.DOTGenerator(null);!>