Пример #1
0
        //
        public override void Resolve()
        {
            base.Resolve();
            if (Subject != null) //For property expressions. Hmmm...
            {
                Subject.Resolve();
            }
            Predicate.Resolve();
            Object.Resolve();
            //
            PredicateDef predDef = Predicate.ToPredicate();

            if (predDef != null)
            {
                Object.Type = predDef.Spec;
            }

            if (AtomTypeExpr == null)
            {
                AtomTypeExpr = new Name(predDef.ClauseType);
            }

            foreach (var propExpr in PropertyExprs)
            {
                propExpr.Resolve();
            }
        }
Пример #2
0
        public PredicateDef InternPredicateDef(Token token)
        {
            string    key = token.ToString();
            EntityDef entityDef;

            if (!EntityDictionary.TryGetValue(key, out entityDef))
            {
                entityDef = new PredicateDef(token);
                EntityDictionary.Add(key, entityDef);
            }
            PredicateDef predicateDef = entityDef as PredicateDef;

            if (predicateDef == null)
            {
                throw new Exception();
            }

            return(predicateDef);
        }