In a language built on top of Java (so I cannot use regular parsers) I want to parse several sourc code files an extract the following information:
- name and extends/implements part of public (inner) classes
- public method declarations
So for a given file
public class A extends B {
private int foo
public int getFoo() {
...
}
private class Inner1 {
}
public class Inner2 {
}
}
I would like to get with a single or several Regexps:
public class A extends B
public int getFoo()
public class Inner2
Let me know if this isn’t quite complex enough, but it will basically look for “public” followed by a space, then anything that isn’t an opening curly brace:
Output is below: