summaryrefslogtreecommitdiff
path: root/src/parser/antlr_input.cpp
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@cs.nyu.edu>2013-06-04 15:51:42 -0400
committerMorgan Deters <mdeters@cs.nyu.edu>2013-06-04 19:17:05 -0400
commit9dccea264f0b0ecd7edb21c392c1fc0c6741198d (patch)
treeae3fa1f01c5600306355727745b68a2b101b8c6f /src/parser/antlr_input.cpp
parent61f8a3151797c884d6f083d1657aec9a76e694de (diff)
File inclusion in Smt2 parser.
The extended command (include-file "filename") now includes file content.
Diffstat (limited to 'src/parser/antlr_input.cpp')
-rw-r--r--src/parser/antlr_input.cpp11
1 files changed, 7 insertions, 4 deletions
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));
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback