forked from jasder/antlr
v4: Specify @Nullable
[git-p4: depot-paths = "//depot/code/antlr4/main/": change = 9342]
This commit is contained in:
parent
3526198105
commit
36a9af8b29
|
@ -29,6 +29,7 @@
|
|||
|
||||
package org.antlr.v4.runtime.atn;
|
||||
|
||||
import com.sun.istack.internal.Nullable;
|
||||
import org.antlr.v4.runtime.*;
|
||||
import org.antlr.v4.runtime.dfa.DFA;
|
||||
import org.antlr.v4.runtime.dfa.DFAState;
|
||||
|
@ -104,7 +105,7 @@ public class LexerATNSimulator extends ATNSimulator {
|
|||
this(null, atn);
|
||||
}
|
||||
|
||||
public LexerATNSimulator(Lexer recog, ATN atn) {
|
||||
public LexerATNSimulator(@Nullable Lexer recog, ATN atn) {
|
||||
super(atn);
|
||||
dfa = new DFA[atn.modeToStartState.size()];
|
||||
for (int i=0; i<atn.modeToStartState.size(); i++) {
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
*/
|
||||
package org.antlr.v4.runtime.dfa;
|
||||
|
||||
import com.sun.istack.internal.Nullable;
|
||||
import org.antlr.v4.runtime.atn.ATNState;
|
||||
|
||||
import java.util.*;
|
||||
|
@ -52,7 +53,7 @@ public class DFA {
|
|||
|
||||
public String toString() { return toString(null); }
|
||||
|
||||
public String toString(String[] tokenNames) {
|
||||
public String toString(@Nullable String[] tokenNames) {
|
||||
if ( s0==null ) return "";
|
||||
DFASerializer serializer = new DFASerializer(this,tokenNames);
|
||||
return serializer.toString();
|
||||
|
|
|
@ -29,12 +29,14 @@
|
|||
|
||||
package org.antlr.v4.runtime.dfa;
|
||||
|
||||
import com.sun.istack.internal.Nullable;
|
||||
|
||||
/** A DFA walker that knows how to dump them to serialized strings. */
|
||||
public class DFASerializer {
|
||||
String[] tokenNames;
|
||||
DFA dfa;
|
||||
|
||||
public DFASerializer(DFA dfa, String[] tokenNames) {
|
||||
public DFASerializer(DFA dfa, @Nullable String[] tokenNames) {
|
||||
this.dfa = dfa;
|
||||
this.tokenNames = tokenNames;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue