public void Next()
 {
     if (runtimeData.InstructionStack.Count > 0)
     {
         int id = runtimeData.InstructionStack.Pop();
         if (id == InstructionStack.ROOT_FLAG)
         {
             root.Accept(visitor);
         }
         else if (id == InstructionStack.CLOSE_LOCAL_SCOPE_FLAG)
         {
             runtimeData.ScopeStack.Close();
             Next();
         }
         else if (id == InstructionStack.CLOSE_FORMAL_SCOPE_FLAG)
         {
             runtimeData.ScopeStack.Close();
             Next();
         }
         else if (id == InstructionStack.CALL_FLAG)
         {
             CallStackElement elem = runtimeData.CallStack.Pop();
             Next();
         }
         else
         {
             root.NodeMap[id].Accept(visitor);
         }
     }
     else
     {
         funcCaller.End();
     }
 }
Beispiel #2
0
        public void Build(string[] plotFiles, FireMLRoot root)
        {
            foreach (string file in plotFiles)
            {
                this.file = file;
                xmlError  = false;
                //FINISH: 检查XML语法
                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.Schemas = kernel.FireMLSchemaSet;
                try
                {
                    xmlDoc.Load(file);
                }
                catch (Exception e)
                {
                    kernel.IssueError(ErrorType.ReadFileError, e.Message, new Location(file));
                    continue;
                }
                xmlDoc.Validate(new ValidationEventHandler(settings_ValidationEventHandler));
                if (xmlError)
                {
                    continue;
                }


                XmlTextReader reader;
                try
                {
                    reader = new XmlTextReader(file);
                }
                catch (Exception e)
                {
                    kernel.IssueError(ErrorType.ReadFileError, e.Message, new Location(file));
                    continue;
                }


                for (; reader.Name != "FireML"; reader.Read())
                {
                    ;
                }
                reader.MoveToContent();

                this.reader = reader;

                root.Accept(this);
            }
        }
        /*
        #region IAssetVisitor Members

        public void Visit(ActorAsset actorAsset, object[] args)
        {
            CheckContent(actorAsset.Source, ContentType.Texture, actorAsset.Location);
        }

        public void Visit(CGAsset cgAsset, object[] args)
        {
            CheckContent(cgAsset.Source, ContentType.Texture, cgAsset.Location);
        }

        public void Visit(MusicAsset musicAsset, object[] args)
        {
            CheckContent(musicAsset.Source, ContentType.Music, musicAsset.Location);
        }

        public void Visit(VideoAsset videoAsset, object[] args)
        {
            CheckContent(videoAsset.Source, ContentType.Video, videoAsset.Location);
        }

        #endregion
        */
        public void Check(FireMLRoot root)
        {
            root.Accept(this);
        }
 public BsonExporterASTVisitor(FireMLRoot root)
 {
     parentStack = new Stack <BsonDocument>();
     fireMLRoot  = root;
     fireMLRoot.Accept(this);
 }
Beispiel #5
0
 public void Check(FireMLRoot root)
 {
     this.root = root;
     root.Accept(this);
 }
 public void Check(FireMLRoot root)
 {
     this.root = root;
     root.Accept(this);
 }
Beispiel #7
0
        /*
         #region IAssetVisitor Members
         *
         * public void Visit(ActorAsset actorAsset, object[] args)
         * {
         *  CheckContent(actorAsset.Source, ContentType.Texture, actorAsset.Location);
         * }
         *
         * public void Visit(CGAsset cgAsset, object[] args)
         * {
         *  CheckContent(cgAsset.Source, ContentType.Texture, cgAsset.Location);
         * }
         *
         * public void Visit(MusicAsset musicAsset, object[] args)
         * {
         *  CheckContent(musicAsset.Source, ContentType.Music, musicAsset.Location);
         * }
         *
         * public void Visit(VideoAsset videoAsset, object[] args)
         * {
         *  CheckContent(videoAsset.Source, ContentType.Video, videoAsset.Location);
         * }
         *
         #endregion
         */

        public void Check(FireMLRoot root)
        {
            root.Accept(this);
        }