ruby-lex

A

Andy Delcambre

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
 
J

Jan Friedrich

Andy said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,981
Messages
2,570,188
Members
46,731
Latest member
MarcyGipso

Latest Threads

Top