Skip to content

Instantly share code, notes, and snippets.

@matthewkastor
matthewkastor / README.md
Created September 13, 2013 06:47
A jison file with comments about jison file structure and demonstrating how to create a grammar that can recognize comments.

The jison grammar file describes a parser that recognizes HTML style comments. It should be simple to change the grammar to recognize any other markup for multiline comments. I've put a lot of notes in the grammar file about it's structure and links to where I found the information.

To generate the comment parser you'll need jison installed. Then run commentsParserGenerator.js through Node, it will read comments.jison and generate the parser as comments.js. It will then run comments.js over comments.txt and display the results.