1

For a Hobby Project of mine which includes a Compiler I need to Analyse class Files generated by scalac.

To be Specific I need to do the Following:

  1. Find the Generic Arguments of a Class inkl. Higher order Kinds
  2. Find Methods Anotated with a Specific Annotation
  3. Find the Scala specific Signature of the Method inkl. Higher order Kinds

I know, that I could use scala Reflection, but I would prefer not to load the class during compiletime if possible, because this neads all the runtime dependency to be on the class path during compiletime and furter may excecute static initializers.

Is their any Library or other Tool which could simplify the task of scala class file analysis.

0__
  • 66,707
  • 21
  • 171
  • 266
Markus Knecht
  • 430
  • 4
  • 10
  • I imagine you could raid https://github.com/scala/scala/blob/2.12.x/src/reflect/scala/reflect/internal/pickling/UnPickler.scala for code and/or ideas. This is the part of the Scala compiler itself which reads class files (and ScalaSig attributes) generated by earlier compilation runs. (And note that the pickling/unpickling code inside scalac should not be confused with https://github.com/scala/pickling, which is entirely different.) – Seth Tisue Dec 28 '15 at 17:17

0 Answers0