public override void ExitRangeFilter(Antlr.SearchPhraseParser.RangeFilterContext context)
        {
            base.ExitRangeFilter(context);

            var fieldNameContext  = context.GetChild <Antlr.SearchPhraseParser.FieldNameContext>(0);
            var rangeValueContext = context.GetChild <Antlr.SearchPhraseParser.RangeFilterValueContext>(0);

            if (fieldNameContext != null && rangeValueContext != null)
            {
                var values = rangeValueContext.children
                             .OfType <Antlr.SearchPhraseParser.RangeContext>()
                             .Select(GetRangeFilterValue)
                             .ToArray();

                var filter = new RangeFilter
                {
                    FieldName = Unescape(fieldNameContext.GetText()),
                    Values    = values,
                };

                Filters.Add(filter);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Exit a parse tree produced by <see cref="SearchPhraseParser.rangeFilter"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void ExitRangeFilter([NotNull] SearchPhraseParser.RangeFilterContext context)
 {
 }