Actually now that I've thought about it more, I think modeling directly after the grammar structure is the wrong way to go. This forces processors to build in their own logic to match the semantics of kotlin language. For example, if I want to work on public methods, I want all methods that are public, not methods that literally have the public modifier defined. Telling the difference actually sounds dangerous here since it means semantically identical programs could behave differently under the presence of a processor which seems like a very bad idea to me.