public override bool Visit(AstMulExpression node)
 {
     ErrorIfIsNull(node.Left);
     ErrorIfIsNull(node.Right);
     return true;
 }
 public override bool Visit(AstMulExpression node)
 {
     return true;
 }
Пример #3
0
        // #MUL_EXPRESSION #UNARY_EXPRESSION MULTIPLICATION #TERM
        private void ConstructMulExpr()
        {
            var right = nodes.Pop() as AstExpression;
            var left = nodes.Pop() as AstUnaryExpr;

            var mulExpr = new AstMulExpression(left, right);
            PushNode(mulExpr);
        }
Пример #4
0
 public override bool Visit(AstMulExpression node)
 {
     node.Left.Accept(this);
     string addLine = " = mul i32 " + GetCurrUnnamedVariable() + ", ";
     node.Right.Accept(this);
     addLine += GetCurrUnnamedVariable();
     codeStream.WriteLine(CreateUnnamedVariable() + addLine);
     SaveArg("i32 " + GetCurrUnnamedVariable());
     return false;
 }
Пример #5
0
        public override bool Visit(AstMulExpression node)
        {
            var leftType = resolver.Resolve(node.Left);
            var rightType = resolver.Resolve(node.Right);
            if (leftType != BuiltInTypes.INT || rightType != BuiltInTypes.INT)
            {
                DispatchError(node.TextPosition, "Multiplication operation available only for integer types.");
                return false;
            }

            return true;
        }
Пример #6
0
 public abstract bool Visit(AstMulExpression node);