antlr/intellij-plugin-v4 — pull request #154 by ponomandr (2014-12-22 20:28:04+00:00)
Title: If package is not configured for the grammar file, get it from relative path

I believe antlr4-maven-plugin does something similar.