public override bool Visit(AstOrExpression node)
 {
     ErrorIfIsNull(node.Left);
     ErrorIfIsNull(node.Right);
     return true;
 }
 public override bool Visit(AstOrExpression node)
 {
     return true;
 }
Beispiel #3
0
 // #OR_TEST #AND_TEST OR #OR_TEST
 private void ConstructOrCompoundTest()
 {
     var right = nodes.Pop() as AstExpression;
     var left = nodes.Pop() as AstExpression;
     var orExpr = new AstOrExpression(left, right);
     PushNode(orExpr);
 }
 public override bool Visit(AstOrExpression node)
 {
     node.Left.Accept(this);
     string addLine = " = or i1 " + GetCurrUnnamedVariable() + ", ";
     node.Right.Accept(this);
     addLine += GetCurrUnnamedVariable();
     codeStream.WriteLine(CreateUnnamedVariable() + addLine);
     SaveArg("i1 " + GetCurrUnnamedVariable());
     return false;
 }
        public override bool Visit(AstOrExpression node)
        {
            var leftType = resolver.Resolve(node.Left);
            var rightType = resolver.Resolve(node.Right);
            if (leftType != BuiltInTypes.BOOL || rightType != BuiltInTypes.BOOL)
            {
                DispatchError(node.TextPosition, "Boolean operations available only for bool types.");
                return false;
            }

            return true;
        }
 public abstract bool Visit(AstOrExpression node);