I want to go through a code base and systematically find 1) where each token is defined and 2) where each token is used. (find useages with various options). There are a number of ways to do this but why reinvent the wheel when IntelliJ already does this. Since the Intellij source is the code base I am targeting it makes sense to use the IntelliJ API . Can you give me an idea of whqat API I would use to do 1 and 2 above?