[ANN] ParseTree 1.0.0 Released

ParseTree version 1.0.0 has been released!

   http://www.zenspider.com/ZSS/Products/ParseTree/

** DESCRIPTION:

ParseTree is a C extension (using RubyInline) that extracts the parse
tree for an entire class or a specific method and returns it as a
s-expression (aka sexp) using ruby's arrays, strings, symbols, and
integers.

As an example:

   def conditional1(arg1)
     if arg1 == 0 then
       return 1
     end
     return 0
   end

becomes:

   [:defn,
     "conditional1",
     [:scope,
      [:block,
       [:args, "arg1"],
       [:if,
        [:call, [:lvar, "arg1"], "==", [:array, [:lit, 0]]],
        [:return, [:lit, 1]],
        nil],
       [:return, [:lit, 0]]]]]

** FEATURES/PROBLEMS:

+ Uses RubyInline, so it just drops in.
+ Includes show.rb, which lets you quickly snoop code.
+ Includes abc.rb, which lets you get abc metrics on code.
  + abc metrics = # of assignments, branches, and calls
  + whitespace independent metric for method complexity.
+ Only works on methods in classes/modules, not arbitrary code.
+ Does not work on the core classes, as they are not ruby (yet).

   http://www.zenspider.com/ZSS/Products/ParseTree/

Changes:

+ 1 major enhancement
  + Birthday!

   http://www.zenspider.com/ZSS/Products/ParseTree/

Cool !

Ryan Davis wrote:

ParseTree version 1.0.0 has been released!

  zenspider projects | software projects | by ryan davis

Where can I download the package?
The download link does not list this one ... or did I just miss it?

<snip>

Changes:

+ 1 major enhancement
    + Birthday!

Happy Birthday !!

  zenspider projects | software projects | by ryan davis

-- shanko

Hello Ryan,

ParseTree version 1.0.0 has been released!

   zenspider projects | software projects | by ryan davis

** DESCRIPTION:

Thanks for the release.

Can you tell me why the following nodes don't have a corresponding
element in the result tree ? Are they not used anymore in the ruby
interpreter ?

    case NODE_BLOCK_ARG:
    case NODE_SELF:
    case NODE_NIL:
    case NODE_TRUE:
    case NODE_FALSE:
    case NODE_ZSUPER:
    case NODE_BMETHOD:
    case NODE_REDO:
    case NODE_RETRY:
    case NODE_COLON3:
    case NODE_NTH_REF:
    case NODE_BACK_REF:
    case NODE_ZARRAY:
    case NODE_XSTR:
    case NODE_UNDEF:
    case NODE_ALIAS:
    case NODE_VALIAS:

···

--
Best regards, emailto: scholz at scriptolutions dot com
Lothar Scholz http://www.ruby-ide.com
CTO Scriptolutions Ruby, PHP, Python IDE 's

It was just updated, you can download from:

http://rubyforge.org/frs/?group_id=439

···

On Nov 10, 2004, at 4:38 PM, Shashank Date wrote:

Cool !

Ryan Davis wrote:

ParseTree version 1.0.0 has been released!
  zenspider projects | software projects | by ryan davis

Where can I download the package?
The download link does not list this one ... or did I just miss it?

The comment just above explains most of it:

// these are things we know we do not need to translate to C.

The goals we originally had for ParseTree didn't need any of those nodes (even though true, nil, and false work ok) for what we were doing. We quickly realized how useful ParseTree could be beyond what we were using it for, so launched it as a separate project.

If you run some code through show with the equivalents of those nodes, they simply end up as empty nodes. If you need those nodes, you could simply fill in the proper C code to extract them, then send us a patch.

$ cat x.rb
class X
   def foo
     ::X
     nil
     true
     false
     super
     
     self
   end
end
$ parse_tree_show x.rb
./x.rb:3: warning: useless use of :: in void context
./x.rb:4: warning: useless use of nil in void context
./x.rb:5: warning: useless use of true in void context
./x.rb:6: warning: useless use of false in void context
[[:defn,
   "foo",
   [:scope,
    [:block,
     [:args],
     [:colon3],
     [:nil],
     [:true],
     [:false],
     [:zsuper],
     [:zarray],
     [:self]]]]]

···

On Nov 10, 2004, at 5:36 PM, Lothar Scholz wrote:

Hello Ryan,

> ParseTree version 1.0.0 has been released!

> zenspider projects | software projects | by ryan davis

> ** DESCRIPTION:

Thanks for the release.

Can you tell me why the following nodes don't have a corresponding
element in the result tree ? Are they not used anymore in the ruby
interpreter ?

    case NODE_BLOCK_ARG:
    case NODE_SELF:
    case NODE_NIL:
    case NODE_TRUE:
    case NODE_FALSE:
    case NODE_ZSUPER:
    case NODE_BMETHOD:
    case NODE_REDO:
    case NODE_RETRY:
    case NODE_COLON3:
    case NODE_NTH_REF:
    case NODE_BACK_REF:
    case NODE_ZARRAY:
    case NODE_XSTR:
    case NODE_UNDEF:
    case NODE_ALIAS:
    case NODE_VALIAS:

Hello Eric,

···

On Nov 10, 2004, at 5:36 PM, Lothar Scholz wrote:

Hello Ryan,

> ParseTree version 1.0.0 has been released!

> zenspider projects | software projects | by ryan davis

> ** DESCRIPTION:

Thanks for the release.

Can you tell me why the following nodes don't have a corresponding
element in the result tree ? Are they not used anymore in the ruby
interpreter ?

    case NODE_BLOCK_ARG:
    case NODE_SELF:
    case NODE_NIL:
    case NODE_TRUE:
    case NODE_FALSE:
    case NODE_ZSUPER:
    case NODE_BMETHOD:
    case NODE_REDO:
    case NODE_RETRY:
    case NODE_COLON3:
    case NODE_NTH_REF:
    case NODE_BACK_REF:
    case NODE_ZARRAY:
    case NODE_XSTR:
    case NODE_UNDEF:
    case NODE_ALIAS:
    case NODE_VALIAS:

The comment just above explains most of it:

// these are things we know we do not need to translate to C.

The goals we originally had for ParseTree didn't need any of those
nodes (even though true, nil, and false work ok) for what we were
doing. We quickly realized how useful ParseTree could be beyond what
we were using it for, so launched it as a separate project.

If you run some code through show with the equivalents of those nodes,
they simply end up as empty nodes. If you need those nodes, you could
simply fill in the proper C code to extract them, then send us a patch.

Okay thanks this was not clear from the comment.

But shouldn't they available now you have outsourced the code to this
project. When i read "parsetree" together with a 1.0 version i would
expect that it gives me a complete reverseable tree representation.

And another question, shouldn't "super" (which is among the omitted
nodes) count as 1 in the abc metrics ?

--
Best regards, emailto: scholz at scriptolutions dot com
Lothar Scholz http://www.ruby-ide.com
CTO Scriptolutions Ruby, PHP, Python IDE 's

After looking at the various software packages out there including open
source and closed, public domain and commercial), I've come to the
conclusion that version numbering is pretty much arbitrary. I think
when a Zen* package comes out, they mark it as "1.0" because it is now
good enough to do what they'd intended it to, and it has been released
so the rest of us can take a look.

Kind Regards,

Brian Wisti
http://coolnamehere.com/

···

--- Lothar Scholz <mailinglists@scriptolutions.com> wrote:

But shouldn't they available now you have outsourced the code to this
project. When i read "parsetree" together with a 1.0 version i would
expect that it gives me a complete reverseable tree representation.

And another question, shouldn't "super" (which is among the omitted
nodes) count as 1 in the abc metrics ?

--
Best regards, emailto: scholz at
scriptolutions dot com
Lothar Scholz http://www.ruby-ide.com
CTO Scriptolutions Ruby, PHP, Python IDE 's

But shouldn't they available now you have outsourced the code to this
project. When i read "parsetree" together with a 1.0 version i would
expect that it gives me a complete reverseable tree representation.

I'm sorry we didn't meet your expectations of quality on a dot-oh release. Please remember that this is an open-source _free_ software release. We welcome _constructive_ criticism as well as patches.

And another question, shouldn't "super" (which is among the omitted
nodes) count as 1 in the abc metrics ?

Yes, it probably should. I'll make that change now.

···

On Nov 10, 2004, at 6:11 PM, Lothar Scholz wrote: