예제 #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);
        }
예제 #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()));
        }
예제 #3
0
 virtual public void VisitGlobalConstUse(GlobalConstUse x)
 {
     VisitConstantUse(x);
 }