internal static MatchContext Match(MethodBase method, ILPattern pattern) { if (method == null) throw new ArgumentNullException("method"); if (pattern == null) throw new ArgumentNullException("pattern"); var instructions = (IList<Instruction>) MethodBodyReader.GetInstructions(method).AsReadOnly(); if (instructions.Count == 0) throw new ArgumentException(); var context = new MatchContext(instructions[0]); pattern.Match(context); return context; }
internal static MatchContext Match(MethodBase method, ILPattern pattern) { if (method == null) { throw new ArgumentNullException("method"); } if (pattern == null) { throw new ArgumentNullException("pattern"); } var instructions = (IList <Instruction>)MethodBodyReader.GetInstructions(method).AsReadOnly(); if (instructions.Count == 0) { throw new ArgumentException(); } var context = new MatchContext(instructions[0]); pattern.Match(context); return(context); }
private static ILPattern Optional(ILPattern pattern) { return new OptionalPattern(pattern); }
internal SequencePattern(ILPattern[] patterns) { _patterns = patterns; }
internal OptionalPattern(ILPattern optional) { _pattern = optional; }
private static ILPattern Optional(ILPattern pattern) { return(new OptionalPattern(pattern)); }