Updated on 2019-08-16
Quickly and easily build parsers and tokenizers using Pck's editor
This is part of a series of articles on PCK - The Parser Construction Kit.
I've covered the FA/regex engine as well as the LL(1) and LALR(1) generation.
Rather than rehash that material, I encourage you to peruse it.
This is a small GUI editor for PCK and XBNF files that lets you generate PCKs, parsers and tokenizers rapidly.
Simply create or load a document - usually an XBNF file.
You can edit XBNF files, PCK files, even C# and Visual Basic files in the editor. Depending on which type of document is active, the build menu may have some or all of the operations disabled.
Any build operations are done on the current active document.
Once you've entered it, use the Build menu to turn it into a parser, a tokenizer, or a PCK spec.
Note that to create a matching tokenizer for an LL(1) parser, you must use the menu item for the LL(1) version of the tokenizer, or create the tokenizer from an already factored PCK specification. Failure to do so will lead to a tokenizer with the wrong symbol table, which will cause the parser to fail to parse the input.
Messages, warnings and errors are reported in a the message view below the text editor. Clicking on a line will send you to the associated position in the relevant file if there is one - similar to Visual Studio. Often, there is no associated file, because the intermediary PCK is generated in memory and has no associated file. You can generate the PCK explicitly if you like. Then errors will have line numbers within the PCK document, even if that document hasn't been saved yet.
Unlike Visual Studio, the documents do not have to be saved for you to build from them, and building from them will not cause them to be saved. The only time a file is written is when you choose to save one.
You can set the code generation language in the Options menu but Visual Basic's code dom provider is buggy and probably won't work for you until I find a workaround that doesn't puke all over my design.
I embedded an old copy of ICSharpCode.TextEditor into this project, which I use for syntax highlighting.
The editor was originally based on this submission by Qwertie, which has been modified extensively to be suited for this project.