Пример #1
0
        private TypeDesc Expression(HashSet <SymbolEnum> followers)
        {
            var firstOperandType = NeutralizerDecoratorWithReturn(SimpleExpression, Starters.SimpleExpression, Followers.SimpleExpression, 6, followers);

            if (IsComparisonOperator(CurrentSymbol))
            {
                NextSymbol();
                var secondOperandType = NeutralizerDecoratorWithReturn(SimpleExpression, Starters.SimpleExpression, Followers.SimpleExpression, 6, followers);
                if (!TypeValidator.AreTypesComparisonCompatible(firstOperandType, secondOperandType))
                {
                    Error(186);
                }

                return(TypeDesc.booleanType);
            }

            return(firstOperandType);
        }