text: public virtual ParseTreePattern Compile(string pattern, int patternRuleIndex){IList<IToken> tokenList = Tokenize(pattern);ListTokenSource tokenSrc = new ListTokenSource(tokenList);CommonTokenStream tokens = new CommonTokenStream(tokenSrc);ParserInterpreter parserInterp = new ParserInterpreter(parser.GrammarFileName, parser.Vocabulary, Arrays.AsList(parser.RuleNames), parser.GetATNWithBypassAlts(), tokens);IParseTree tree = null;try{parserInterp.ErrorHandler = new BailErrorStrategy();tree = parserInterp.Parse(patternRuleIndex);}catch (ParseCanceledException e){throw (RecognitionException)e.InnerException;}catch (RecognitionException){throw;}catch (Exception e){throw new ParseTreePatternMatcher.CannotInvokeStartRule(e);}if (tokens.LA(1) != TokenConstants.EOF){throw new ParseTreePatternMatcher.StartRuleDoesNotConsumeFullPattern();}return new ParseTreePattern(this, pattern, patternRuleIndex, tree);}