Exemple #1
0
        static bool CreateAndDeclareRecursively(IdContainer Container, ConstDeclarationList Out)
        {
            var RetValue = true;
            var State    = Container.State;
            var Scope    = Container as NonCodeScope;

            if (Scope != null && Scope.Code.IsValid)
            {
                if (!State.Language.ConstDeclRecognizer.Recognize(Scope, Out))
                {
                    RetValue = false;
                }
            }

            for (var i = 0; i < Container.Children.Count; i++)
            {
                var e = Container.Children[i];
                if (!CreateAndDeclareRecursively(e, Out))
                {
                    RetValue = false;
                }
            }

            return(RetValue);
        }
Exemple #2
0
        public static ConstDeclarationList Create(NonCodeScope Scope)
        {
            var Ret = new ConstDeclarationList();
            var Rec = Scope.State.Language.ConstDeclRecognizer;

            return(Rec != null && !Rec.Recognize(Scope, Ret) ? null : Ret);
        }
Exemple #3
0
        bool ProcessTypes(List <Identifier> Out)
        {
            var Aliases    = new AliasDeclarationList();
            var Namespaces = NamespaceDeclList.CreateAndDeclareRecursively(this);

            if (Namespaces == null)
            {
                return(false);
            }

            if (!Aliases.RecognizeRecursively(this))
            {
                return(false);
            }
            if (!Aliases.Declare(false))
            {
                return(false);
            }

            var Types = TypeDeclarationList.CreateAndDeclareRecursively(this);

            if (Types == null)
            {
                return(false);
            }

            SearchCommonIdentifiers();
            if (!Aliases.Recognize(Types))
            {
                return(false);
            }
            if (!Aliases.Declare(false))
            {
                return(false);
            }

            var Consts = ConstDeclarationList.CreateAndDeclareRecursively(this);

            if (Consts == null || !Aliases.Declare(false))
            {
                return(false);
            }

            if (!ProcessClassBases(this))
            {
                return(false);
            }
            if (!ProcessScopes(this, Out))
            {
                return(false);
            }

            Flags |= GlobalContainerFlags.StructureMembersParsed;
            if (!ProcessStructureIdentifiers(this))
            {
                return(false);
            }
            return(Aliases.Declare());
        }
Exemple #4
0
        public static ConstDeclarationList CreateAndDeclareRecursively(IdContainer Container)
        {
            var Ret = new ConstDeclarationList();

            if (Container.State.Language.ConstDeclRecognizer != null)
            {
                if (!CreateAndDeclareRecursively(Container, Ret))
                {
                    return(null);
                }

                if (!CalcValue(Ret))
                {
                    return(null);
                }
                if (!Ret.Resolve())
                {
                    return(null);
                }
            }

            return(Ret);
        }