EvalNode that represents a binary conditional logical operation.
Inheritance: EvalNode
Example #1
0
        /// <summary>
        /// Parse the 'condOr2' rule.
        /// </summary>
        /// <remarks>
        ///
        /// condOr2 ::= '||' condAnd condOr2 |
        ///             {empty}
        ///
        /// </remarks>
        /// <returns>Parsed node.</returns>
        protected virtual EvalNode ParseCondOr2()
        {
            if (Tokeniser.Next(TokenType.DoubleOr))
            {
                EvalNode op = new EvalNodeCondLogicOp(EvalNodeCondLogicOp.CompareOp.Or, ParseCondAnd(), Language);
                EvalNode or2 = ParseCondOr2();
                if (or2 != null)
                    or2.Prepend(op);
                return op;
            }

            return null;
        }
Example #2
0
        /// <summary>
        /// Parse the 'logicalOr2VB' rule.
        /// </summary>
        /// <remarks>
        ///
        /// logicalOr2VB ::= 'Or' logicalAndVB logicalOr2VB |
        ///                  'OrElse' logicalAndVB logicalOr2VB |
        ///                  {empty}
        ///
        /// </remarks>
        /// <returns>Parsed node.</returns>
        protected virtual EvalNode ParseLogicalOr2VB()
        {
            if (Tokeniser.Next(TokenType.KeywordOr))
            {
                EvalNode op = new EvalNodeBinaryOp(EvalNodeBinaryOp.BinaryOp.LogicalOr, ParseLogicalAndVB(), Language);
                EvalNode or2 = ParseLogicalOr2VB();
                if (or2 != null)
                    or2.Prepend(op);
                return op;
            }

            if (Tokeniser.Next(TokenType.KeywordOrElse))
            {
                EvalNode op = new EvalNodeCondLogicOp(EvalNodeCondLogicOp.CompareOp.Or, ParseLogicalAndVB(), Language);
                EvalNode or2 = ParseLogicalOr2VB();
                if (or2 != null)
                    or2.Prepend(op);
                return op;
            }

            return null;
        }
Example #3
0
        /// <summary>
        /// Parse the 'condAnd2' rule.
        /// </summary>
        /// <remarks>
        ///
        /// condAnd2 ::= '&amp;&amp;' logicalOr condAnd2 |
        ///              {empty}
        ///
        /// </remarks>
        /// <returns>Parsed node.</returns>
        protected virtual EvalNode ParseCondAnd2()
        {
            if (Tokeniser.Next(TokenType.DoubleAnd))
            {
                EvalNode op = new EvalNodeCondLogicOp(EvalNodeCondLogicOp.CompareOp.And, ParseLogicalOr(), Language);
                EvalNode and2 = ParseCondAnd2();
                if (and2 != null)
                    and2.Prepend(op);
                return op;
            }

            return null;
        }
Example #4
0
        /// <summary>
        /// Parse the 'logicalAnd2VB' rule.
        /// </summary>
        /// <remarks>
        ///
        /// logicalAnd2VB ::= 'And' logicalNotVB logicalAnd2VB |
        ///                   'AndAlso' logicalNotVB logicalAnd2VB |
        ///                   {empty}
        ///
        /// </remarks>
        /// <returns>Parsed node.</returns>
        protected virtual EvalNode ParseLogicalAnd2VB()
        {
            if (Tokeniser.Next(TokenType.KeywordAnd))
            {
                EvalNode op = new EvalNodeBinaryOp(EvalNodeBinaryOp.BinaryOp.LogicalAnd, ParseLogicalNotVB(), Language);
                EvalNode and2 = ParseLogicalAnd2VB();
                if (and2 != null)
                    and2.Prepend(op);
                return op;
            }

            if (Tokeniser.Next(TokenType.KeywordAndAlso))
            {
                EvalNode op = new EvalNodeCondLogicOp(EvalNodeCondLogicOp.CompareOp.And, ParseLogicalNotVB(), Language);
                EvalNode and2 = ParseLogicalAnd2VB();
                if (and2 != null)
                    and2.Prepend(op);
                return op;
            }

            return null;
        }