summaryrefslogtreecommitdiff
path: root/src/parser/antlr_input_imports.cpp
diff options
context:
space:
mode:
authorChristopher L. Conway <christopherleeconway@gmail.com>2010-10-20 20:41:03 +0000
committerChristopher L. Conway <christopherleeconway@gmail.com>2010-10-20 20:41:03 +0000
commit93e8bc35db891c6041f9690366be933433a0ad52 (patch)
treee946c0824d6d91c44ecc97a627411e5d6c334ea9 /src/parser/antlr_input_imports.cpp
parentdaad722774087de1cf35714868d3762b3ea7cb21 (diff)
Adding support for interactive mode
Diffstat (limited to 'src/parser/antlr_input_imports.cpp')
-rw-r--r--src/parser/antlr_input_imports.cpp17
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());
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback