Forum: Ruby ruby-lex

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C6858f4b8ec263c8c3c58759494e926a?d=identicon&s=25 Andy Delcambre (Guest)
on 2006-03-29 09:19
(Received via mailing list)
I am not sure if this is the place to ask this, but I dont really have
any other ideas.

I am trying to use the ruby-lex package, which is a lexical analyzer
which produces ruby code.  It uses flex to parse the lex file, the
converts the c code into ruby code.

My problem is when I run it on my computer, the final ruby file is
significantly truncated.  I am not out of space, it just always stops
at betweeen 110 and 130 lines, even when recompiling the examples
provided.  The last line is alway: when (some number).

First question, has anyone seen this before.  And is there a fix? Am I
doing something wrong? Does it interact poorly with ruby 1.8.3 (the
version I am using)?

Second, is there another alternative to ruby-lex as a lexer. I am
actually using the pair of tools, ruby-lex and ruby-yacc.  I have
looked at racc, but it seems to be geared towards raw text parsing
rather than lexing to tokens then parsing the tokens which is what I
would rather do.

I am working on a compiler for a class that works over a subset of
java, so robust tools is sort of a must.  I was working on this in
smlnj  (and ml-lex and ml-yacc), which I was not very fond of.  Would
love to do it in ruby.

Thanks
Andy Delcambre
B32a1911d783e0a95e0b062fd5d0b64b?d=identicon&s=25 Jan Friedrich (janfri)
on 2006-03-30 11:59
Andy Delcambre wrote:

> Second, is there another alternative to ruby-lex as a lexer. I am
> actually using the pair of tools, ruby-lex and ruby-yacc.  I have
> looked at racc, but it seems to be geared towards raw text parsing
> rather than lexing to tokens then parsing the tokens which is what I
> would rather do.
Try rex (http://raa.ruby-lang.org/project/rex/). Rex is the pardon for
ruby-lex and racc the pardon for ruby-yacc. So you can parsing with
tokens. :)

Best regards.
Jan
This topic is locked and can not be replied to.