Ejemplo n.º 1
0
        /// Implements <NumLiteralList> ::= <NumLiteral>
        public Reduction CreateRULE_NUMLITERALLIST(Reduction reduction)
        {
            if (NCacheLog.IsInfoEnabled)
            {
                NCacheLog.Info("CreateRULE_NUMLITERALLIST");
            }
            IsInListPredicate pred = new IsInListPredicate();

            pred.Append(((Reduction)reduction.GetToken(0).Data).Tag);
            reduction.Tag = pred;
            return(null);
        }
Ejemplo n.º 2
0
        /// Implements <CompareExpr> ::= <Value> IN <InList>
        public Reduction CreateRULE_COMPAREEXPR_IN(Reduction reduction)
        {
            object            lhs  = ((Reduction)((Token)reduction.GetToken(0)).Data).Tag;
            IsInListPredicate pred = ((Reduction)((Token)reduction.GetToken(2)).Data).Tag as IsInListPredicate;

            pred.Functor  = lhs as IFunctor;
            reduction.Tag = pred;
            if (NCacheLog.IsInfoEnabled)
            {
                NCacheLog.Info("CreateRULE_COMPAREEXPR_IN");
            }
            return(null);
        }
Ejemplo n.º 3
0
        //========================


        public Reduction CreateInclusionList(Reduction reduction)
        {
            object            tag = ((Reduction)reduction.GetToken(2).Data).Tag;
            IsInListPredicate inc = null;

            if (tag is IsInListPredicate)
            {
                inc = tag as IsInListPredicate;
            }
            else
            {
                inc = new IsInListPredicate();
                inc.Append(tag);
            }
            inc.Append(((Reduction)reduction.GetToken(0).Data).Tag);
            reduction.Tag = inc;
            return(null);
        }
Ejemplo n.º 4
0
        /// Implements <InList> ::= '(' <ListType> ')'
        public Reduction CreateRULE_INLIST_LPARAN_RPARAN(Reduction reduction)
        {
            if (NCacheLog.IsInfoEnabled)
            {
                NCacheLog.Info("CreateRULE_INLIST_LPARAN_RPARAN");
            }
            object obj = ((Reduction)((Token)reduction.GetToken(1)).Data).Tag;

            if (obj is ConstantValue || obj is RuntimeValue)
            {
                IsInListPredicate pred = new IsInListPredicate();
                pred.Append(obj);
                reduction.Tag = pred;
            }
            else
            {
                reduction.Tag = ((Reduction)((Token)reduction.GetToken(1)).Data).Tag;
            }

            return(null);
        }