예제 #1
0
        public static BindingScope ForRootClassInstanceMethod()
        {
            BindingScope result = ReservedScope.CreateBindings();

            result.DefineBinding(new SpecialBinding(SemanticConstants.Self, client => client.SelfExpression, false));
            result.DefineBinding(new ErrorBinding(SemanticConstants.Super));   // Erroneous if instance method and no superclass.
            return(result);
        }
예제 #2
0
        public static BindingScope ForClassInitializer()
        {
            BindingScope result = ReservedScope.CreateBindings();

            result.DefineBinding(new ArgumentBinding(SemanticConstants.Self));
            result.DefineBinding(new ErrorBinding(SemanticConstants.Super));   // Within any type of initializer super has the error binding.
            return(result);
        }
예제 #3
0
        public static BindingScope ForClassMethod()
        {
            BindingScope result = ReservedScope.CreateBindings();

            result.DefineBinding(new SpecialBinding(SemanticConstants.Self, client => client.SelfExpression, false));
            result.DefineBinding(new SpecialBinding(SemanticConstants.Super, client => client.SelfExpression, false));
            return(result);
        }
예제 #4
0
        public static BindingScope ForGlobalInitializer()
        {
            BindingScope result = ReservedScope.CreateBindings();

            result.DefineBinding(new ErrorBinding(SemanticConstants.Self));    // error binding unless <<class initializer>>.
            result.DefineBinding(new ErrorBinding(SemanticConstants.Super));   // Within any type of initializer super has the error binding.
            return(result);
        }