Hi, I'm doing some work with JRuby's ast, and I've run into a few questions about how the various classes are wired together.
Any hints on the below would be very helpful - I'm making notes as I go and would be very happy to polish them for a wiki page or javadoc comments if that would be useful. Apologies if these are covered somewhere on the wiki and I missed it - a pointer to docs and instructions to RTF them would be most welcome. *Scoping *What's the difference between a LocalStaticScope and a BlockStaticScope ? What's the correct way to initialise a top-level static scope - is it: StaticScope scope = new LocalStaticScope(null); or something else? Are class and method body scopes considered top-level or should a method body scope have the class scope as an enclosing scope? Or does this answer depend on closures. *Arguments and Method calls* How do ArgsNodes work? What do the special values for restArguments mean (-1 and -2 seem to be special somehow) -1 crops up explicitly in a few places and there's a boundary test for -2. What do static and instance methods ArgsNodes look like? Ie, if I was calling the ArgsNodes constructor corresponding to a static or an instance method, how would this look? *Current State* My current status is that I have a very simple ast (programatically built from scratch) which I can feed into the jruby compiler and have it compile but the resulting JVM bytecode fails verification - I suspect because I don't fully understand ArgsNodes yet, which is causing the verifier's stack underflow check to fail. Btw, is there a way to ask JRuby to just produce an ast from a .rb, output it and stop? Or is it just a case of using jdb and a breakpoint? Thanks, Ben
