It looks like just a simple change was needed to make this work. Other changes can be made to make the xml output prettier. And you can create xslt to make it compatible with other AST representations out there like JavaML or .NET CodeDom, or do things like transfer the AST XML back into boo code.
- In boo.lang.compiler/ast/node.cs, add an [System.Xml.Serialization.XmlIgnore] above the Entity property (line 95). (otherwise you get an error because an interface type (IEntity) can't be serialized)
- Add this to boo.lang.compiler/ast/statement.cs
Optional to make the XML a little prettier:
- Insert this at line 255 in scripts/astgen.boo:
if field.Name == "Name":
- Add an [System.Xml.Serialization.XmlAttribute] or [System.Xml.Serialization.XmlIgnore] above the IsSynthetic property in Node.cs.
I'll post a note to boo-dev with a sample script and its output.