Пример #1
0
        private void ParseFiles()
        {
            enumeFiles = new List <FileEnum>();
            dimFiles   = new List <FileDim>();
            classFiles = new List <FileClass>();
            ZFileEngine parser = new ZFileEngine(projectContext);

            foreach (var item in projectModel.SouceFileList)
            {
                //ZFileEngine parser = new ZFileEngine(item, projectContext);
                FileType fileType = parser.Parse(item);
                if (fileType != null)
                {
                    if (fileType is FileEnum)
                    {
                        enumeFiles.Add(fileType as FileEnum);
                    }
                    else if (fileType is FileDim)
                    {
                        dimFiles.Add(fileType as FileDim);
                    }
                    else if (fileType is FileClass)
                    {
                        classFiles.Add(fileType as FileClass);
                    }
                    else
                    {
                        throw new CompileException();
                    }
                }
            }
        }
Пример #2
0
        private void CompileFiles()
        {
            ZFileEngine parser = new ZFileEngine(ProjectContext);

            foreach (var item in projectModel.SouceFileList)
            {
                FileAST fileType = parser.Parse(item);
                if (fileType != null)
                {
                    List <IZObj> zltypes = fileType.Compile();
                    foreach (var zltype in zltypes)
                    {
                        this.ProjectContext.CompiledTypes.Add(zltype);
                    }
                }
                else
                {
                    throw new CCException();
                }
            }
        }