LALR.
Why? well you will have nested bracket structures even in text....
Mediawiki fails here, it seams to be just some regular expressions matching.. :-(
Ok I found this nice parser JS/CC by Jan Max Meyer,
a great tool beacuse:
- its completly done in javascript, so you can parse at the client like on the server
- has a flexible template mechanism
an this great Code Editor: CodeMirror by Marijn Haverbeke.
I liked it more that all the others because:
- It uses a parser, and you can extend it with your own parser.
- It supports long documents, as each line brack has a own copy of the parser state (a continuation sort of. So for the next line simply take the parser an continue parsing.
- It supports undo/redo
- You can earn a lot of programming techniques by looking at the code :-)
I created an js/cc driver_editor.js_ template which can be used to create a parser that fits right into the CodeMirror editor ...anybody interested? Send an email to me :-)
-
3 comments:
This is a good idea. I'd be interested in this!
More than 1 year after this post, what is the state of the art?
Hi, stumbled upon this post about codemirror and grammars.
You might like this add-on for codemirror:
https://github.com/foo123/codemirror-grammar
PS: i am the author
Cheers,
Nikos
Post a Comment