private static SymbolBase GetMatcherOutcomeSymbol( Grammar grammar, ICilSymbolResolver symbolResolver, CilSymbolRef mainOutcome, IEnumerable <CilSymbolRef> allOutcomes) { Symbol main = symbolResolver.GetSymbol(mainOutcome); Symbol[] all = (from outcome in allOutcomes select symbolResolver.GetSymbol(outcome)) .ToArray(); switch (all.Length) { case 0: return(null); case 1: return(main); default: return(new AmbiguousSymbol(main, all)); } }
private static SymbolBase GetMatcherOutcomeSymbol( Grammar grammar, ICilSymbolResolver symbolResolver, CilSymbolRef mainOutcome, IEnumerable<CilSymbolRef> allOutcomes) { Symbol main = symbolResolver.GetSymbol(mainOutcome); Symbol[] all = (from outcome in allOutcomes select symbolResolver.GetSymbol(outcome)) .ToArray(); switch (all.Length) { case 0: return null; case 1: return main; default: return new AmbiguousSymbol(main, all); } }