There is no easy way to convert your grammar into generators. You must write them manually. And it will not be so difficult, because you already have a grammar. You can easily test your parser, but testing your controller can be quite problematic (but still possible). Before you begin, make sure your AST nodes can be compared with each other.
- Scalacheck allows you to create recursive properties, so you can easily create AST nodes.
- When you create your AST nodes, you can use Scalacheck and some additional knowledge about white spaces and their praise between the nodes translated into lines.
- Then you can pass the generated lines to the parser, you are going to check the code and compare them with a preformed AST
source share