Exemple #1
0
        public override bool checkValue(Contexte contexte)
        {
            int lastRelationId = rightSymbole.getMatchRelation <RightOr>(contexte.getLastComponent().symbole);

            if (lastRelationId >= 0)
            {
                contexte.addContextComponent(new ContexteComponent(rightSymbole.getStringSymbole(), lastRelationId));
            }
            bool left = leftObject.checkValue(contexte);
            bool or;

            try {
                or = rightSymbole.checkValue(contexte);
            }
            catch (UndefinedValueException) {
                or = false;
            }
            if (or)
            {
                throw new UndefinedValueException();
            }
            if (!left)
            {
                return(false);
            }
            return(true);
        }
Exemple #2
0
        public override bool checkValue(Contexte contexte)
        {
            int lastRelationId = rightSymbole.getMatchRelation <RightXor>(contexte.getLastComponent().symbole);

            if (lastRelationId >= 0)
            {
                contexte.addContextComponent(new ContexteComponent(rightSymbole.getStringSymbole(), lastRelationId));
            }
            bool left = leftObject.checkValue(contexte);
            bool xor;

            try {
                xor = rightSymbole.checkValue(contexte);
            }
            catch (UndefinedValueException) {
                xor = false;
            }

            return(left != xor);
        }