Esempio n. 1
0
        static ConstantValue CreateConstant(AST.GlobalConstUse expr)
        {
            if (expr.Name == QualifiedName.Null)
            {
                return(ConstantValue.Null);
            }
            if (expr.Name == QualifiedName.True)
            {
                return(ConstantValue.True);
            }
            if (expr.Name == QualifiedName.False)
            {
                return(ConstantValue.False);
            }

            return(null);
        }
Esempio n. 2
0
        BoundExpression BindGlobalConstUse(AST.GlobalConstUse expr)
        {
            // translate built-in constants directly
            if (expr.Name == QualifiedName.True)
            {
                return(new BoundLiteral(true));
            }
            if (expr.Name == QualifiedName.False)
            {
                return(new BoundLiteral(false));
            }
            if (expr.Name == QualifiedName.Null)
            {
                return(new BoundLiteral(null));
            }

            // bind constant
            return(new BoundGlobalConst(expr.Name.ToString()));
        }
Esempio n. 3
0
 virtual public void VisitGlobalConstUse(GlobalConstUse x)
 {
     VisitConstantUse(x);
 }