summaryrefslogtreecommitdiff
path: root/src/parser/antlr_input.cpp
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2010-07-06 15:52:10 +0000
committerMorgan Deters <mdeters@gmail.com>2010-07-06 15:52:10 +0000
commitd6b40829e8d92a7a298d0c0023d944131a8285cf (patch)
tree64fb36a7623cb2416d7129a3249d5875ce4f68ec /src/parser/antlr_input.cpp
parentb9f36ae0027e52da925416630ccad5d4b84779e9 (diff)
merge from CC work: pieces of the parser need to be declared to throw AssertionException, and language enum should have stream insertion op
Diffstat (limited to 'src/parser/antlr_input.cpp')
-rw-r--r--src/parser/antlr_input.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/parser/antlr_input.cpp b/src/parser/antlr_input.cpp
index 740d7fae5..b919c3bd5 100644
--- a/src/parser/antlr_input.cpp
+++ b/src/parser/antlr_input.cpp
@@ -63,7 +63,7 @@ pANTLR3_INPUT_STREAM AntlrInputStream::getAntlr3InputStream() const {
AntlrInputStream*
AntlrInputStream::newFileInputStream(const std::string& name,
bool useMmap)
- throw (InputStreamException) {
+ throw (InputStreamException, AssertionException) {
pANTLR3_INPUT_STREAM input = NULL;
if( useMmap ) {
input = MemoryMappedInputBufferNew(name);
@@ -79,7 +79,7 @@ AntlrInputStream::newFileInputStream(const std::string& name,
AntlrInputStream*
AntlrInputStream::newStreamInputStream(std::istream& input,
const std::string& name)
- throw (InputStreamException) {
+ throw (InputStreamException, AssertionException) {
// Since these are all NULL on entry, realloc will be called
char *basep = NULL, *boundp = NULL, *cp = NULL;
@@ -126,7 +126,7 @@ AntlrInputStream::newStreamInputStream(std::istream& input,
AntlrInputStream*
AntlrInputStream::newStringInputStream(const std::string& input,
const std::string& name)
- throw (InputStreamException) {
+ throw (InputStreamException, AssertionException) {
char* inputStr = strdup(input.c_str());
char* nameStr = strdup(name.c_str());
AlwaysAssert( inputStr!=NULL && nameStr!=NULL );
@@ -159,6 +159,7 @@ AntlrInput* AntlrInput::newInput(InputLanguage lang, AntlrInputStream& inputStre
default:
Unhandled(lang);
}
+
return input;
}
@@ -225,7 +226,7 @@ void AntlrInput::lexerError(pANTLR3_BASE_RECOGNIZER recognizer) {
}
void AntlrInput::parseError(const std::string& message)
- throw (ParserException) {
+ throw (ParserException, AssertionException) {
Debug("parser") << "Throwing exception: "
<< getInputStream()->getName() << ":"
<< d_lexer->getLine(d_lexer) << "."
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback