Esempio n. 1
0
        public override Func <IUser, bool> VisitEwCompare(BoolExprParser.EwCompareContext context)
        {
            var attrVal = context.children.Last().GetText().Trim('"');

            var(attrType, attrName) = GetAttributeInfo(context.children.First());

            return(user =>
                   attrType == "profile"
                    ? user.Profile[attrName] != null && user.Profile[attrName].ToString().EndsWith(attrVal)
                    : user.GetNonProfileAttribute(attrName).EndsWith(attrVal));
        }
 /// <summary>
 /// Visit a parse tree produced by the <c>ewCompare</c>
 /// labeled alternative in <see cref="BoolExprParser.attr_comp"/>.
 /// <para>
 /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/>
 /// on <paramref name="context"/>.
 /// </para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 /// <return>The visitor result.</return>
 public virtual Result VisitEwCompare([NotNull] BoolExprParser.EwCompareContext context)
 {
     return(VisitChildren(context));
 }