コード例 #1
0
ファイル: Compiler.cs プロジェクト: resonancellc/nquery
            private static void WriteAstToFile(AstNode node, string phaseName, int phaseNumber)
            {
                string numberedPhaseName = String.Format(CultureInfo.InvariantCulture, "{0}-{1}", phaseNumber, phaseName);
                string fileName          = Path.ChangeExtension(numberedPhaseName, ".xml");

                fileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, fileName);
                XmlProducer.ProduceFile(fileName, node);
            }
コード例 #2
0
ファイル: XmlProducer.cs プロジェクト: chenzuo/nquery
		public static void ProduceFile(string fileName, AstNode node)
		{
			using (StreamWriter sw = new StreamWriter(fileName))
			{
				XmlTextWriter xmlWriter = new XmlTextWriter(sw);
				XmlProducer producer = new XmlProducer(xmlWriter);

				xmlWriter.WriteStartElement("ast");
				if (node != null)
					producer.Visit(node);
				xmlWriter.WriteEndElement();
			}
		}
コード例 #3
0
        public static void ProduceFile(string fileName, AstNode node)
        {
            using (StreamWriter sw = new StreamWriter(fileName))
            {
                XmlTextWriter xmlWriter = new XmlTextWriter(sw);
                XmlProducer   producer  = new XmlProducer(xmlWriter);

                xmlWriter.WriteStartElement("ast");
                if (node != null)
                {
                    producer.Visit(node);
                }
                xmlWriter.WriteEndElement();
            }
        }