Ejemplo n.º 1
0
 public Namespace(Namespace parent, MemberName name)
 {
     Parent = parent;
     MemberName = name;
     childNamespaces = new List<Namespace>();
     types = new List<TypeDef>();
 }
Ejemplo n.º 2
0
        public MemberDef(TypeDef parent, MemberName memberName, Modifier modifiers)
        {
            Modifiers = modifiers;
            MemberName = memberName;
            Parent = parent;

            Locals = new Dictionary<string, LocalBuilder>();

            attributes = new List<AttributeInstance>();
        }
Ejemplo n.º 3
0
        public TypeDef(Namespace ns, string name, MemberName baseClass, MemberName[] inplements, Modifier modifiers)
            : base(
                null,
                (ns is GlobalRootNamespace ? new MemberName(name) : new MemberName(ns.MemberName, Separators.Dot, name)),
                modifiers)
        {
            Initialize(baseClass, inplements);

            Namespace = ns;
            ns.AddType(this);
        }
 protected ClassStructOrModuleDef(ClassStructOrModuleDef parent, string name, MemberName baseClass,
                                  MemberName[] inherits, Modifier modifiers)
     : base(parent, name, baseClass, inherits, modifiers)
 {
 }
 public ClassStructOrModuleDef(Namespace ns, string name, MemberName baseClass, MemberName[] inherits,
                               Modifier modifiers)
     : base(ns, name, baseClass, inherits, modifiers)
 {
 }
Ejemplo n.º 6
0
 protected EnumDef(ClassOrStructDef parent, string name, MemberName baseClass, MemberName[] inherits,
                   Modifier modifiers)
     : base(parent, name, baseClass, inherits, modifiers)
 {
     parent.AddNestedType(parent);
 }
Ejemplo n.º 7
0
 public EnumDef(Namespace ns, string name, MemberName baseClass, MemberName[] inherits, Modifier modifiers)
     : base(ns, name, baseClass, inherits, modifiers)
 {
 }
        private MemberName ParseDottedName()
        {
            TokenInfo token;
            MemberName nameExpr = null;

            token = Tokenizer.PeekToken();

            while (Helpers.IsIdentifier(token) || Helpers.IsReservedWord(token))
            {
                token = GetNextToken();

                if (nameExpr == null)
                {
                    nameExpr = new MemberName(token.Value);
                }
                else
                {
                    nameExpr = new MemberName(nameExpr, Separators.Dot, token.Value);
                }

                token = Tokenizer.PeekToken();

                if (token.Is(Token.Period))
                {
                    GetNextToken();
                }
                else
                {
                    break;
                }
            }

            return nameExpr;
        }
        private MemberName ParseMemberName()
        {
            TokenInfo token;

            MemberName nameExpr = null;

            token = Tokenizer.PeekToken();

            while (true)
            {
                if (!Helpers.IsIdentifierOrReservedWord(token))
                {
                    Expected(Report, Token.Identifier, ref token);
                    break;
                }

                token = GetNextToken();

                if (nameExpr == null)
                {
                    nameExpr = new MemberName(token.Value);
                }
                else
                {
                    nameExpr = new MemberName(nameExpr, Separators.Dot, token.Value);
                }

                token = Tokenizer.PeekToken();

                if (token.Is(Token.Period))
                {
                    GetNextToken();
                }
                else
                {
                    break;
                }
            }

            return nameExpr;
        }
Ejemplo n.º 10
0
        private void Initialize(MemberName baseClass, MemberName[] inplements)
        {
            BaseClass = baseClass;
            Implements = inplements;

            fields = new List<FieldDef>();
            constants = new List<Constant>();
            methods = new List<MethodDef>();
            nestedTypes = new List<TypeDef>();
        }
Ejemplo n.º 11
0
 public TypeDef(TypeDef parent, string name, MemberName baseClass, MemberName[] inplements, Modifier modifiers)
     : base(parent, new MemberName(parent.MemberName, Separators.Slash, name), modifiers)
 {
     Initialize(baseClass, inplements);
 }
 public TypeEntry[] GetTypes(MemberName name)
 {
     throw new Exception();
 }
 public NamespaceEntry GetNamespace(MemberName name)
 {
     throw new Exception();
 }