diff options
author | Dejan Jovanović <dejan.jovanovic@gmail.com> | 2010-05-02 02:20:17 +0000 |
---|---|---|
committer | Dejan Jovanović <dejan.jovanovic@gmail.com> | 2010-05-02 02:20:17 +0000 |
commit | 1c5ad02344b9041cab9dd275ae69c953c31c6b8d (patch) | |
tree | 1ab700dbbe5264f1685e2cee7f51392285a782b6 /src/parser/antlr_input.h | |
parent | 2da7b55f1a85cfc3fc2bc6abad16453c59d8c227 (diff) |
smt parser for bit-vectors
Diffstat (limited to 'src/parser/antlr_input.h')
-rw-r--r-- | src/parser/antlr_input.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/parser/antlr_input.h b/src/parser/antlr_input.h index 1d6f5f790..441d2a0b3 100644 --- a/src/parser/antlr_input.h +++ b/src/parser/antlr_input.h @@ -134,6 +134,8 @@ public: /** Retrieve the text associated with a token. */ inline 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 ); /** Retrieve an Integer from the text of a token */ inline static Integer tokenToInteger( pANTLR3_COMMON_TOKEN token ); /** Retrieve a Rational from the text of a token */ @@ -180,6 +182,15 @@ std::string AntlrInput::tokenText(pANTLR3_COMMON_TOKEN token) { return txt; } +unsigned AntlrInput::tokenToUnsigned(pANTLR3_COMMON_TOKEN token) { + unsigned result; + std::stringstream ss; + ss << tokenText(token); + ss >> result; + return result; +} + + Integer AntlrInput::tokenToInteger(pANTLR3_COMMON_TOKEN token) { Integer i( tokenText(token) ); return i; |