Hacker News new | ask | show | jobs
by aethertap 4768 days ago
This is great. I've wanted to build a similar tool for a couple of years, the distinction being that I want a structural grep utility. I'd pass in a pattern in the form of a code snippet (with pattern operators), and have the thing search for matching code structures. I suspect that this tool does 95% of what would be needed for that, very nice.
1 comments

It's not what you want, but, as perhaps a first step, there's an SGML sgrep (http://www.cs.helsinki.fi/u/jjaakkol/sgrep.html). Perhaps one might combine it with programming based on Oleg's SXML (http://okmij.org/ftp/Scheme/xml.html) and similar.

EDIT (fixing formatting, and …): I knew something else was nagging at me. The idea of a structural grep makes me think of Rob Pike's structural regular expressions (http://doc.cat-v.org/bell_labs/structural_regexps). The Sam editor (http://sam.cat-v.org) is based on this, and I thought I remembered a more modern version called something like 'e'; but, of course, such a name is impossible to Google.

Awesome, thanks for the links.