Example #1
0
        public bool Compile(CodeFile[] CodeFiles, List <AssemblyPath> Assemblies = null, List <IncBinReference> IncBins = null)
        {
            Reset();
            InitializeScopes(CodeFiles);
            DefineMacroes();

            if (Assemblies != null)
            {
                var RetValue = true;
                for (var i = 0; i < Assemblies.Count; i++)
                {
                    if (GlobalContainer.GetLoadedAssembly(Assemblies[i].Name) == null)
                    {
                        if (GlobalContainer.LoadAssembly(Assemblies[i]) == null)
                        {
                            RetValue = false;
                        }
                    }
                }

                if (!RetValue)
                {
                    return(false);
                }
            }

            if (IncBins != null)
            {
                var RetValue = true;
                for (var i = 0; i < IncBins.Count; i++)
                {
                    var File     = IncBins[i].File;
                    var FileInfo = new FileInfo(File);

                    if (!FileInfo.Exists)
                    {
                        Messages.Add(MessageId.FileDoesntExists, new CodeString(File));
                        RetValue = false;
                        continue;
                    }

                    var IncBin = new IncludedBinary(IncBins[i].Name, File, FileInfo.Length);
                    GlobalContainer.IncludedBinaries.Add(IncBin);
                }

                if (!RetValue)
                {
                    return(false);
                }
            }

            GlobalContainer.SearchCommonIdentifiers();
            return(Arch.Compile(this, CodeFiles));
        }
Example #2
0
 public DataPointerNode(CodeString Code, IncludedBinary IncBin, ExpressionFlags Flags = ExpressionFlags.None)
     : base(Code, Flags)
 {
     this.DescPointerType = DataPointerType.IncBin;
     this.IncBin          = IncBin;
 }