CFG Playground

This page contains a version of both the CFG builder and the CFG parser. In the upper field of the CFG builder you can add new rules by filling in the fields and clicking the green plus sign. A rule is deleted by clicking the red cross behind the rule. There you will also see arrows to move rules up or down (this does not influence the working of the grammar and is purely there for aesthetic reasons).

After you have made a context-free grammar with the builder, you may test your grammar with the parser below it. Just type in a string you think it should be able to handle in the 'Sample' field. Adjust the symbol in the 'Parse as' field if you are trying to parse something different than a sentence (or have used a different symbol for sentence in your grammar). The 'Show Earley parse process' option should only be set to 'yes' if you are interested in the steps an Earley parser takes to do a parse.

@

Sample:
Parse as:
Show Earley parse process?