From: Christopher L. Conway Date: Mon, 3 May 2010 21:25:47 +0000 (+0000) Subject: Small mistake in previous commit X-Git-Tag: cvc5-1.0.0~9088 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2673b70e8d31d42b4e2b7ec7d2edd3f28b1dac14;p=cvc5.git Small mistake in previous commit --- diff --git a/src/parser/antlr_input.cpp b/src/parser/antlr_input.cpp index b6f10ab25..5a34354e8 100644 --- a/src/parser/antlr_input.cpp +++ b/src/parser/antlr_input.cpp @@ -198,7 +198,7 @@ void AntlrInput::setAntlr3Lexer(pANTLR3_LEXER pLexer) { // Override default lexer error reporting d_lexer->rec->reportError = &lexerError; // Override default nextToken function, just to prevent exceptions escaping. - d_lexer->rec->state->tokSource->nextToken = &nextToken; + d_lexer->rec->state->tokSource->nextToken = &nextTokenStr; } void AntlrInput::setParser(Parser *parser) { diff --git a/src/parser/antlr_input.h b/src/parser/antlr_input.h index 244735e9b..d6d01b3cd 100644 --- a/src/parser/antlr_input.h +++ b/src/parser/antlr_input.h @@ -137,13 +137,13 @@ public: static AntlrInput* newInput(InputLanguage lang, AntlrInputStream *inputStream); /** Retrieve the text associated with a token. */ - inline static std::string tokenText(pANTLR3_COMMON_TOKEN token); + static std::string tokenText(pANTLR3_COMMON_TOKEN token); /** Retrieve an unsigned from the text of a token */ - inline static unsigned tokenToUnsigned( pANTLR3_COMMON_TOKEN token ); + static unsigned tokenToUnsigned( pANTLR3_COMMON_TOKEN token ); /** Retrieve an Integer from the text of a token */ - inline static Integer tokenToInteger( pANTLR3_COMMON_TOKEN token ); + static Integer tokenToInteger( pANTLR3_COMMON_TOKEN token ); /** Retrieve a Rational from the text of a token */ - inline static Rational tokenToRational(pANTLR3_COMMON_TOKEN token); + static Rational tokenToRational(pANTLR3_COMMON_TOKEN token); protected: /** Create an input. This input takes ownership of the given input stream, @@ -174,7 +174,7 @@ protected: void setParser(Parser *parser); }; -std::string AntlrInput::tokenText(pANTLR3_COMMON_TOKEN token) { +inline std::string AntlrInput::tokenText(pANTLR3_COMMON_TOKEN token) { ANTLR3_MARKER start = token->getStartIndex(token); ANTLR3_MARKER end = token->getStopIndex(token); /* start and end are boundary pointers. The text is a string @@ -186,7 +186,7 @@ std::string AntlrInput::tokenText(pANTLR3_COMMON_TOKEN token) { return txt; } -unsigned AntlrInput::tokenToUnsigned(pANTLR3_COMMON_TOKEN token) { +inline unsigned AntlrInput::tokenToUnsigned(pANTLR3_COMMON_TOKEN token) { unsigned result; std::stringstream ss; ss << tokenText(token); @@ -194,13 +194,12 @@ unsigned AntlrInput::tokenToUnsigned(pANTLR3_COMMON_TOKEN token) { return result; } - -Integer AntlrInput::tokenToInteger(pANTLR3_COMMON_TOKEN token) { +inline Integer AntlrInput::tokenToInteger(pANTLR3_COMMON_TOKEN token) { Integer i( tokenText(token) ); return i; } -Rational AntlrInput::tokenToRational(pANTLR3_COMMON_TOKEN token) { +inline Rational AntlrInput::tokenToRational(pANTLR3_COMMON_TOKEN token) { Rational r( tokenText(token) ); return r; } diff --git a/src/parser/antlr_input_imports.cpp b/src/parser/antlr_input_imports.cpp index 9e16d795a..7c879f5bc 100644 --- a/src/parser/antlr_input_imports.cpp +++ b/src/parser/antlr_input_imports.cpp @@ -262,7 +262,7 @@ void AntlrInput::reportError(pANTLR3_BASE_RECOGNIZER recognizer) { * This is copied, largely unmodified, from antlr3lexer.c * */ -inline pANTLR3_COMMON_TOKEN +pANTLR3_COMMON_TOKEN AntlrInput::nextTokenStr (pANTLR3_TOKEN_SOURCE toksource) { pANTLR3_LEXER lexer;