예제 #1
0
        /// <nodoc />
        public DownloadData(
            FrontEndContext context,
            IDownloadFileSettings settings,
            Uri downloadUri,
            AbsolutePath resolverRoot,
            ContentHash?contentHash)
        {
            Contract.Requires(context != null);
            Contract.Requires(settings != null);
            Contract.Requires(downloadUri != null);
            Contract.Requires(resolverRoot.IsValid);

            Settings    = settings;
            DownloadUri = downloadUri;

            ModuleRoot = resolverRoot.Combine(context.PathTable, settings.ModuleName);

            var fileName = settings.FileName;

            if (string.IsNullOrEmpty(fileName))
            {
                fileName = Path.GetFileName(downloadUri.AbsolutePath.TrimEnd(new[] { '/', '\\' }));
            }

            DownloadedFilePath = ModuleRoot.Combine(context.PathTable, "f").Combine(context.PathTable, fileName);

            ContentsFolder = settings.ArchiveType == DownloadArchiveType.File ? DirectoryArtifact.Invalid : DirectoryArtifact.CreateWithZeroPartialSealId(ModuleRoot.Combine(context.PathTable, "c"));

            ModuleConfigFile     = ModuleRoot.Combine(context.PathTable, "module.config.dsc");
            ModuleSpecFile       = ModuleRoot.Combine(context.PathTable, "project.dsc");
            DownloadManifestFile = ModuleRoot.Combine(context.PathTable, "manifest.download.txt");
            ExtractManifestFile  = ModuleRoot.Combine(context.PathTable, "manifest.extract.txt");

            ContentHash = contentHash;
        }
예제 #2
0
    public void Load(string path)
    {
        var serializer = new XmlSerializer(typeof(ModuleRoot));

        using (var stream = XmlReader.Create(path)) {
            ModuleRoot cur = serializer.Deserialize(stream) as ModuleRoot;
            modules = cur.modules;
            stream.Close();
        }
    }
예제 #3
0
        public SyntaxTreeNode ParseModule(string module)
        {
            ModuleRoot moduleRoot = new ModuleRoot(module);

            while (Match(tkImport))
            {
                Statement import = ParseImportStatement();
                if (import.Childs.Count > 0)
                {
                    moduleRoot.AddNode(import);
                }
                if (moduleRoot.Childs.Count > 0 && IsErrored(moduleRoot.Childs.Last()))
                {
                    return(moduleRoot);
                }
            }

            while (Match(tkGlobal))
            {
                moduleRoot.AddNode(ParseGlobalDeclarationStatement());
                if (IsErrored(moduleRoot.Childs.Last()))
                {
                    return(moduleRoot);
                }
            }

            while (!Match(tkEOF))
            {
                moduleRoot.AddNode(ParseMethodDeclaration());
                if (IsErrored(moduleRoot.Childs.Last()))
                {
                    return(moduleRoot);
                }
            }
            return(moduleRoot);
        }
 // Use this for initialization
 void Start()
 {
     heads = new ModuleRoot();
     heads.Load("Assets\\Modules\\head.xml");
     Debug.Log(heads.modules[0].name);
 }