Consume if x is next character on the input stream.
(char x)
| 207 | */ |
| 208 | |
| 209 | public void match(char x) { |
| 210 | if ( c!= x ) { |
| 211 | NoViableAltException e = new NoViableAltException("", 0, 0, input); |
| 212 | errMgr.lexerError(input.getSourceName(), |
| 213 | "expecting '" +x+"', found '"+str(c)+"'", |
| 214 | templateToken, |
| 215 | e); |
| 216 | } |
| 217 | consume(); |
| 218 | } |
| 219 | |
| 220 | protected void consume() { |
| 221 | input.consume(); |