sgrep: grep with syntax-sensitive

Though there are lots of cross-reference tools nowadays, times to times we still
need to using grep to explore some codebases. grep is a great tool, but it is
not quiet well-suite for searching codes. grep is line-base. That makes it quiet
hard to match patterns like

1
2
3
4
5
6
int f()
{
    ....
    ....
    ....
}

via regex like f\([^)]*\) {. Thing is also true for assignment, and some
another syntaxes.

So here is the idea, why not create a grep-like tool but it could take the
syntax of a programming langugue as extra information to transform user’s regex
to a better-fit one for grepping. It try to check what kind of syntaxes the
user’s regex may fall into, and then generate a new regex, which will match any
string that could be reduced to the syntaxes. Since it is a regex to regex
transform tool, it will in fact be buildup on grep and do not require AST
constructing for every sources.

My First Post

Okay. So here is it, my blog. And this blog is all the way same as other
blogs. It will put my thoughts, ideas and some works if there is any:). And I
would like to talk about my self a little bit before everything actually
starts.

Basically, I am an IT geek and interested in system level programming
like compiler, interpreter, os etc. And I also like playing nodejs a lot. It’s
cool when things works. But of course, when some things broken, due to its
“callback nature”, there may be lots of pain to debug. I may want to build some
tools on it.

Hmmm, a very shorty short post. Anyway, hope it is a beginning rather
than an end ^_^.