예제 #1
0
        public Expression Visit(ParserPair pair)
        {
            Expression left  = pair.Left.Accept(this);
            Expression right = pair.Right.Accept(this);

            // this might cause problems later
            return(new PairExpression <Expression, Expression>(left, right));
        }
예제 #2
0
        public ParserType Visit(ParserPair pair)
        {
            var        leftType  = pair.Left.Accept(this);
            var        rightType = pair.Right.Accept(this);
            ParserType prodType  = new ParserProdType(leftType, rightType);

            pair.Type = prodType;
            return(prodType);
        }