Ejemplo n.º 1
0
        public override string VisitPhraseExpression(SearchGrammarParser.PhraseExpressionContext context)
        {
            this.stringBuilder.AppendLine(new string(' ', this.currentDepth) + "PhraseExpression");
            this.currentDepth += 2;

            var result = base.VisitPhraseExpression(context);

            this.currentDepth -= 2;

            return(result);
        }
        public override GrammarResult VisitPhraseExpression(SearchGrammarParser.PhraseExpressionContext context)
        {
            this.trackTerms = false;
            base.VisitPhraseExpression(context);
            this.trackTerms = true;

            string searchTerm = string.Join(
                string.Empty,
                context.children
                .Skip(1)
                .Take(context.ChildCount - 2)
                .Select(c => c.GetText()));

            var expression = this.CreateTextExpression(searchTerm);

            return(new GrammarResult(expression, this.terms));
        }