diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | bd9e6617827818fd043452c08c606f07b78014a0 (patch) | |
tree | 425bb4c3168f9c02f10150f235d2cb998dcc6108 /poxml/antlr/src/LexerSharedInputState.cpp | |
download | tdesdk-bd9e6617827818fd043452c08c606f07b78014a0.tar.gz tdesdk-bd9e6617827818fd043452c08c606f07b78014a0.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'poxml/antlr/src/LexerSharedInputState.cpp')
-rw-r--r-- | poxml/antlr/src/LexerSharedInputState.cpp | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/poxml/antlr/src/LexerSharedInputState.cpp b/poxml/antlr/src/LexerSharedInputState.cpp new file mode 100644 index 00000000..a95f33a8 --- /dev/null +++ b/poxml/antlr/src/LexerSharedInputState.cpp @@ -0,0 +1,55 @@ +#include "antlr/LexerSharedInputState.hpp" +#include "antlr/CharBuffer.hpp" + +ANTLR_BEGIN_NAMESPACE(antlr) + +/** This object contains the data associated with an + * input stream of characters. Multiple lexers + * share a single LexerSharedInputState to lex + * the same input stream. + */ + +LexerInputState::LexerInputState(InputBuffer* inbuf) +: column(1) +, line(1) +, tokenStartColumn(1) +, tokenStartLine(1) +, guessing(0) +, filename("") +, input(inbuf) +, inputResponsible(true) +{ +} + +LexerInputState::LexerInputState(InputBuffer& inbuf) +: column(1) +, line(1) +, tokenStartColumn(1) +, tokenStartLine(1) +, guessing(0) +, filename("") +, input(&inbuf) +, inputResponsible(false) +{ +} + +LexerInputState::LexerInputState(ANTLR_USE_NAMESPACE(std)istream& in) +: column(1) +, line(1) +, tokenStartColumn(1) +, tokenStartLine(1) +, guessing(0) +, filename("") +, input(new CharBuffer(in)) +, inputResponsible(true) +{ +} + +LexerInputState::~LexerInputState() +{ + if (inputResponsible) + delete input; +} + +ANTLR_END_NAMESPACE + |