Hi,
In message "[ruby-talk:13431] Re: Using Antlr for Ruby? (was RE: Re: why won't "( a) = 1" parse?)"
on 01/04/02, hipster <hipster / xs4all.nl> writes:
|> Somebody suggested, but I couldn't take time to inspect it yet.
|> This specific one is very tricky. I'm not sure Antlr could fix this.
|> And I have to confess that I have several other leftovers in Ruby.
|
|FYI: I've started a translation of the Ruby grammar to ANTLR. I've
|tried handling whitespace in both parser and lexer, neither of both
|being very succesful, and am currently thinking of implementing this
|with multiple lexers (like multiple YACC lexer states).
Oh, I just remember you ARE the somebody I mentioned above.
Sorry for my leaky memory.
|If you state the leftovers I could try implementing them in the ANTLR
|grammar as a proof-of-principle.
Leftovers I can think of right now are:
(1) parenthesized RHS
(foo) = 1
(2) more flexible argument parentheses
foo (a) # as foo((a))
foo (a), b # as foo((a),b)
foo (a,b) # as foo(a,b)
(3) comma after newline
a = [1
,
2]
Probably I have to inspect Antlr.
matz.