Ruby Parser

View: New views
5 Messages — Rating Filter:   Alert me  

Ruby Parser

by sback :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I am trying to extract the object-oriented model of a generic Ruby system.

It means that I would like to know:

class names,
methods in each class,
methods arguments,
lines of code per method,
class hierarchies,
...

I have the whole source code, and then I would like to parse it using Java
to get all the data I need.

Do you think I can use the Parser in JRuby to accomplish such a task?

If so, where can I find some documentation about this parser usage?
(are there tests, or javadoc, or examples?)

Thank you very much in advance,

Alberto

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Ruby Parser

by Nick Sieger-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Jun 26, 2009 at 12:06 PM, Alberto Bacchelli<sback@...> wrote:

> Hi,
>
> I am trying to extract the object-oriented model of a generic Ruby system.
>
> It means that I would like to know:
>
> class names,
> methods in each class,
> methods arguments,
> lines of code per method,
> class hierarchies,
> ...
>
> I have the whole source code, and then I would like to parse it using Java
> to get all the data I need.
>
> Do you think I can use the Parser in JRuby to accomplish such a task?
>
> If so, where can I find some documentation about this parser usage?
> (are there tests, or javadoc, or examples?)
>
> Thank you very much in advance,
>
> Alberto

When you say "whole source code", I'm not sure if you meant JRuby's
own source code, or that of the JRuby parser project:

http://kenai.com/projects/jruby-parser

In case you hadn't heard of the latter, it's probably exactly what you want.

Cheers,
/Nick

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Ruby Parser

by sback :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

It is exactly what I was looking for! Thank you!
Do you know if there is some documentation/examples for it somewhere?

Thank you again,
Alberto

2009/6/26 Nick Sieger <nicksieger@...>:

> On Fri, Jun 26, 2009 at 12:06 PM, Alberto Bacchelli<sback@...> wrote:
>> Hi,
>>
>> I am trying to extract the object-oriented model of a generic Ruby system.
>>
>> It means that I would like to know:
>>
>> class names,
>> methods in each class,
>> methods arguments,
>> lines of code per method,
>> class hierarchies,
>> ...
>>
>> I have the whole source code, and then I would like to parse it using Java
>> to get all the data I need.
>>
>> Do you think I can use the Parser in JRuby to accomplish such a task?
>>
>> If so, where can I find some documentation about this parser usage?
>> (are there tests, or javadoc, or examples?)
>>
>> Thank you very much in advance,
>>
>> Alberto
>
> When you say "whole source code", I'm not sure if you meant JRuby's
> own source code, or that of the JRuby parser project:
>
> http://kenai.com/projects/jruby-parser
>
> In case you hadn't heard of the latter, it's probably exactly what you want.
>
> Cheers,
> /Nick
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Ruby Parser

by Nick Sieger-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Looks like there's a sample here of actually using it from Ruby with
JRuby's java integration:

http://kenai.com/projects/jruby-parser/sources/mercurial/content/sample/simple.rb?rev=26

If you want to use it in pure Java it shouldn't be hard to translate that over.

/Nick

On Tue, Jun 30, 2009 at 11:42 AM, Alberto Bacchelli<sback@...> wrote:

> It is exactly what I was looking for! Thank you!
> Do you know if there is some documentation/examples for it somewhere?
>
> Thank you again,
> Alberto
>
> 2009/6/26 Nick Sieger <nicksieger@...>:
>> On Fri, Jun 26, 2009 at 12:06 PM, Alberto Bacchelli<sback@...> wrote:
>>> Hi,
>>>
>>> I am trying to extract the object-oriented model of a generic Ruby system.
>>>
>>> It means that I would like to know:
>>>
>>> class names,
>>> methods in each class,
>>> methods arguments,
>>> lines of code per method,
>>> class hierarchies,
>>> ...
>>>
>>> I have the whole source code, and then I would like to parse it using Java
>>> to get all the data I need.
>>>
>>> Do you think I can use the Parser in JRuby to accomplish such a task?
>>>
>>> If so, where can I find some documentation about this parser usage?
>>> (are there tests, or javadoc, or examples?)
>>>
>>> Thank you very much in advance,
>>>
>>> Alberto
>>
>> When you say "whole source code", I'm not sure if you meant JRuby's
>> own source code, or that of the JRuby parser project:
>>
>> http://kenai.com/projects/jruby-parser
>>
>> In case you hadn't heard of the latter, it's probably exactly what you want.
>>
>> Cheers,
>> /Nick
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Ruby Parser

by sback :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I was looking at the same example, so we agree that it is a good one :)

Thank you for your help.

Ciao,
Alberto

2009/6/30 Nick Sieger <nicksieger@...>:

> Looks like there's a sample here of actually using it from Ruby with
> JRuby's java integration:
>
> http://kenai.com/projects/jruby-parser/sources/mercurial/content/sample/simple.rb?rev=26
>
> If you want to use it in pure Java it shouldn't be hard to translate that over.
>
> /Nick
>
> On Tue, Jun 30, 2009 at 11:42 AM, Alberto Bacchelli<sback@...> wrote:
>> It is exactly what I was looking for! Thank you!
>> Do you know if there is some documentation/examples for it somewhere?
>>
>> Thank you again,
>> Alberto
>>
>> 2009/6/26 Nick Sieger <nicksieger@...>:
>>> On Fri, Jun 26, 2009 at 12:06 PM, Alberto Bacchelli<sback@...> wrote:
>>>> Hi,
>>>>
>>>> I am trying to extract the object-oriented model of a generic Ruby system.
>>>>
>>>> It means that I would like to know:
>>>>
>>>> class names,
>>>> methods in each class,
>>>> methods arguments,
>>>> lines of code per method,
>>>> class hierarchies,
>>>> ...
>>>>
>>>> I have the whole source code, and then I would like to parse it using Java
>>>> to get all the data I need.
>>>>
>>>> Do you think I can use the Parser in JRuby to accomplish such a task?
>>>>
>>>> If so, where can I find some documentation about this parser usage?
>>>> (are there tests, or javadoc, or examples?)
>>>>
>>>> Thank you very much in advance,
>>>>
>>>> Alberto
>>>
>>> When you say "whole source code", I'm not sure if you meant JRuby's
>>> own source code, or that of the JRuby parser project:
>>>
>>> http://kenai.com/projects/jruby-parser
>>>
>>> In case you hadn't heard of the latter, it's probably exactly what you want.
>>>
>>> Cheers,
>>> /Nick
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe from this list, please visit:
>>>
>>>    http://xircles.codehaus.org/manage_email
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email