using static Generator; public static class ParserGenerator { public static void Main() { Generate( "ParserGenerated.cs", "using System.Collections.Generic;\n" + "using S = Lexer.S;", "public static partial class Parser {", "}", "Parser.", Types( Variant("Grammar", Case("List", "Or"), Case("List", "Sequence")), Variant("Fixity", Case("Closed"), Case("InfixLeftAssociative"), Case("InfixRightAssociative"), Case("InfixNonAssociative"), Case("Prefix"), Case("Postfix"), Case("Terminal")), Record("Operator", Field("List", "Parts"), Field("List", "Holes")), Record("Closed", Field("S", "openSymbol"), Field("S", "closedSymbol")), Record("DAGNode", Field("List", "infixLeftAssociative"), Field("List", "infixRightAssociative"), Field("List", "infixNonAssociative"), Field("List", "prefix"), Field("List", "postfix"), Field("List", "closed"), Field("List", "terminal"), Field("List", "successors")))); } }