I heard from somebody that Ruby cannot be completely expressed in EBNF.
And he also said that there are some ad hoc cases.
Is it true?
Sam
--
Posted via http://www.ruby-forum.com/.
If you want to parse Ruby, your best bet is probably ParseTree :-) [1]
[1] http://www.zenspider.com/ZSS/Products/ParseTree/
Examples of difficult cases:
foo { } # calls foo with empty hash or with empty block ?
foo + # Newlines are ignored when the expression is "not complete"
bar
--
Tomasz Wegrzanowski [ http://t-a-w.blogspot.com/ ]
There are also some interesting notes on lexing Ruby in Xue Yong Zhi's
blog:
http://seclib.blogspot.com/2005/11/more-on-leftshift-and-heredoc.html
Yours,
tom