lexersharedinputstate.cpp

来自「SRI international 发布的OAA框架软件」· C++ 代码 · 共 56 行

CPP
56
字号
#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

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?