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.