This might seem like a strange question, but bear with me. I was looking to find out if there are any sort of structural specifications whereby I could deduce what kind of programming constructs are permissible within the method of an object-oriented class (preferably Java). For example, in a Java method, you can define local variables, object references, try/catch blocks etc… but you cannot, for example, define a constructor or another method. Does this make sense?
Why do I want to find this information out? The reason is that I wish to take a method and analyse it and print out any declared local variable names, any declared reference names, any instance variables that are used in the method etc… So, ultimately, I was wondering if there are any structural specifications out there on the web that might tell me what you are allowed to include in a Java method (or an object-oriented method). I suppose this is tantamount to a grammar that you would use for a domain specific language.
Would you perhaps be looking for the grammar used in the Java reference implementation?