Ejemplo n.º 1
0
 internal IntegerList GetSupportedInterfaceListIds()
 {
     IntegerList list = new IntegerList(false);
     for (int i = 0; i < this.AncestorIds.Count; i++) {
         int id = this.AncestorIds[i];
         ClassObject val = (ClassObject)base.Scripter.GetVal(id);
         if (val.Class_Kind == ClassKind.Interface) {
             list.Add(id);
             IntegerList supportedInterfaceListIds = val.GetSupportedInterfaceListIds();
             list.AddFrom(supportedInterfaceListIds);
         }
     }
     return list;
 }
Ejemplo n.º 2
0
        public void CheckTypesEx(int init_n, int init_level, IntegerStack init_class_stack)
        {
            ClassObject classObject;
            IntegerStack stack;
            FunctionObject obj9;
            int num52;
            if (this.scripter.IsError())
            {
                return;
            }
            IntegerList a = new IntegerList(true);
            IntegerList list2 = new IntegerList(true);
            IntegerList pos = new IntegerList(true);
            IntegerList list4 = new IntegerList(false);
            IntegerList l = new IntegerList(false);
            ClassObject obj2 = null;
            if (init_class_stack == null)
            {
                stack = new IntegerStack();
            }
            else
            {
                stack = init_class_stack.Clone();
            }
            if (stack.Count == 0)
            {
                classObject = null;
            }
            else
            {
                classObject = this.GetClassObject(stack.Peek());
            }
            this.n = init_n;
            int num = init_level;
            Label_0079:
            this.n++;
            if (this.n >= this.Card)
            {
                goto Label_22C6;
            }
            this.r = (ProgRec) this.prog[this.n];
            int op = this.r.op;
            if ((op == this.OP_SEPARATOR) || (op == this.OP_LABEL))
            {
                goto Label_0079;
            }
            if (op != this.OP_CREATE_INDEX_OBJECT)
            {
                if (op == this.OP_ADD_INDEX)
                {
                    if (((this.symbol_table[this.r.res].TypeId != 12) || (this[this.n + 1].op != this.OP_ADD_INDEX)) || (this[this.n + 1].res != this.r.res))
                    {
                        goto Label_04A6;
                    }
                    int num7 = 1;
                    while ((this[this.n + num7].op == this.OP_ADD_INDEX) && (this[this.n + num7].res == this.r.res))
                    {
                        num7++;
                    }
                    this.scripter.CreateErrorObjectEx("CS1501. No overload for method '{0}' takes '{1}' arguments.", new object[] { "this", num7 });
                    goto Label_22C6;
                }
                if (op == this.OP_SETUP_INDEX_OBJECT)
                {
                    int n = this.n;
                    int num9 = 0;
                    do
                    {
                        n--;
                        if ((this[n].op == this.OP_ADD_INDEX) && (this[n].arg1 == this.r.arg1))
                        {
                            num9++;
                        }
                    }
                    while ((this[n].op != this.OP_CREATE_INDEX_OBJECT) || (this[n].res != this.r.arg1));
                    int typeId = this.symbol_table[this[n].arg1].TypeId;
                    int rank = CSLite_System.GetRank(this.symbol_table[typeId].Name);
                    if ((rank > 0) && (rank != num9))
                    {
                        this.scripter.CreateErrorObjectEx("CS0022. Wrong number of indices inside [], expected '{0}'.", new object[] { rank.ToString() });
                        goto Label_22C6;
                    }
                }
            }
            else
            {
                int num3 = this.symbol_table[this.r.arg1].TypeId;
                string name = this.symbol_table[num3].Name;
                string elementTypeName = CSLite_System.GetElementTypeName(name);
                int num4 = 0;
                PropertyObject obj4 = null;
                if (elementTypeName == "")
                {
                    ClassObject obj5 = this.GetClassObject(num3);
                    if (obj5.IsPascalArray)
                    {
                        name = obj5.ImportedType.Name + "[]";
                        elementTypeName = this.symbol_table[obj5.IndexTypeId].Name;
                    }
                }
                if (elementTypeName == "")
                {
                    obj4 = this.GetClassObject(num3).FindIndexer();
                    if (obj4 == null)
                    {
                        this.scripter.CreateErrorObjectEx("CS0021. Cannot apply indexing with [] to an expression of type '{0}'.", new object[] { name });
                        goto Label_22C6;
                    }
                    num4 = this.symbol_table[obj4.Id].TypeId;
                }
                else
                {
                    for (int k = num3; k >= 0; k--)
                    {
                        if ((this.symbol_table[k].Kind == MemberKind.Type) && (this.symbol_table[k].Name == elementTypeName))
                        {
                            num4 = k;
                            break;
                        }
                    }
                }
                if (num4 == 0)
                {
                    elementTypeName = CSLite_System.GetElementTypeName(this.symbol_table[num3].FullName);
                    bool upcase = this.GetUpcase();
                    MemberObject obj6 = this.FindType(this.RecreateLevelStack(this.n), elementTypeName, upcase);
                    if (obj6 == null)
                    {
                        this.scripter.CreateErrorObjectEx("CS0246. The type or namespace name '{0}' could not be found (are you missing a using directive or an assembly reference?).", new object[] { elementTypeName });
                        goto Label_22C6;
                    }
                    num4 = obj6.Id;
                }
                this.symbol_table[this.r.res].TypeId = num4;
            }
            Label_04A6:
            if (((op == this.OP_CREATE_INDEX_OBJECT) || (op == this.OP_ADD_INDEX)) || (op == this.OP_SETUP_INDEX_OBJECT))
            {
                goto Label_0079;
            }
            for (int i = 1; i <= 2; i++)
            {
                int num13;
                if (i == 1)
                {
                    num13 = this.r.arg1;
                }
                else
                {
                    num13 = this.r.arg2;
                }
                if (this.symbol_table[num13].Kind == MemberKind.Index)
                {
                    l.Clear();
                    int avalue = this.n;
                    while (true)
                    {
                        if ((this[avalue].op == this.OP_CREATE_INDEX_OBJECT) && (this[avalue].res == num13))
                        {
                            break;
                        }
                        avalue--;
                    }
                    int num15 = this[avalue].arg1;
                    l.Add(avalue);
                    int num16 = this.symbol_table[num15].TypeId;
                    PropertyObject obj8 = this.GetClassObject(num16).FindIndexer();
                    if (obj8 != null)
                    {
                        while (true)
                        {
                            if ((this[avalue].op == this.OP_SETUP_INDEX_OBJECT) && (this[avalue].arg1 == num13))
                            {
                                break;
                            }
                            if ((this[avalue].op == this.OP_ADD_INDEX) && (this[avalue].arg1 == num13))
                            {
                                l.Add(avalue);
                            }
                            avalue++;
                        }
                        l.Add(avalue);
                        if ((this.r.op == this.OP_ASSIGN) && (i == 1))
                        {
                            if (obj8.WriteId == 0)
                            {
                                this.scripter.CreateErrorObject("CS0154. The property or indexer '{0}' cannot be used in this context because it lacks the get accessor.");
                                break;
                            }
                            int num17 = this.r.arg2;
                            this.InsertOperators(this.n, obj8.ParamCount + 3);
                            this.n--;
                            this.n++;
                            this[this.n].op = this.OP_BEGIN_CALL;
                            this[this.n].arg1 = obj8.WriteId;
                            this[this.n].arg2 = 0;
                            this[this.n].res = 0;
                            for (int m = 1; m < (l.Count - 1); m++)
                            {
                                this.n++;
                                this[this.n].op = this.OP_PUSH;
                                this[this.n].arg1 = this[l[m]].arg2;
                                this[this.n].arg2 = 0;
                                this[this.n].res = obj8.WriteId;
                            }
                            this.n++;
                            this[this.n].op = this.OP_PUSH;
                            this[this.n].arg1 = num17;
                            this[this.n].arg2 = 0;
                            this[this.n].res = obj8.WriteId;
                            this.n++;
                            this[this.n].op = this.OP_PUSH;
                            this[this.n].arg1 = num15;
                            this[this.n].arg2 = 0;
                            this[this.n].res = 0;
                            this.n++;
                            this[this.n].op = this.OP_CALL_BASE;
                            this[this.n].arg1 = obj8.WriteId;
                            this[this.n].arg2 = l.Count - 1;
                            this[this.n].res = 0;
                            this.r = (ProgRec) this.prog[this.n];
                            op = this.r.op;
                        }
                        else
                        {
                            if (obj8.ReadId == 0)
                            {
                                this.scripter.CreateErrorObject("CS0154. The property or indexer '{0}' cannot be used in this context because it lacks the get accessor.");
                                break;
                            }
                            int num19 = this.AppVar(this.symbol_table[num13].Level, this.symbol_table[num13].TypeId);
                            if (i == 1)
                            {
                                this.r.arg1 = num19;
                            }
                            else
                            {
                                this.r.arg2 = num19;
                            }
                            this.InsertOperators(this.n, obj8.ParamCount + 3);
                            this.n--;
                            this.n++;
                            this[this.n].op = this.OP_BEGIN_CALL;
                            this[this.n].arg1 = obj8.ReadId;
                            this[this.n].arg2 = 0;
                            this[this.n].res = 0;
                            for (int num20 = 1; num20 < (l.Count - 1); num20++)
                            {
                                this.n++;
                                this[this.n].op = this.OP_PUSH;
                                this[this.n].arg1 = this[l[num20]].arg2;
                                this[this.n].arg2 = 0;
                                this[this.n].res = obj8.ReadId;
                            }
                            this.n++;
                            this[this.n].op = this.OP_PUSH;
                            this[this.n].arg1 = num15;
                            this[this.n].arg2 = 0;
                            this[this.n].res = 0;
                            this.n++;
                            this[this.n].op = this.OP_CALL_BASE;
                            this[this.n].arg1 = obj8.ReadId;
                            this[this.n].arg2 = l.Count - 2;
                            this[this.n].res = num19;
                            this.symbol_table[this[this.n].res].TypeId = this.symbol_table[obj8.ReadId].TypeId;
                            this.r = (ProgRec) this.prog[this.n];
                            op = this.r.op;
                        }
                        list4.AddFrom(l);
                    }
                }
            }
            if (op == this.OP_CREATE_METHOD)
            {
                num = this.r.arg1;
                goto Label_0079;
            }
            if (op != this.OP_CALL_SIMPLE)
            {
                if ((op == this.OP_CALL) || (op == this.OP_CALL_BASE))
                {
                    this.CheckOP_CALL(classObject, num, a, list2, pos);
                    if (!this.scripter.IsError())
                    {
                        goto Label_0079;
                    }
                    goto Label_22C6;
                }
                if (op == this.OP_CHECK_STRUCT_CONSTRUCTOR)
                {
                    ClassObject obj12 = this.GetClassObject(this.r.arg1);
                    if (obj12.IsStruct && !obj12.Imported)
                    {
                        FunctionObject obj13;
                        this.r.op = this.OP_CREATE_OBJECT;
                        int num35 = obj12.FindConstructorId(null, null, out obj13);
                        if (num35 == 0)
                        {
                            this.scripter.CreateErrorObjectEx("CS0143. The type '{0}' has no constructors defined.", new object[] { obj12.Name });
                        }
                        this.n++;
                        this.InsertOperators(this.n, 2);
                        this[this.n].op = this.OP_PUSH;
                        this[this.n].arg1 = this.r.res;
                        this[this.n].arg2 = 0;
                        this[this.n].res = 0;
                        this.n++;
                        this[this.n].op = this.OP_CALL;
                        this[this.n].arg1 = num35;
                        this[this.n].arg2 = 0;
                        this[this.n].res = 0;
                    }
                    else
                    {
                        this.r.op = this.OP_NOP;
                    }
                }
                else if (op == this.OP_INSERT_STRUCT_CONSTRUCTORS)
                {
                    ClassObject obj14 = this.GetClassObject(this.r.arg1);
                    for (int num36 = 0; num36 < obj14.Members.Count; num36++)
                    {
                        MemberObject obj15 = obj14.Members[num36];
                        if (obj15.Kind == MemberKind.Field)
                        {
                            int num37 = this.symbol_table[obj15.Id].TypeId;
                            ClassObject obj16 = this.GetClassObject(num37);
                            if (obj16.IsStruct && !obj16.Imported)
                            {
                                if (obj16.IsPascalArray)
                                {
                                    this.n++;
                                    this.InsertOperators(this.n, 1);
                                    this[this.n].op = this.OP_CREATE_OBJECT;
                                    this[this.n].arg1 = num37;
                                    this[this.n].arg2 = 0;
                                    this[this.n].res = obj15.Id;
                                }
                                else
                                {
                                    FunctionObject obj17;
                                    int num38 = obj16.FindConstructorId(null, null, out obj17);
                                    if (num38 == 0)
                                    {
                                        this.scripter.CreateErrorObjectEx("CS0143. The type '{0}' has no constructors defined.", new object[] { obj16.Name });
                                    }
                                    this.n++;
                                    this.InsertOperators(this.n, 3);
                                    this[this.n].op = this.OP_CREATE_OBJECT;
                                    this[this.n].arg1 = num37;
                                    this[this.n].arg2 = 0;
                                    this[this.n].res = obj15.Id;
                                    this.n++;
                                    this[this.n].op = this.OP_PUSH;
                                    this[this.n].arg1 = obj15.Id;
                                    this[this.n].arg2 = 0;
                                    this[this.n].res = 0;
                                    this.n++;
                                    this[this.n].op = this.OP_CALL;
                                    this[this.n].arg1 = num38;
                                    this[this.n].arg2 = 0;
                                    this[this.n].res = 0;
                                }
                            }
                        }
                    }
                }
                else
                {
                    if (op == this.OP_CAST)
                    {
                        this.CheckOP_CAST();
                        if (!this.scripter.IsError())
                        {
                            goto Label_0079;
                        }
                        goto Label_22C6;
                    }
                    if (op == this.OP_TO_SBYTE)
                    {
                        this.symbol_table[this.r.res].TypeId = 10;
                    }
                    else if (op == this.OP_TO_BYTE)
                    {
                        this.symbol_table[this.r.res].TypeId = 3;
                    }
                    else if (op == this.OP_TO_USHORT)
                    {
                        this.symbol_table[this.r.res].TypeId = 15;
                    }
                    else if (op == this.OP_TO_SHORT)
                    {
                        this.symbol_table[this.r.res].TypeId = 11;
                    }
                    else if (op == this.OP_TO_UINT)
                    {
                        this.symbol_table[this.r.res].TypeId = 13;
                    }
                    else if (op == this.OP_TO_INT)
                    {
                        this.symbol_table[this.r.res].TypeId = 8;
                    }
                    else if (op == this.OP_TO_ULONG)
                    {
                        this.symbol_table[this.r.res].TypeId = 14;
                    }
                    else if (op == this.OP_TO_LONG)
                    {
                        this.symbol_table[this.r.res].TypeId = 9;
                    }
                    else if (op == this.OP_TO_CHAR)
                    {
                        this.symbol_table[this.r.res].TypeId = 4;
                    }
                    else if (op == this.OP_TO_FLOAT)
                    {
                        this.symbol_table[this.r.res].TypeId = 7;
                    }
                    else if (op == this.OP_TO_DOUBLE)
                    {
                        this.symbol_table[this.r.res].TypeId = 6;
                    }
                    else if (op == this.OP_TO_DECIMAL)
                    {
                        this.symbol_table[this.r.res].TypeId = 5;
                    }
                    else if (op == this.OP_TO_STRING)
                    {
                        this.symbol_table[this.r.res].TypeId = 12;
                    }
                    else if (op == this.OP_TO_BOOLEAN)
                    {
                        this.symbol_table[this.r.res].TypeId = 2;
                    }
                    else
                    {
                        if (op == this.OP_INC)
                        {
                            this.CheckOP_INC();
                            if (!this.scripter.IsError())
                            {
                                goto Label_0079;
                            }
                            goto Label_22C6;
                        }
                        if (op == this.OP_DEC)
                        {
                            this.CheckOP_DEC();
                            if (!this.scripter.IsError())
                            {
                                goto Label_0079;
                            }
                            goto Label_22C6;
                        }
                        if (op == this.OP_ASSIGN_COND_TYPE)
                        {
                            this.CheckOP_ASSIGN_COND_TYPE();
                        }
                        else if (op == this.OP_ADD_EXPLICIT_INTERFACE)
                        {
                            this.OperAddExplicitInterface();
                        }
                        else if (op == this.OP_END_CLASS)
                        {
                            stack.Pop();
                            if (stack.Count > 0)
                            {
                                int num39 = stack.Peek();
                                classObject = this.GetClassObject(num39);
                            }
                            else
                            {
                                classObject = null;
                            }
                        }
                        else
                        {
                            if (op != this.OP_CREATE_CLASS)
                            {
                                if (op == this.OP_CREATE_OBJECT)
                                {
                                    ClassObject obj27 = this.GetClassObject(this.r.arg1);
                                    if (!obj27.Abstract && !obj27.IsInterface)
                                    {
                                        goto Label_0079;
                                    }
                                    this.scripter.CreateErrorObjectEx("CS0144. Cannot create an instance of the abstract class or interface '{0}'.", new object[] { obj27.Name });
                                }
                                else
                                {
                                    if (op == this.OP_END_USING)
                                    {
                                        if ((obj2 != null) && (obj2.Id == this.r.arg1))
                                        {
                                            obj2 = null;
                                        }
                                        goto Label_0079;
                                    }
                                    if (op == this.OP_ASSIGN)
                                    {
                                        this.CheckOP_ASSIGN(obj2);
                                        if (!this.scripter.IsError())
                                        {
                                            goto Label_0079;
                                        }
                                    }
                                    else
                                    {
                                        if (op == this.OP_UNARY_MINUS)
                                        {
                                            if (!this.SetupDetailedUnaryOperator(op, "-", this.detailed_negation_operators))
                                            {
                                                goto Label_22C6;
                                            }
                                            if (this[this.n].op != this.OP_CALL_SIMPLE)
                                            {
                                                this.r = this[this.n];
                                                int num48 = this.GetTypeId(this.r.arg1);
                                                int num49 = this.GetTypeId(this.r.res);
                                                if ((num48 != num49) && IsNumericTypeId(num49))
                                                {
                                                    this.InsertNumericConversion(num49, 1);
                                                }
                                            }
                                            goto Label_0079;
                                        }
                                        if (op == this.OP_NOT)
                                        {
                                            if (this.SetupDetailedUnaryOperator(op, "!", this.detailed_logical_negation_operators))
                                            {
                                                goto Label_0079;
                                            }
                                        }
                                        else
                                        {
                                            if (op == this.OP_COMPLEMENT)
                                            {
                                                if (!this.SetupDetailedUnaryOperator(op, "~", this.detailed_bitwise_complement_operators))
                                                {
                                                    goto Label_22C6;
                                                }
                                                if (this[this.n].op != this.OP_CALL_SIMPLE)
                                                {
                                                    this.r = this[this.n];
                                                    int num50 = this.GetTypeId(this.r.arg1);
                                                    int num51 = this.GetTypeId(this.r.res);
                                                    if ((num50 != num51) && IsNumericTypeId(num51))
                                                    {
                                                        this.InsertNumericConversion(num51, 1);
                                                    }
                                                }
                                                goto Label_0079;
                                            }
                                            if (op == this.OP_PLUS)
                                            {
                                                this.CheckOP_PLUS();
                                                if (!this.scripter.IsError())
                                                {
                                                    goto Label_0079;
                                                }
                                            }
                                            else if (op == this.OP_MINUS)
                                            {
                                                this.CheckOP_MINUS();
                                                if (!this.scripter.IsError())
                                                {
                                                    goto Label_0079;
                                                }
                                            }
                                            else if (op == this.OP_MULT)
                                            {
                                                this.CheckOP_MULT();
                                                if (!this.scripter.IsError())
                                                {
                                                    goto Label_0079;
                                                }
                                            }
                                            else if (op == this.OP_EXPONENT)
                                            {
                                                this.CheckOP_EXP();
                                                if (!this.scripter.IsError())
                                                {
                                                    goto Label_0079;
                                                }
                                            }
                                            else if (op == this.OP_DIV)
                                            {
                                                this.CheckOP_DIV();
                                                if (!this.scripter.IsError())
                                                {
                                                    goto Label_0079;
                                                }
                                            }
                                            else if (op == this.OP_MOD)
                                            {
                                                this.CheckOP_MOD();
                                                if (!this.scripter.IsError())
                                                {
                                                    goto Label_0079;
                                                }
                                            }
                                            else if (op == this.OP_LEFT_SHIFT)
                                            {
                                                this.CheckOP_LEFT_SHIFT();
                                                if (!this.scripter.IsError())
                                                {
                                                    goto Label_0079;
                                                }
                                            }
                                            else if (op == this.OP_RIGHT_SHIFT)
                                            {
                                                this.CheckOP_RIGHT_SHIFT();
                                                if (!this.scripter.IsError())
                                                {
                                                    goto Label_0079;
                                                }
                                            }
                                            else if (op == this.OP_BITWISE_AND)
                                            {
                                                this.CheckOP_BITWISE_AND();
                                                if (!this.scripter.IsError())
                                                {
                                                    goto Label_0079;
                                                }
                                            }
                                            else if (op == this.OP_BITWISE_OR)
                                            {
                                                this.CheckOP_BITWISE_OR();
                                                if (!this.scripter.IsError())
                                                {
                                                    goto Label_0079;
                                                }
                                            }
                                            else if (op == this.OP_BITWISE_XOR)
                                            {
                                                this.CheckOP_BITWISE_XOR();
                                                if (!this.scripter.IsError())
                                                {
                                                    goto Label_0079;
                                                }
                                            }
                                            else if (op == this.OP_LOGICAL_AND)
                                            {
                                                this.CheckOP_LOGICAL_AND();
                                                if (!this.scripter.IsError())
                                                {
                                                    goto Label_0079;
                                                }
                                            }
                                            else if (op == this.OP_LOGICAL_OR)
                                            {
                                                this.CheckOP_LOGICAL_OR();
                                                if (!this.scripter.IsError())
                                                {
                                                    goto Label_0079;
                                                }
                                            }
                                            else
                                            {
                                                if (op == this.OP_LT)
                                                {
                                                    if (!this.SetupDetailedBinaryOperator(op, "<", this.detailed_lt_operators))
                                                    {
                                                        goto Label_22C6;
                                                    }
                                                    this.symbol_table[this.r.res].TypeId = 2;
                                                    goto Label_0079;
                                                }
                                                if (op == this.OP_LE)
                                                {
                                                    if (!this.SetupDetailedBinaryOperator(op, "<=", this.detailed_le_operators))
                                                    {
                                                        goto Label_22C6;
                                                    }
                                                    this.symbol_table[this.r.res].TypeId = 2;
                                                    goto Label_0079;
                                                }
                                                if (op == this.OP_GT)
                                                {
                                                    if (!this.SetupDetailedBinaryOperator(op, ">", this.detailed_gt_operators))
                                                    {
                                                        goto Label_22C6;
                                                    }
                                                    this.symbol_table[this.r.res].TypeId = 2;
                                                    goto Label_0079;
                                                }
                                                if (op == this.OP_GE)
                                                {
                                                    if (!this.SetupDetailedBinaryOperator(op, ">=", this.detailed_ge_operators))
                                                    {
                                                        goto Label_22C6;
                                                    }
                                                    this.symbol_table[this.r.res].TypeId = 2;
                                                    goto Label_0079;
                                                }
                                                if (op == this.OP_EQ)
                                                {
                                                    this.CheckOP_EQ();
                                                    if (!this.scripter.IsError())
                                                    {
                                                        goto Label_0079;
                                                    }
                                                }
                                                else if (op == this.OP_NE)
                                                {
                                                    this.CheckOP_NE();
                                                    if (!this.scripter.IsError())
                                                    {
                                                        goto Label_0079;
                                                    }
                                                }
                                                else
                                                {
                                                    if (op == this.OP_IS)
                                                    {
                                                        this.symbol_table[this.r.res].TypeId = 2;
                                                        goto Label_0079;
                                                    }
                                                    if (op == this.OP_AS)
                                                    {
                                                        if (this.symbol_table[this.r.arg2].Kind != MemberKind.Type)
                                                        {
                                                            this.scripter.CreateErrorObject("CS1031. Type expected.");
                                                            goto Label_22C6;
                                                        }
                                                        ClassObject obj28 = this.GetClassObject(this.symbol_table[this.r.arg1].TypeId);
                                                        ClassObject obj29 = this.GetClassObject(this.r.arg2);
                                                        if (obj29.IsValueType)
                                                        {
                                                            this.scripter.CreateErrorObjectEx("CS0077. The as operator must be used with a reference type ('{0}' is a value type).", new object[] { obj29.Name });
                                                            goto Label_22C6;
                                                        }
                                                        if (!this.scripter.conversion.ExistsImplicitReferenceConversion(obj29, obj28))
                                                        {
                                                            this.scripter.CreateErrorObjectEx("CS0039. Cannot convert type '{0}' to '{1}'.", new object[] { obj29.Name, obj28.Name });
                                                            goto Label_22C6;
                                                        }
                                                        this.symbol_table[this.r.res].TypeId = this.r.arg2;
                                                        goto Label_0079;
                                                    }
                                                    if (op == this.OP_CREATE_REFERENCE)
                                                    {
                                                        this.CheckOP_CREATE_REFERENCE(classObject);
                                                        if (this.scripter.IsError())
                                                        {
                                                            goto Label_22C6;
                                                        }
                                                        goto Label_0079;
                                                    }
                                                    if (op == this.OP_DECLARE_LOCAL_VARIABLE)
                                                    {
                                                        this.OperDeclareLocalVariable();
                                                        goto Label_0079;
                                                    }
                                                    if (op != this.OP_ADDRESS_OF)
                                                    {
                                                        goto Label_0079;
                                                    }
                                                    this.ProcessAddressOf();
                                                    if (!this.scripter.IsError())
                                                    {
                                                        goto Label_0079;
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                                goto Label_22C6;
                            }
                            bool flag3 = this.GetUpcase(this.n);
                            ClassObject obj18 = this.GetClassObject(this.r.arg1);
                            if (obj18.Class_Kind == ClassKind.Enum)
                            {
                                obj2 = obj18;
                            }
                            classObject = obj18;
                            stack.Push(classObject.Id);
                            if (obj18.IsClass || obj18.IsStruct)
                            {
                                int num40 = 0;
                                for (int num41 = 0; num41 < obj18.AncestorIds.Count; num41++)
                                {
                                    int num42 = obj18.AncestorIds[num41];
                                    ClassObject obj19 = this.GetClassObject(num42);
                                    if (!obj19.IsInterface)
                                    {
                                        num40++;
                                        if (num40 > 1)
                                        {
                                            this.scripter.CreateErrorObjectEx("CS0527. '{0}' : type in interface list is not an interface.", new object[] { obj19.Name });
                                            break;
                                        }
                                    }
                                }
                                IntegerList supportedInterfaceListIds = obj18.GetSupportedInterfaceListIds();
                                if (obj18.AncestorClass.HasModifier(Modifier.Abstract))
                                {
                                    supportedInterfaceListIds.Add(obj18.AncestorClass.Id);
                                }
                                for (int num43 = 0; num43 < supportedInterfaceListIds.Count; num43++)
                                {
                                    int num44 = supportedInterfaceListIds[num43];
                                    ClassObject obj20 = this.GetClassObject(num44);
                                    for (int num45 = 0; num45 < obj20.Members.Count; num45++)
                                    {
                                        MemberObject obj21 = obj20.Members[num45];
                                        if (obj21.HasModifier(Modifier.Abstract))
                                        {
                                            if (((obj21.Kind == MemberKind.Method) || (obj21.Kind == MemberKind.Constructor)) || (obj21.Kind == MemberKind.Destructor))
                                            {
                                                bool flag4 = false;
                                                FunctionObject fy = (FunctionObject) obj21;
                                                for (int num46 = 0; num46 < obj18.Members.Count; num46++)
                                                {
                                                    MemberObject obj23 = obj18.Members[num46];
                                                    if (obj23.Public && (obj21.Kind == obj23.Kind))
                                                    {
                                                        if (CSLite_System.CompareStrings(obj21.Name, obj23.Name, flag3))
                                                        {
                                                            FunctionObject fx = (FunctionObject) obj23;
                                                            if (FunctionObject.CompareHeaders(fx, fy))
                                                            {
                                                                flag4 = true;
                                                                break;
                                                            }
                                                        }
                                                        if (obj23.ImplementsId != 0)
                                                        {
                                                            string str6 = this.symbol_table[obj23.ImplementsId].Name;
                                                            if (CSLite_System.CompareStrings(obj21.Name, str6, flag3))
                                                            {
                                                                flag4 = true;
                                                                break;
                                                            }
                                                        }
                                                    }
                                                }
                                                if (flag4)
                                                {
                                                    continue;
                                                }
                                                if (obj20.IsInterface)
                                                {
                                                    this.scripter.CreateErrorObjectEx("CS0535. '{0}' does not implement interface member '{1}'.", new object[] { obj18.FullName, obj20.FullName + "." + fy.Name });
                                                }
                                                else if (obj20.IsClass)
                                                {
                                                    this.scripter.CreateErrorObjectEx("CS0534. '{0}' does not implement inherited abstract member '{1}'.", new object[] { obj18.FullName, obj20.FullName + "." + fy.Name });
                                                }
                                                break;
                                            }
                                            if (obj21.Kind == MemberKind.Property)
                                            {
                                                bool flag5 = false;
                                                PropertyObject obj25 = (PropertyObject) obj21;
                                                for (int num47 = 0; num47 < obj18.Members.Count; num47++)
                                                {
                                                    MemberObject obj26 = obj18.Members[num47];
                                                    if (obj26.Public && (obj21.Kind == obj26.Kind))
                                                    {
                                                        if (CSLite_System.CompareStrings(obj21.Name, obj26.Name, flag3))
                                                        {
                                                            flag5 = true;
                                                            break;
                                                        }
                                                        if (obj26.ImplementsId != 0)
                                                        {
                                                            string str7 = this.symbol_table[obj26.ImplementsId].Name;
                                                            if (CSLite_System.CompareStrings(obj21.Name, str7, flag3))
                                                            {
                                                                flag5 = true;
                                                                break;
                                                            }
                                                        }
                                                    }
                                                }
                                                if (!flag5)
                                                {
                                                    if (obj20.IsInterface)
                                                    {
                                                        this.scripter.CreateErrorObjectEx("CS0535. '{0}' does not implement interface member '{1}'.", new object[] { obj18.FullName, obj20.FullName + "." + obj25.Name });
                                                    }
                                                    else if (obj20.IsClass)
                                                    {
                                                        this.scripter.CreateErrorObjectEx("CS0534. '{0}' does not implement inherited abstract member '{1}'.", new object[] { obj18.FullName, obj20.FullName + "." + obj25.Name });
                                                    }
                                                    break;
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                goto Label_0079;
            }
            this.r.op = this.OP_CALL;
            int id = this.r.arg1;
            if (this.symbol_table[id].Kind != MemberKind.Method)
            {
                goto Label_0079;
            }
            int num22 = this.r.arg2;
            a.Clear();
            list2.Clear();
            pos.Clear();
            if (num22 > 0)
            {
                int num23 = this.n - 1;
                do
                {
                    if ((this[num23].op == this.OP_PUSH) && (this[num23].res == id))
                    {
                        pos.Add(num23);
                        a.Add(this[num23].arg1);
                        list2.Add(this[num23].arg2);
                        if (a.Count == num22)
                        {
                            goto Label_0C8B;
                        }
                    }
                    num23--;
                }
                while (num23 != 0);
                this.scripter.CreateErrorObject("CS0001. Internal compiler error.");
                return;
            }
            Label_0C8B:
            obj9 = this.GetFunctionObject(id);
            bool flag2 = true;
            for (int j = 0; j < num22; j++)
            {
                int paramId = obj9.GetParamId(j);
                int num26 = a[j];
                if (!obj9.Imported)
                {
                    flag2 = ((int)obj9.GetParamMod(j) == list2[j]);
                }
                else
                {
                    flag2 = true;
                }
                if (!flag2)
                {
                    this.n = pos[j];
                    ParamMod paramMod = obj9.GetParamMod(j);
                    ParamMod mod2 = (ParamMod) list2[j];
                    int num27 = this.symbol_table[paramId].TypeId;
                    int num28 = this.symbol_table[num26].TypeId;
                    string str4 = this.symbol_table[num27].Name;
                    string str5 = this.symbol_table[num28].Name;
                    switch (paramMod)
                    {
                        case ParamMod.RetVal:
                            str4 = "ref " + str4;
                            break;

                        case ParamMod.Out:
                            str4 = "out " + str4;
                            break;
                    }
                    if (mod2 == ParamMod.RetVal)
                    {
                        str5 = "ref " + str5;
                    }
                    else if (mod2 == ParamMod.Out)
                    {
                        str5 = "out " + str5;
                    }
                    this.scripter.CreateErrorObjectEx("CS0029. Cannot impllicitly convert type '{0}' to '{1}'.", new object[] { str4, str5 });
                    break;
                }
                flag2 = this.scripter.MatchAssignment(paramId, num26);
                if (!flag2)
                {
                    this.n = pos[j];
                    int num29 = this.symbol_table[paramId].TypeId;
                    int num30 = this.symbol_table[num26].TypeId;
                    ClassObject obj10 = this.GetClassObject(num29);
                    ClassObject obj11 = this.GetClassObject(num30);
                    int num31 = obj10.FindOverloadableImplicitOperatorId(num26, paramId);
                    if (num31 > 0)
                    {
                        int currMethodId = this.GetCurrMethodId();
                        int num33 = this.AppVar(currMethodId, num29);
                        int res = this[this.n].res;
                        this[this.n].arg1 = num33;
                        this.InsertOperators(this.n, 3);
                        this[this.n].op = this.OP_PUSH;
                        this[this.n].arg1 = num26;
                        this[this.n].arg2 = 0;
                        this[this.n].res = num31;
                        this.n++;
                        this[this.n].op = this.OP_PUSH;
                        this[this.n].arg1 = obj10.Id;
                        this[this.n].arg2 = 0;
                        this[this.n].res = 0;
                        this.n++;
                        this[this.n].op = this.OP_CALL_SIMPLE;
                        this[this.n].arg1 = num31;
                        this[this.n].arg2 = 1;
                        this[this.n].res = num33;
                        while (this[this.n].arg1 != res)
                        {
                            this.n++;
                        }
                        goto Label_0079;
                    }
                    this.scripter.CreateErrorObjectEx("CS0029. Cannot impllicitly convert type '{0}' to '{1}'.", new object[] { obj11.Name, obj10.Name });
                    break;
                }
            }
            if (flag2)
            {
                goto Label_0079;
            }
            Label_22C6:
            num52 = 0;
            while (num52 < list4.Count)
            {
                this.n = list4[num52];
                this[this.n].op = this.OP_NOP;
                num52++;
            }
        }