ANTLR Support Libraries 2.7.1+
Loading...
Searching...
No Matches
ParserSharedInputState.hpp
Go to the documentation of this file.
1#ifndef INC_ParserSharedInputState_hpp__
2#define INC_ParserSharedInputState_hpp__
3
4/* ANTLR Translator Generator
5 * Project led by Terence Parr at http://www.jGuru.com
6 * Software rights: http://www.antlr.org/license.html
7 *
8 * $Id: //depot/code/org.antlr/release/antlr-2.7.7/lib/cpp/antlr/ParserSharedInputState.hpp#2 $
9 */
10
11#include <antlr/config.hpp>
12#include <antlr/TokenBuffer.hpp>
13#include <antlr/RefCount.hpp>
14#include <string>
15
16#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
17namespace antlr {
18#endif
19
26public:
32 : guessing(0)
33 , filename()
34 , input(in)
35 , inputResponsible(true)
36 {
37 }
42 : guessing(0)
43 , filename("")
44 , input(&in)
45 , inputResponsible(false)
46 {
47 }
48
50 {
51 if (inputResponsible)
52 delete input;
53 }
54
56 {
57 return *input;
58 }
59
61 void reset( void )
62 {
63 input->reset();
64 guessing = 0;
65 }
66
67public:
74private:
79
80 // we don't want these:
83};
84
87
88#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
89}
90#endif
91
92#endif //INC_ParserSharedInputState_hpp__
RefCount< ParserInputState > ParserSharedInputState
A reference counted ParserInputState.
Definition ParserSharedInputState.hpp:86
Definition ParserSharedInputState.hpp:25
ParserInputState(const ParserInputState &)
void reset(void)
Reset the ParserInputState and the underlying TokenBuffer.
Definition ParserSharedInputState.hpp:61
TokenBuffer * input
Definition ParserSharedInputState.hpp:76
int guessing
Definition ParserSharedInputState.hpp:69
std::string filename
Definition ParserSharedInputState.hpp:73
TokenBuffer & getInput(void)
Definition ParserSharedInputState.hpp:55
ParserInputState(TokenBuffer *in)
Definition ParserSharedInputState.hpp:31
bool inputResponsible
Do we need to free the TokenBuffer or is it owned by another..
Definition ParserSharedInputState.hpp:78
virtual ~ParserInputState()
Definition ParserSharedInputState.hpp:49
ParserInputState(TokenBuffer &in)
Definition ParserSharedInputState.hpp:41
ParserInputState & operator=(const ParserInputState &)
Definition RefCount.hpp:17
Definition TokenBuffer.hpp:36
#define ANTLR_USE_NAMESPACE(_x_)
Definition config.hpp:18
#define ANTLR_API
Definition config.hpp:22
Definition ANTLRException.hpp:15