예제 #1
0
        public override ValueExpression Evaluate(IParserContext context)
        {
            ClassName className = _typeExpression.Evaluate(context).Value as ClassName;

            if (className == null)
            {
                throw new ExpressionEvaluationException("type cast requires a type. " + _typeExpression + " is not a type", this);
            }

            return(Exp.Value(TokenPosition, Convert.ChangeType(_targetExpression.Evaluate(context).Value, className.Type, null), className.Type));
        }
예제 #2
0
        public override ValueExpression Evaluate(IParserContext context)
        {
            ClassName className = ClassName.Evaluate(context).Value as ClassName;

            if (className == null)
            {
                throw new TypeInitializationException(ClassName.VarName, null);
            }

            return(Exp.Value(TokenPosition, className.Type.Inspector().GetConstructors()));
        }
예제 #3
0
 private static Type GetTypeOfClassName(ClassName className)
 {
     return className.Type;
 }
예제 #4
0
 private static Type GetTypeOfClassName(ClassName className)
 {
     return(className.Type);
 }