I guess the next step beyond regular expressions are grammars, and
generic tools using grammars as parameters takes time to implement
and are not always useful.You have to know more than just the
syntactic structure of a programming language to make something interesting.
Emacs/Eclipse knows about the grammar of many programming languages.
Moreover, Coccinelle is not just a search/replace of syntactic constructs.
You have expression, function, and statement metavariables allowing
to match and move code and you can specify constraints about the
context of those entities.As val said:
"can make a particular change only in functions which are assigned to a function pointer in a particular type of array say, the create member of struct inode_operations." You need a way to specify such constraint.
I don't really understand how a packrat parser would help for that ...