[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

nornagon

6/18/2005 1:50:00 AM

Hiya. I've been looking all over for a decent ruby parser/lexer
generator, and when I found rockit, I thought my search was over.

No such luck. The version downloadable from sourceforge.net fails to
bootstrap correctly, as described in the SF bugtracker. Also, since
ruby 1.8, many things have been deprecated. For example, Object#id has
become Object#object_id, and Object#type has become Object#class.

I tried the CVS version. It also failed to bootstrap correctly.
However, as it came with the rockit_grammars_parser.rb file, I tried
it with that. Nothing worked still:

$ ruby calculator.rb
calculator.rb:28: warning: parenthesize argument(s) for future version
calculator.rb:54: warning: parenthesize argument(s) for future version
<calc> 2 + 3
#<ParseException: No valid token found on stacks:
stack 0: on line:
' + 3'
^
|
--- Parse error!!
in state 0
the lexer returns tokens = [LT("2", NUM)] (["#<Token:0x40333e30>"])
and the valid tokens = []
>
<calc>

Any chance someone'll pick rockit back up and fix the mountain of errors?
I'm interested in it; I think it's a good idea, and I like the rockit
grammar syntax. I only wish it worked!
--
- nornagon


2 Answers

Mark Probert

6/20/2005 10:43:00 PM

0

Hi ..

On Friday 17 June 2005 18:49, nornagon wrote:
> Hiya. I've been looking all over for a decent ruby parser/lexer
> generator, and when I found rockit, I thought my search was over.
>
Depends on what you mean by decent. There are a number of parser/lexers out
there that do a reasonable job. If you mean the ruby equivalent of antlr,
then you are, currently out of luck.

Rockit needs some work for 1.8. Robert Feldt is the owner and I am not sure
of what he is up to these days. Looks like an update is planned, but I have
no idea of the when or where.

There are some other options, though I am not sure they mean "decent":

racc -- a YACC compiler-compiler

Two versions of Coco/R (LL-1 parser-scanner), one from Ryan Davis in pure
Ruby and the other from me as a C extension (grammer and action in C,
produces a Ruby extension). I am looking at updating my version to be
an LL-k parser but that is a ways away yet.

This doesn't really help with the Rockit question though ..

Regards,

--
-mark. (probertm at acm dot org)


nornagon

6/25/2005 3:15:00 PM

0

On 6/21/05, Mark Probert <probertm@acm.org> wrote:
> Hi ..
>
> On Friday 17 June 2005 18:49, nornagon wrote:
> > Hiya. I've been looking all over for a decent ruby parser/lexer
> > generator, and when I found rockit, I thought my search was over.
> >
> Depends on what you mean by decent. There are a number of parser/lexers out
> there that do a reasonable job. If you mean the ruby equivalent of antlr,
> then you are, currently out of luck.
>
> Rockit needs some work for 1.8. Robert Feldt is the owner and I am not sure
> of what he is up to these days. Looks like an update is planned, but I have
> no idea of the when or where.
>
> There are some other options, though I am not sure they mean "decent":
>
> racc -- a YACC compiler-compiler

Yeah, I've looked at racc. It's the next-best thing to rockit, and
it's what I'll use until rockit gets a good cleanup.

>
> Two versions of Coco/R (LL-1 parser-scanner), one from Ryan Davis in pure
> Ruby and the other from me as a C extension (grammer and action in C,
> produces a Ruby extension).

At last count, neither of those worked on my setup (iirc)

> I am looking at updating my version to be an LL-k parser but that is a ways
> away yet.
>
> This doesn't really help with the Rockit question though ..
>

Thanks anyway; it's good to see a reply! :)

I did send Robert an email very similar to this one a while ago
(months), but I have yet received no reply. I wonder if I even sent it
to the right address...

--
- nornagon