Lines Matching refs:_state
163 self._state = state
183 if self._state is None:
187 self._state.following = []
188 self._state.errorRecovery = False
189 self._state.lastErrorIndex = -1
190 self._state.syntaxErrors = 0
192 self._state.backtracking = 0
193 if self._state.ruleMemo is not None:
194 self._state.ruleMemo = {}
214 self._state.errorRecovery = False
217 if self._state.backtracking > 0:
228 self._state.errorRecovery = False
247 if len(self._state.following) > 0:
281 if self._state.errorRecovery:
284 self._state.syntaxErrors += 1 # don't count spurious
285 self._state.errorRecovery = True
410 return self._state.syntaxErrors
461 if self._state.lastErrorIndex == input.index():
468 self._state.lastErrorIndex = input.index()
651 for idx, localFollowSet in reversed(list(enumerate(self._state.following))):
880 return self._state.backtracking
883 self._state.backtracking = n
920 if ruleIndex not in self._state.ruleMemo:
921 self._state.ruleMemo[ruleIndex] = {}
923 return self._state.ruleMemo[ruleIndex].get(
964 if ruleIndex in self._state.ruleMemo:
965 self._state.ruleMemo[ruleIndex][ruleStartIndex] = stopTokenIndex
971 if self._state.backtracking > 0:
972 sys.stdout.write(" backtracking=%s" % self._state.backtracking)
980 if self._state.backtracking > 0:
981 sys.stdout.write(" backtracking=%s" % self._state.backtracking)
985 #if self._state.failed:
1071 if self._state is None:
1076 self._state.token = None
1077 self._state.type = INVALID_TOKEN_TYPE
1078 self._state.channel = DEFAULT_CHANNEL
1079 self._state.tokenStartCharIndex = -1
1080 self._state.tokenStartLine = -1
1081 self._state.tokenStartCharPositionInLine = -1
1082 self._state.text = None
1101 self._state.token = None
1102 self._state.channel = DEFAULT_CHANNEL
1103 self._state.tokenStartCharIndex = self.input.index()
1104 self._state.tokenStartCharPositionInLine = self.input.charPositionInLine
1105 self._state.tokenStartLine = self.input.line
1106 self._state.text = None
1113 if self._state.token is None:
1116 elif self._state.token == SKIP_TOKEN:
1119 return self._state.token
1139 self._state.token = SKIP_TOKEN
1175 type=self._state.type,
1176 channel=self._state.channel,
1177 start=self._state.tokenStartCharIndex,
1180 token.line = self._state.tokenStartLine
1181 token.text = self._state.text
1182 token.charPositionInLine = self._state.tokenStartCharPositionInLine
1184 self._state.token = token
1193 if self._state.backtracking > 0:
1204 if self._state.backtracking > 0:
1220 if self._state.backtracking > 0:
1249 if self._state.text is not None:
1250 return self._state.text
1253 self._state.tokenStartCharIndex,
1263 self._state.text = text