| 5 |
|
* Project led by Terence Parr at http://www.jGuru.com |
| 6 |
|
* Software rights: http://www.antlr.org/license.html |
| 7 |
|
* |
| 8 |
< |
* $Id: CharScanner.hpp,v 1.1 2005-12-02 15:38:02 tim Exp $ |
| 8 |
> |
* $Id$ |
| 9 |
|
*/ |
| 10 |
|
|
| 11 |
|
#include <antlr/config.hpp> |
| 12 |
< |
|
| 12 |
> |
#include <cstdio> |
| 13 |
|
#include <map> |
| 14 |
+ |
#include <cstring> |
| 15 |
|
|
| 16 |
|
#ifdef HAS_NOT_CCTYPE_H |
| 17 |
|
#include <ctype.h> |
| 120 |
|
virtual void commit() |
| 121 |
|
{ |
| 122 |
|
inputState->getInput().commit(); |
| 123 |
+ |
} |
| 124 |
+ |
|
| 125 |
+ |
/** called by the generated lexer to do error recovery, override to |
| 126 |
+ |
* customize the behaviour. |
| 127 |
+ |
*/ |
| 128 |
+ |
virtual void recover(const RecognitionException& ex, const BitSet& tokenSet) |
| 129 |
+ |
{ |
| 130 |
+ |
consume(); |
| 131 |
+ |
consumeUntil(tokenSet); |
| 132 |
|
} |
| 133 |
|
|
| 134 |
|
virtual void consume() |