summaryrefslogtreecommitdiff
path: root/src/parser
diff options
context:
space:
mode:
authorChristopher L. Conway <christopherleeconway@gmail.com>2010-05-03 21:25:47 +0000
committerChristopher L. Conway <christopherleeconway@gmail.com>2010-05-03 21:25:47 +0000
commit2673b70e8d31d42b4e2b7ec7d2edd3f28b1dac14 (patch)
tree3353f507db215b68d759327589f8c377cc70471f /src/parser
parent09b5745fa1a2fcdc6b8d0a0d31c1ba34c96d67f0 (diff)
Small mistake in previous commit
Diffstat (limited to 'src/parser')
-rw-r--r--src/parser/antlr_input.cpp2
-rw-r--r--src/parser/antlr_input.h17
-rw-r--r--src/parser/antlr_input_imports.cpp2
3 files changed, 10 insertions, 11 deletions
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;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback