diff options
author | Christopher L. Conway <christopherleeconway@gmail.com> | 2011-04-18 03:10:55 +0000 |
---|---|---|
committer | Christopher L. Conway <christopherleeconway@gmail.com> | 2011-04-18 03:10:55 +0000 |
commit | 7d281fba79b1c9f3ae646d3371a0e52e2efd3bba (patch) | |
tree | e76c7b2b3234c71aa9f5a2461b916a6e014bebb7 | |
parent | ca0fb38ee6a8aa390e6566d421a9ade7d0fb67d2 (diff) |
Fixing output for EOF token in parser errors
-rw-r--r-- | src/parser/antlr_input.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/parser/antlr_input.h b/src/parser/antlr_input.h index 2f12aea03..c48185f58 100644 --- a/src/parser/antlr_input.h +++ b/src/parser/antlr_input.h @@ -219,6 +219,10 @@ inline std::string AntlrInput::getUnparsedText() { inline std::string AntlrInput::tokenText(pANTLR3_COMMON_TOKEN token) { + if( token->type == ANTLR3_TOKEN_EOF ) { + return "<<EOF>>"; + } + ANTLR3_MARKER start = token->getStartIndex(token); ANTLR3_MARKER end = token->getStopIndex(token); /* start and end are boundary pointers. The text is a string |