It ought to be possible to define a DSL or simple framework upon which to build a structural editor for a given language.
- Optional nodes.
- Lists of notes, separated by some thing.
- Text input boxes.
These, probably with a couple other things, should be sufficient to define a fairly complete editor for a language.
I made a very simple incomplete one just to demo the idea, in the web/haskell/ directory.
The concept should be suited to web, or Emacs, or Vim, or whatever editor has strong enough extensibility.
I strongly encourage anyone reading this to re-implement completely the web idea, or do it in Emacs, etc. The demo implementation I put in web/haskell/ is just that, a demo. See video here: http://www.youtube.com/watch?v=v2ypDcUM06U
UPDATE: Looks like only Chrome likes the web/haskell implementation. Doesn't matter much, but thought I'd mention.