Example #1
0
        public override int GetImageIndex(ISyntaxInfo Info)
        {
            int num1 = Info.ImageIndex;

            if (Info is IVbScope)
            {
                VbScope scope1 = ((IVbScope)Info).Scope;
                if ((scope1 & VbScope.Private) != VbScope.None)
                {
                    return(num1 + UnitInfo.ImageDelta);
                }
                if ((scope1 & VbScope.Protected) != VbScope.None)
                {
                    return(num1 + (2 * UnitInfo.ImageDelta));
                }
                if ((scope1 & VbScope.Public) != VbScope.None)
                {
                    num1 += (3 * UnitInfo.ImageDelta);
                }
            }
            return(num1);
        }
Example #2
0
 protected void GetScope(out VbScope Scope, out VbModifier Modifiers)
 {
     Scope     = VbScope.None;
     Modifiers = VbModifier.None;
     while (base.Token == 2)
     {
         string text1 = base.TokenString.ToLower();
         int    num1  = base.GetReswordToken(text1);
         if (num1 == 6)
         {
             Scope |= ((VbScope)Enum.Parse(typeof(VbScope), text1, true));
         }
         else
         {
             if (num1 != 7)
             {
                 return;
             }
             Modifiers |= ((VbModifier)Enum.Parse(typeof(VbModifier), text1, true));
         }
         this.NextValidToken();
     }
 }
Example #3
0
 public VbFieldInfo(string Name, string DataType, Point Position, VbScope Scope, Point AttrPt, string Attributes) : base(Name, DataType, Position, AttrPt, Attributes)
 {
     this.scope = Scope;
 }
Example #4
0
 public VbFieldInfo(string Name, string DataType, Point Position, VbScope Scope) : base(Name, DataType, Position)
 {
     this.scope = Scope;
 }
Example #5
0
 public VbInterfaceInfo(string Name, string[] BaseTypes, Point Position, int Level, VbScope Scope, Point AttrPt, string Attributes) : base(Name, BaseTypes, Position, Level, AttrPt, Attributes)
 {
     this.scope = Scope;
 }
Example #6
0
 public VbInterfaceInfo(string Name, string[] BaseTypes, Point Position, int Level, VbScope Scope) : base(Name, BaseTypes, Position, Level)
 {
     this.scope = Scope;
 }
Example #7
0
 public VbStructInfo(string Name, string[] BaseTypes, Point Position, int Level, VbScope Scope, VbModifier Modifiers, Point AttrPt, string Attributes) : base(Name, BaseTypes, Position, Level, AttrPt, Attributes)
 {
     this.scope     = Scope;
     this.modifiers = Modifiers;
 }
Example #8
0
 public VbEnumInfo(string Name, string DataType, Point Position, int Level, VbScope Scope, VbModifier Modifiers, Point AttrPt, string Attributes) : base(Name, DataType, Position, Level, AttrPt, Attributes)
 {
     this.scope     = Scope;
     this.modifiers = Modifiers;
 }
Example #9
0
 public VbMethodInfo(string Name, string DataType, Point Position, int Level, VbScope Scope, VbModifier Modifiers) : base(Name, DataType, Position, Level)
 {
     this.scope     = Scope;
     this.modifiers = Modifiers;
 }
Example #10
0
 public VbClassInfo(string Name, string[] BaseTypes, Point Position, int Level, VbScope Scope, VbModifier Modifiers) : base(Name, BaseTypes, Position, Level)
 {
     this.scope     = Scope;
     this.modifiers = Modifiers;
 }
Example #11
0
 protected void ParseDeclaration(VbScope Scope, VbModifier Modifiers, string InfoType, ISyntaxInfo Info, Point Position, Point AttrPt, string Attributes, int Level)
 {
     //string text1 = string.Empty;
     //string text2 = string.Empty;
     //if (base.GetReswordToken(InfoType) != 11)
     //{
     //    this.NextValidToken();
     //}
     //else
     //{
     //    object obj1;
     //    if (((obj1 = InfoType) != null) && ((obj1 = <PrivateImplementationDetails>.$$method0x60004eb-1[obj1]) != null))
     //    {
     //        char[] chArray1;
     //        switch (((int) obj1))
     //        {
     //            case 0:
     //            {
     //                this.ProcessImports(Info, Position, Level);
     //                return;
     //            }
     //            case 1:
     //            case 2:
     //            {
     //                if (this.GetName(ref text1, "."))
     //                {
     //                    base.ParseBlock((Info is IVbUnitInfo) ? ((IVbUnitInfo) Info).Namespaces : null, new VbNamespaceInfo(text1, Position, Level), Level, null, this.parseBlockProc);
     //                }
     //                return;
     //            }
     //            case 3:
     //            {
     //                if (this.GetClassNameAndType(out text1, out text2))
     //                {
     //                    chArray1 = new char[1] { ',' } ;
     //                    base.ParseBlock((Info is IClassInfo) ? ((IClassInfo) Info).Interfaces : null, new VbInterfaceInfo(text1, text2.Split(chArray1), Position, Level, Scope, AttrPt, Attributes), Level, null, this.parseBlockProc);
     //                }
     //                return;
     //            }
     //            case 4:
     //            {
     //                if (this.GetClassNameAndType(out text1, out text2))
     //                {
     //                    chArray1 = new char[1] { ',' } ;
     //                    base.ParseBlock((Info is IClassInfo) ? ((IClassInfo) Info).Classes : null, new VbClassInfo(text1, text2.Split(chArray1), Position, Level, Scope, Modifiers, AttrPt, Attributes), Level, null, this.parseBlockProc);
     //                }
     //                return;
     //            }
     //            case 5:
     //            {
     //                if (this.GetClassNameAndType(out text1, out text2))
     //                {
     //                    chArray1 = new char[1] { ',' } ;
     //                    base.ParseBlock((Info is IClassInfo) ? ((IClassInfo) Info).Structures : null, new VbStructInfo(text1, text2.Split(chArray1), Position, Level, Scope, Modifiers, AttrPt, Attributes), Level, null, this.parseBlockProc);
     //                }
     //                return;
     //            }
     //            case 6:
     //            {
     //                string text3;
     //                if (base.NextValidToken(out text3) == 2)
     //                {
     //                    text3 = text3.ToLower();
     //                    if (((text3 != "sub") && (text3 != "function")) || !this.GetName(ref text1, string.Empty))
     //                    {
     //                        return;
     //                    }
     //                    IDelegateInfo info1 = new VbDelegateInfo(text1, text2, Position, Scope, AttrPt, Attributes);
     //                    base.ParseBlock((Info is IClassInfo) ? ((IClassInfo) Info).Delegates : null, info1, Level, this.parseDelegateProc, null);
     //                }
     //                return;
     //            }
     //            case 7:
     //            case 8:
     //            {
     //                if (this.GetName(ref text1, string.Empty))
     //                {
     //                    IMethodInfo info2 = new VbMethodInfo(text1, text2, Position, Level, Scope, Modifiers, AttrPt, Attributes);
     //                    if (!base.IsInterface(Info))
     //                    {
     //                        base.ParseBlock((Info is IInterfaceInfo) ? ((IInterfaceInfo) Info).Methods : null, info2, Level, this.parseDelegateProc, this.parseMethodProc);
     //                        return;
     //                    }
     //                    base.ParseBlock(((IInterfaceInfo) Info).Methods, info2, Level, this.parseDelegateProc, null);
     //                }
     //                return;
     //            }
     //            case 9:
     //            case 10:
     //            {
     //                if (this.GetNameAndType(out text1, out text2))
     //                {
     //                    IFieldInfo info3 = new VbFieldInfo(text1, text2, Position, Scope, AttrPt, Attributes);
     //                    info3.DataType = text2;
     //                    if (!(Info is IClassInfo))
     //                    {
     //                        if (Info is IHasLocalVars)
     //                        {
     //                            ((IHasLocalVars) Info).LocalVars.Add(info3);
     //                        }
     //                        return;
     //                    }
     //                    ((IClassInfo) Info).Fields.Add(info3);
     //                }
     //                return;
     //            }
     //            case 11:
     //            {
     //                if (this.GetName(ref text1, string.Empty))
     //                {
     //                    IPropInfo info4 = new VbPropInfo(text1, text2, Position, Level, Scope, Modifiers, AttrPt, Attributes);
     //                    base.ParseBlock((Info is IInterfaceInfo) ? ((IInterfaceInfo) Info).Properties : null, info4, Level, this.parseDelegateProc, this.parsePropertyProc);
     //                    if (!base.IsInterface(Info))
     //                    {
     //                        return;
     //                    }
     //                    if (info4.PropertyGet != null)
     //                    {
     //                        info4.PropertyGet.Visible = false;
     //                    }
     //                    if (info4.PropertySet == null)
     //                    {
     //                        return;
     //                    }
     //                    info4.PropertySet.Visible = false;
     //                }
     //                return;
     //            }
     //            case 12:
     //            {
     //                if (this.GetClassNameAndType(out text1, out text2))
     //                {
     //                    base.ParseBlock((Info is IClassInfo) ? ((IClassInfo) Info).Enums : null, new VbEnumInfo(text1, text2, Position, Level, Scope, Modifiers, AttrPt, Attributes), Level, null, this.parseEnumProc);
     //                }
     //                return;
     //            }
     //            case 13:
     //            {
     //                if (this.GetNameAndType(out text1, out text2) && (Info is IInterfaceInfo))
     //                {
     //                    IEventInfo info5 = new VbEventInfo(text1, text2, Position, Level, Scope, Modifiers, AttrPt, Attributes);
     //                    ((InterfaceInfo) Info).Events.Add(info5);
     //                }
     //                return;
     //            }
     //        }
     //    }
     //    this.NextValidToken();
     //}
 }
Example #12
0
        protected void ParseBlock(ISyntaxInfo Info, ISyntaxInfos Infos, int Level)
        {
            ISyntaxInfo info1 = this.currentBlock;

            this.currentBlock = Info;
            Point  point1 = new Point(-1, -1);
            string text1  = string.Empty;

            if (base.TokenString == "<")
            {
                point1 = new Point(this.tokenPos, base.LineIndex);
                while (base.TokenString == "<")
                {
                    base.SkipBrackets(">", ref text1);
                }
            }
            Point  point2 = new Point(this.tokenPos, base.LineIndex);
            string text2  = base.TokenString.ToLower();

            if (base.Token == 8)
            {
                if (text2 == "#region")
                {
                    this.ParseRegion(Info, Infos, Level, this.parseBlockProc);
                }
                else
                {
                    this.NextValidToken();
                }
            }
            else if (base.Token != 2)
            {
                if (base.Token == 0)
                {
                    this.ParseDeclaration(VbScope.None, VbModifier.None, text2, Info, point2, point1, text1, Level);
                }
                else
                {
                    this.NextValidToken();
                    this.currentBlock = info1;
                }
            }
            else
            {
                switch (base.GetReswordToken(text2))
                {
                case 3:
                case 11:
                {
                    this.ParseDeclaration(VbScope.None, VbModifier.None, text2, Info, point2, point1, text1, Level);
                    return;
                }

                case 6:
                case 7:
                {
                    VbScope    scope1    = VbScope.None;
                    VbModifier modifier1 = VbModifier.None;
                    this.GetScope(out scope1, out modifier1);
                    if (base.IsReswordOrIdentifier(base.Token))
                    {
                        this.ParseDeclaration(scope1, modifier1, base.TokenString.ToLower(), Info, point2, point1, text1, Level);
                    }
                    return;
                }
                }
                this.NextValidToken();
            }
        }