Thomas E Enebo wrote:
> On Mon, 29 May 2006, Lukas Felber defenestrated me:
>   
>> I (Lukas Felber) am one of the three Swiss guys working on refactorings 
>> for the RDT eclipse plugin.
>>
>> I have a Question concerning the common Classes of Ruby (like Object or 
>> String). Is there a way to get to the JRuby Ast of those classes. I know 
>> how I can create an Ast out of a file I have. Do I need to know where 
>> the Rubyfile for a Class (e.g. String) lies to get to the Ast of the 
>> Class or is there an other way?
>>     
>
>   We do not directly link back to AST from an object (if this is what
> you are asking).  That would not work well since multiple AST nodes could
> reference the same object.
>   
Ok I think I expressed myself a bit bad. I'll make an example to to show 
you what I'd like to have.
Here a simple Ruby file:

class X < Dir
end

What I need is the AST of the Class "Dir" (I want to get to its 
constructor).
If I parse the example file I get a ClassNode. The method getSuperNode 
gives me a node containing the
String "Dir". I would like to have way to get to the AST of the class 
"Dir" over the String "Dir".
Of course "Dir" is only an example. It stands for any Built-in Class of 
ruby.

I hope I expressed myself better this time.
>   In ThreadContext we do have a reference to the current position of
> evaluation in the thread it represents.   I am not sure if this would
> be useful for your purposes or not.
>
> -Tom
>
>   
Thanks for all your help.
Lukas



_______________________________________________
Jruby-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jruby-devel

Reply via email to