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