Ruby Lex Specification

Hi,

Where can i find a ruby (1.8.6) syntax specification? If that
specification means a file in the source, no problem for me.

Thanks,
Vasco Andrade e Silva

Thanks Jason.

Correct me if i’m wrong but doesn’t yacc (or the parser) need something
before it (like lex or a tokenizer) to ‘tokenize’ the text?

I can identify the tokens in parse.y but i was looking for a
“specification” for them. Example: if i see “class” probably i want to
create the token kCLASS, but i wanted to be sure…

Vasco Andrade e Silva

parse.y is your source.
(http://svn.ruby-lang.org/repos/ruby/trunk/parse.y)

There is no official Ruby spec (yet), but it is slowly being worked on.

Jason

Then this is this file you wanted:
http://svn.ruby-lang.org/repos/ruby/trunk/keywords

Cédric Finance wrote:

Then this is this file you wanted:
http://svn.ruby-lang.org/repos/ruby/trunk/keywords

Thanks a lot.

(What a mess between the parser, keywords… :P)

Waou!!

I am currently writing a parser for a simple command line. (chose to
use lemon instead of bison). I had a look at the file you mentioned.
This is impressive. Expressivity and freedom for the programmer means
hard work for the developer (syntax for lisp is really smaller).
Thanks Matz for choosing expressivity.

Gaspard

2007/10/30, Jason R. [email protected]:

On Oct 30, 7:34 pm, Vasco Andrade e Silva [email protected] wrote:

Cédric Finance wrote:

Then this is this file you wanted:
http://svn.ruby-lang.org/repos/ruby/trunk/keywords

Thanks a lot.

(What a mess between the parser, keywords… :P)

Posted viahttp://www.ruby-forum.com/.

there were also ANTLR grammars

http://redhanded.hobix.com/cult/parseYRemakes.html