2 ms·
If you use Emacs, it's particularly easy to learn them by experimenting with M-x re-builder. Hey! I did not know about this, and it looks really useful. I've u
by gruseom 18y ago
If you use Emacs, it's particularly easy to learn them by experimenting with M-x re-builder.
Hey! I did not know about this, and it looks really useful. I've used http://www.newartisans.com/blog_files/regex.tool.for.emacs.php http://www.newartisans.com/blog_files/regex.tool.for.emacs.p... and it's good, but not as well integrated.
I wish I knew a better way to get a survey of what's available in the Emacs world - something that would have clued me in to this command, for example... any tips?
Edit: I want to comment on this as well:
learning a lexer/parser is the next step
Recently I've had occasion to write a few parsers. In the past, I'd always used parser generators (yacc and antlr) on the assumption that they made things easier. For this project that wasn't an option, so I bit the bullet and did the recursive descent thing. To my surprise, it turned out to be way, way easier than I expected. Moreover, in at least one case (a complex one), the hand-written parser code turned out shorter than the (cl-) yacc version, as well as handling more cases and reporting errors better.
The morals of the story are: (1) Don't assume something is hard without trying it; (2) It's not hard to write a classical recursive-descent parser and the skill is a lot more useful than you may realize. Wish I'd learned that a long time ago.
- litewulf 18y agoThat being said, RDPs have quite a bit of boilerplate that may obscure your grammar. (And small bugs in a RDP are sometimes very hard to catch...)
- mark_h 18y agoI wish I knew a better way to get a survey of what's available in the Emacs world - something that would have clued me in to this command, for example... any tips? http://planet.emacsen.org/ http://planet.emacsen.org/ often has useful stuff. The emacs wiki (http://emacswiki.org/ http://emacswiki.org/) is often where you end up after googling and has a heap of information (although even it isn't complete!). You could try http://www.emacswiki.org/cgi-bin/wiki/RandomPage http://www.emacswiki.org/cgi-bin/wiki/RandomPage when you're bored :)
- silentbicycle 18y agoI second Emacswiki as suggested, but I find quite a bit by searching through the Emacs and Elisp info pages and using M-x apropos / M-x apropos-variable. It doesn't always work though - to find something, you generally need to know what Emacs calls it.