1 #include "antlr/ParserSharedInputState.hpp"
2 
ANTLR_BEGIN_NAMESPACE(xparam_antlr)3 ANTLR_BEGIN_NAMESPACE(xparam_antlr)
4 
5 /** This object contains the data associated with an
6  *  input stream of tokens.  Multiple parsers
7  *  share a single ParserSharedInputState to parse
8  *  the same stream of tokens.
9  */
10 
11 ParserInputState::ParserInputState(TokenBuffer* input_)
12 : guessing(0)
13 , input(input_)
14 , inputResponsible(true)
15 {
16 }
17 
ParserInputState(TokenBuffer & input_)18 ParserInputState::ParserInputState(TokenBuffer& input_)
19 : guessing(0)
20 , input(&input_)
21 , inputResponsible(false)
22 {
23 }
24 
~ParserInputState()25 ParserInputState::~ParserInputState()
26 {
27 	if (inputResponsible)
28 		delete input;
29 }
30 
getInput()31 TokenBuffer& ParserInputState::getInput()
32 {
33 	return *input;
34 }
35 
36 ANTLR_END_NAMESPACE
37 
38