Racc 1.4.6 release


#1

racc 1.4.6 has been released!

Racc is a LALR(1) parser generator.
It is written in Ruby itself, and generates Ruby program.

Changes:

1.4.6


#2

On Dec 29, 2008, at 20:50 , Aaron P. wrote:

racc 1.4.6 has been released!

YAY!!

  • racc/compiler.rb is removed

what is this referring to? I don’t have compiler.rb in my svn checkout.


#3

On Tue, Dec 30, 2008 at 05:44:23PM +0900, Ryan D. wrote:

On Dec 29, 2008, at 20:50 , Aaron P. wrote:

racc 1.4.6 has been released!

YAY!!

  • racc/compiler.rb is removed

what is this referring to? I don’t have compiler.rb in my svn checkout.

I’m not totally sure. That is from Aoki’s list of changes from between
1.4.5 release and now.


#4

racc 1.4.6 has been released!
YAY!!

Can it lex JavaScript?

(All I need is some hierarchical report of the structure…)


#5

On Wed, Dec 31, 2008 at 03:24:36AM +0900, Phlip wrote:

racc 1.4.6 has been released!
YAY!!

Can it lex JavaScript?

I’m glad you asked! Of course it can! For parsing JavaScript, I
present to you two solutions. One is pure ruby and kind of slow, and
the other one is C and super fast!

RKelly is a pure ruby javascript parser that uses racc:

http://github.com/tenderlove/rkelly/tree/master

I haven’t released a gem yet, but I could be persuaded to since I’m not
really doing much with it lately. RKelly will give you an AST of your
javascript.

Your second option is Johnson. It uses Spidermonkey, is really fast,
and can return a JavaScript AST:

http://github.com/jbarnette/johnson/tree/master

I haven’t documented the parser too much, so take a look at
parser_test.rb for examples.

Hope that helps


#6

Aaron P. wrote:

1.4.6

http://rubyforge.org/tracker/index.php?func=detail&aid=23401&group_id=7299&atid=28265

Regards,

Dan


#7

On Fri, Jan 02, 2009 at 10:24:52PM +0900, Daniel B. wrote:

Gem install failure:

http://rubyforge.org/tracker/index.php?func=detail&aid=23401&group_id=7299&atid=28265

Oops! Should be fixed now. Sorry about that.


#8

Aaron P. wrote:

Can it lex JavaScript?

I’m glad you asked! Of course it can! For parsing JavaScript, I
present to you two solutions. One is pure ruby and kind of slow, and
the other one is C and super fast!

Yay!

Google assert_javascript. It’s a great library - we use it all the time
at work,
but it’s hard to get started with, because of the bugs in its root
library. It
can’t parse ‘Ajax.Request’, but it can parse ‘var ajax = Ajax.Request’,
so it’s
incompatible with generated code.

It’s a re-imagining of assert_rjs, but without the noise from regular
expressions.

I will shortly be rewriting assert_javascript using one of these parsers
instead…


#9

On Tue, Dec 30, 2008 at 10:54 PM, Aaron P.
removed_email_address@domain.invalid wrote:

On Wed, Dec 31, 2008 at 03:24:36AM +0900, Phlip wrote:

racc 1.4.6 has been released!
YAY!!

Can it lex JavaScript?

I’m glad you asked! Of course it can! For parsing JavaScript, I
present to you two solutions. One is pure ruby and kind of slow, and
the other one is C and super fast!

Ooh, nice! Bookmarked!

martin


#10

Aaron P. wrote:

racc 1.4.6 has been released!

Racc is a LALR(1) parser generator.
It is written in Ruby itself, and generates Ruby program.

I think I may have asked this before but…
is racc the same thing as that used by ruby_parser [1] to parse ruby?
If so then why does [1] say that it is a C extension? I am so confused.
Also isn’t racc built into the ruby distro? Is this an updated version
of that? Will it be rolled into trunk?
Thanks!
-=r

[1] http://parsetree.rubyforge.org/


#11

On Jan 2, 2009, at 14:53 , Roger P. wrote:

I think I may have asked this before but…
is racc the same thing as that used by ruby_parser [1] to parse ruby?

yes

If so then why does [1] say that it is a C extension? I am so
confused.

there might be a few things your confused by. [1] is the link to the
parse tree project page. PT is a C extension. RP uses racc which has a
C extension to optimize its performance. A majority of racc is
implemented in ruby.

Also isn’t racc built into the ruby distro? Is this an updated version
of that? Will it be rolled into trunk?

it is, the C extension ships with the ruby distro. This is an updated
release, but most if not all of the updates pertain to the racc
compiler, which does NOT ship with the ruby distro. It won’t be rolled
in.


#12

there might be a few things your confused by. [1] is the link to the
parse tree project page. PT is a C extension. RP uses racc which has a
C extension to optimize its performance. A majority of racc is
implemented in ruby.

So racc has an optional C extension to optimize its performance, and
that one part is built into the base ruby distro [oddly]. I guess I
could look into it more to know what the difference between the parser
and compiler is. Cool.
Thanks.
-=r