The idea would be to use an existing grammar and to modify it automatically (or semi-automatically), to be able to derive a dedicated language for matching expression/code in this language.
Let's say I have a grammar for C, I would like to derive a grammar for C-matcher that allows the user to write C code augumented with specific matching directive and that produces, at the end, a fully functionnal matcher.