public void TestSerialize() { using(var writer = new StringWriter()) { var astObj = new HsModule { Location = new SrcLoc { Line = 1, Column = 1 }, Module = new Module { Name = "Crash" }, Body = new System.Collections.Generic.List<HsDecl>(new HsDecl [] { new HsTypeSig { Names = new System.Collections.Generic.List<HsName>( new [] { new HsName { Name = "main", } } ), Type = new HsQualType { Context = new HsContext { Assertions = new System.Collections.Generic.List<HsAsst>(new [] { new HsAsst { Name = new UnQual { Name = new HsName { Name = "Nya", }, }, } }), }, Type = new HsTyApp { First = new HsTyCon { Name = new UnQual { Name = new HsName { Name = "IO", }, }, }, Second = new HsTyCon { Name = new Special { Value = new HsUnitCon {}, }, }, } }, }, }), }; var dumper = new DOMLoader(); dumper.save(writer, astObj); Console.WriteLine("Output: {0}", writer.ToString()); } }
public virtual void visit(HsModule node) { Console.WriteLine("Visiting {0}", node.ToString()); }
public virtual void visit(HsModule node) { }