diff options
author | Christopher L. Conway <christopherleeconway@gmail.com> | 2010-10-20 20:41:03 +0000 |
---|---|---|
committer | Christopher L. Conway <christopherleeconway@gmail.com> | 2010-10-20 20:41:03 +0000 |
commit | 93e8bc35db891c6041f9690366be933433a0ad52 (patch) | |
tree | e946c0824d6d91c44ecc97a627411e5d6c334ea9 /src/parser/antlr_input_imports.cpp | |
parent | daad722774087de1cf35714868d3762b3ea7cb21 (diff) |
Adding support for interactive mode
Diffstat (limited to 'src/parser/antlr_input_imports.cpp')
-rw-r--r-- | src/parser/antlr_input_imports.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/parser/antlr_input_imports.cpp b/src/parser/antlr_input_imports.cpp index a1ebee523..2805d518a 100644 --- a/src/parser/antlr_input_imports.cpp +++ b/src/parser/antlr_input_imports.cpp @@ -56,6 +56,7 @@ #include "antlr_input.h" #include "parser.h" +#include "parser_exception.h" #include "util/Assert.h" using namespace std; @@ -89,6 +90,14 @@ void AntlrInput::reportError(pANTLR3_BASE_RECOGNIZER recognizer) { pANTLR3_UINT8 * tokenNames = recognizer->state->tokenNames; stringstream ss; + // Dig the CVC4 objects out of the ANTLR3 mess + pANTLR3_PARSER antlr3Parser = (pANTLR3_PARSER)(recognizer->super); + AlwaysAssert(antlr3Parser!=NULL); + Parser *parser = (Parser*)(antlr3Parser->super); + AlwaysAssert(parser!=NULL); + AntlrInput *input = (AntlrInput*) parser->getInput() ; + AlwaysAssert(input!=NULL); + // Signal we are in error recovery now recognizer->state->errorRecovery = ANTLR3_TRUE; @@ -252,14 +261,6 @@ void AntlrInput::reportError(pANTLR3_BASE_RECOGNIZER recognizer) { break; } - // Now get ready to throw an exception - pANTLR3_PARSER antlr3Parser = (pANTLR3_PARSER)(recognizer->super); - AlwaysAssert(antlr3Parser!=NULL); - Parser *parser = (Parser*)(antlr3Parser->super); - AlwaysAssert(parser!=NULL); - AntlrInput *input = (AntlrInput*) parser->getInput() ; - AlwaysAssert(input!=NULL); - // Call the error display routine input->parseError(ss.str()); } |