| 118 | # mismatched symbol |
| 119 | |
| 120 | def match(self, ttype:int): |
| 121 | t = self.getCurrentToken() |
| 122 | if t.type==ttype: |
| 123 | self._errHandler.reportMatch(self) |
| 124 | self.consume() |
| 125 | else: |
| 126 | t = self._errHandler.recoverInline(self) |
| 127 | if self.buildParseTrees and t.tokenIndex==-1: |
| 128 | # we must have conjured up a new token during single token insertion |
| 129 | # if it's not the current symbol |
| 130 | self._ctx.addErrorNode(t) |
| 131 | return t |
| 132 | |
| 133 | # Match current input symbol as a wildcard. If the symbol type matches |
| 134 | # (i.e. has a value greater than 0), {@link ANTLRErrorStrategy#reportMatch} |