public override void RuleRef(GrammarAST @ref, ActionAST arg)
{
RuleAST ruleAST;
ruleToAST.TryGetValue(@ref.Text, out ruleAST);
string fileName = @ref.Token.InputStream.SourceName;
if (char.IsUpper(currentRuleName[0]) &&
char.IsLower(@ref.Text[0]))
{
badref = true;
tool.errMgr.GrammarError(ErrorType.PARSER_RULE_REF_IN_LEXER_RULE,
fileName, @ref.Token, @ref.Text, currentRuleName);
}
else if (ruleAST == null)
{
badref = true;
tool.errMgr.GrammarError(ErrorType.UNDEFINED_RULE_REF,
fileName, @ref.Token, @ref.Text);
}
}