using static Generator; public static class AstGenerator { public static void Main() { Generate( "AstGenerated.cs", "using System.Collections.Generic;", "namespace Ast {", "}", "Ast.", Types( Variant("Expr", Case("int", "Int"), Case("string", "String")), Variant("ParserResult", Case("(MixFix.Annotation, ParserResult)", "Annotated"), Case("Lexer.Lexeme", "Terminal"), Case("IEnumerable", "Productions")), Variant("ParserResult2", Case("ValueTuple>", "SamePrecedence")), Variant("OperatorOrHole", Case("ValueTuple>", "Operator"), Case("ParserResult2", "Hole")), Variant("SamePrecedenceOrTerminal", Case("ParserResult2", "SamePrecedence"), Case("Lexer.Lexeme", "Terminal")), Variant("AstNode", Case("Lexer.Lexeme", "Terminal"), Case("ValueTuple>", "Operator")))); } }