protected virtual bool CheckRange(GrammarAST leftNode, GrammarAST rightNode, int leftValue, int rightValue)
{
bool result = true;
if (leftValue == -1)
{
result = false;
g.tool.errMgr.GrammarError(ErrorType.INVALID_LITERAL_IN_LEXER_SET,
g.fileName, leftNode.Token, leftNode.Text);
}
if (rightValue == -1)
{
result = false;
g.tool.errMgr.GrammarError(ErrorType.INVALID_LITERAL_IN_LEXER_SET,
g.fileName, rightNode.Token, rightNode.Text);
}
if (!result)
return result;
if (rightValue < leftValue)
{
g.tool.errMgr.GrammarError(ErrorType.EMPTY_STRINGS_AND_SETS_NOT_ALLOWED,
g.fileName, ((GrammarAST)leftNode.Parent).Token, leftNode.Text + ".." + rightNode.Text);
}
return result;
}