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); }
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(); } }
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(); } }