public override LeadingChars EvaluateLeadingSymbols() { var chars = new LeadingChars(false, Enumerable.Empty <char>()); foreach (var rule in Rules) { chars = chars.Union(rule.EvaluateLeadingSymbols()); } return(chars); }
public override LeadingChars EvaluateLeadingSymbols() { var chars = new LeadingChars(false, Enumerable.Empty <char>()); var index = 0; while (index < Rules.Length) { chars = chars.Union(Rules[index].EvaluateLeadingSymbols()); if (Rules[index].Type != RuleType.Optional) { break; } ++index; } return(chars); }