using static Generator; public static class ParserGenerator { public static void Main() { Generate( "MixFixGenerated.cs", "using System.Collections.Immutable;\n" + "using S = Lexer.S;\n" + "using PrecedenceGroupName = System.String;", "public static partial class MixFix {", "}", "MixFix.", Types( Variant("Grammar", Case("ImmutableList", "Or"), Case("ImmutableList", "Sequence")), Variant("Fixity", Case("Closed"), Case("InfixLeftAssociative"), Case("InfixRightAssociative"), Case("InfixNonAssociative"), Case("Prefix"), Case("Postfix")), Variant("Associativity", Case("NonAssociative"), Case("LeftAssociative"), Case("RightAssociative")), Record("Operator", Field("PrecedenceGroupName", "precedenceGroup"), Field("Associativity", "associativity"), Field("ImmutableList", "parts")), Variant("Part", Case("S", "Name"), Case("ImmutableHashSet", "Hole")), Record("DAGNode", Field("ImmutableList", "infixLeftAssociative"), Field("ImmutableList", "infixRightAssociative"), Field("ImmutableList", "infixNonAssociative"), Field("ImmutableList", "prefix"), Field("ImmutableList", "postfix"), Field("ImmutableList", "closed")))); } }