From 9dccea264f0b0ecd7edb21c392c1fc0c6741198d Mon Sep 17 00:00:00 2001 From: Morgan Deters Date: Tue, 4 Jun 2013 15:51:42 -0400 Subject: File inclusion in Smt2 parser. The extended command (include-file "filename") now includes file content. --- src/parser/antlr_input.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/parser/antlr_input.cpp') diff --git a/src/parser/antlr_input.cpp b/src/parser/antlr_input.cpp index cd622b8a6..d498d3c54 100644 --- a/src/parser/antlr_input.cpp +++ b/src/parser/antlr_input.cpp @@ -46,9 +46,10 @@ namespace parser { AntlrInputStream::AntlrInputStream(std::string name, pANTLR3_INPUT_STREAM input, bool fileIsTemporary) : - InputStream(name,fileIsTemporary), + InputStream(name, fileIsTemporary), d_input(input) { assert( input != NULL ); + input->fileName = input->strFactory->newStr8(input->strFactory, (pANTLR3_UINT8)name.c_str()); } AntlrInputStream::~AntlrInputStream() { @@ -286,16 +287,18 @@ void AntlrInput::warning(const std::string& message) { void AntlrInput::parseError(const std::string& message, bool eofException) throw (ParserException) { Debug("parser") << "Throwing exception: " - << getInputStream()->getName() << ":" + << (const char*)d_lexer->rec->state->tokSource->fileName->chars << ":" << d_lexer->getLine(d_lexer) << "." << d_lexer->getCharPositionInLine(d_lexer) << ": " << message << endl; if(eofException) { - throw ParserEndOfFileException(message, getInputStream()->getName(), + throw ParserEndOfFileException(message, + (const char*)d_lexer->rec->state->tokSource->fileName->chars, d_lexer->getLine(d_lexer), d_lexer->getCharPositionInLine(d_lexer)); } else { - throw ParserException(message, getInputStream()->getName(), + throw ParserException(message, + (const char*)d_lexer->rec->state->tokSource->fileName->chars, d_lexer->getLine(d_lexer), d_lexer->getCharPositionInLine(d_lexer)); } -- cgit v1.2.3