Merge pull request #2121 from ewanmellor/swift-fix-interpreter-dfas
[Swift] Fix initialization of {Lexer,Parser}Interpreter.decisionToDFA.
This commit is contained in:
commit
756fcdd5ec
|
@ -27,9 +27,8 @@ public class LexerInterpreter: Lexer {
|
|||
self.modeNames = modeNames
|
||||
self.vocabulary = vocabulary
|
||||
|
||||
self._decisionToDFA = [DFA]() //new DFA[atn.getNumberOfDecisions()];
|
||||
let _decisionToDFALength = _decisionToDFA.count
|
||||
for i in 0..<_decisionToDFALength {
|
||||
self._decisionToDFA = [DFA]()
|
||||
for i in 0 ..< atn.getNumberOfDecisions() {
|
||||
_decisionToDFA[i] = DFA(atn.getDecisionState(i)!, i)
|
||||
}
|
||||
super.init(input)
|
||||
|
|
|
@ -75,9 +75,8 @@ public class ParserInterpreter: Parser {
|
|||
self.atn = atn
|
||||
self.ruleNames = ruleNames
|
||||
self.vocabulary = vocabulary
|
||||
self.decisionToDFA = [DFA]() //new DFA[atn.getNumberOfDecisions()];
|
||||
let decisionToDFALength = decisionToDFA.count
|
||||
for i in 0..<decisionToDFALength {
|
||||
self.decisionToDFA = [DFA]()
|
||||
for i in 0 ..< atn.getNumberOfDecisions() {
|
||||
decisionToDFA[i] = DFA(atn.getDecisionState(i)!, i)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue