You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
659 B
38 lines
659 B
#include "antlr/ParserSharedInputState.h"
|
|
|
|
ANTLR_BEGIN_NAMESPACE(antlr)
|
|
|
|
/** 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;
|
|
}
|
|
|
|
ANTLR_END_NAMESPACE
|
|
|