Hello.
I'm looking for documentation on rex & racc, as what I have found up to now
(mainly the homepages and the READMEs) are rather terse.
Any pointers or examples of use?
Thanks.
···
--
Fabrice DELENTE
Hello.
I'm looking for documentation on rex & racc, as what I have found up to now
(mainly the homepages and the READMEs) are rather terse.
Any pointers or examples of use?
Thanks.
--
Fabrice DELENTE
I'm looking for documentation on rex & racc, as what I have found up to now
(mainly the homepages and the READMEs) are rather terse.
I haven't run across any rex and racc tutorials online, but there are
is a solid example parser buried inside the rex tarball distribution.
The 'calc3' example consists of two source files:
calc3.rex -> The rex token definitions
calc3.racc -> The racc grammar definitions and executable script
They demonstrate many of the differences in coming from lex and yacc.
If you aren't familiar with the traditionally C-based lex and yacc,
they have been in wide use for a (relatively) long time and are well
documented online. I would suggest starting with their documentation
if you are just getting started with parsers, or even LALR parsers. A
good introduction can be found here:
If you aren't set on using an LALR parser, then the Treetop library is
an interesting alternative. It uses a very different method of
generation, but it's become a popular Ruby tool. It can be found here:
http://treetop.rubyforge.org/
Let us know if this doesn't answer your question. Good luck!
-Nick
This is all good advice. For a more complicated racc example (doesn't use rex), look at ruby_parser. It is big and gross, so it better simulates what all yacc-based grammar definitions eventually become.
On Jun 21, 2008, at 09:58 , nicholasmabry@gmail.com wrote:
I'm looking for documentation on rex & racc, as what I have found up to now
(mainly the homepages and the READMEs) are rather terse.I haven't run across any rex and racc tutorials online, but there are
is a solid example parser buried inside the rex tarball distribution.
The 'calc3' example consists of two source files:
calc3.rex -> The rex token definitions
calc3.racc -> The racc grammar definitions and executable scriptThey demonstrate many of the differences in coming from lex and yacc.
If you aren't familiar with the traditionally C-based lex and yacc,
they have been in wide use for a (relatively) long time and are well
documented online. I would suggest starting with their documentation
if you are just getting started with parsers, or even LALR parsers. A
good introduction can be found here:
Lex & YaccIf you aren't set on using an LALR parser, then the Treetop library is
an interesting alternative. It uses a very different method of
generation, but it's become a popular Ruby tool. It can be found here:
http://treetop.rubyforge.org/Let us know if this doesn't answer your question. Good luck!
Thanks for the answers.
I've read (a good part of) the lex&yacc book, and read online documentation.
I don't know about Treetop, but will look into it.
--
Fabrice DELENTE
fdelente@mail.cpod.fr wrote:
I've read (a good part of) the lex&yacc book, and read online documentation.
I don't know about Treetop, but will look into it.
upside: It can parse non-context free grammars, which the others find hard or impossible.
upside: They're as efficient as context-free ones.
downside: That's not very efficiently... it's quite slow.
downside: You have to have all your input in one string to use it - no IOStreams.
It is very sweet and clean and all kinds of good things, and since you're
using Ruby already you might not be too worried about performance :-).
Clifford Heath.
Dear all
i would like to remove myself from this ruby-talk, how do i go about?
Please look at the headers of a ruby-talk email.
robert
2008/6/25 Fred Chingota <fredchingota@yahoo.com>:
Dear all
i would like to remove myself from this ruby-talk, how do i go about?
--
use.inject do |as, often| as.you_can - without end
And if you don't have a clue of what a "header" is:
X-ML-Name: ruby-talk
X-Mail-Count: 306167
X-MLServer: fml [fml 4.0.3 release (20011202/4.0.3)]; post only (only
members can post)
X-ML-Info: If you have a question, send e-mail with the body
"help" (without quotes) to the address ruby-talk-ctl@ruby-lang.org;
help=<mailto:ruby-talk-ctl@ruby-lang.org?body=help>
X-Spam-Checker-Version: SpamAssassin 3.1.7-deb (2006-10-05) on
On Wed, Jun 25, 2008 at 1:03 PM, Robert Klemme <shortcutter@googlemail.com> wrote:
Please look at the headers of a ruby-talk email.
robert
2008/6/25 Fred Chingota <fredchingota@yahoo.com>:
Dear all
i would like to remove myself from this ruby-talk, how do i go about?--
use.inject do |as, often| as.you_can - without end
--
J-H Johansen
--
There are 10 kinds of people in the world: Those who understand binary and
those who don't...
You omitted the interesting bit:
List-Id: ruby-talk.ruby-lang.org
List-Software: fml [fml 4.0.3 release (20011202/4.0.3)]
List-Post: <mailto:ruby-talk@ruby-lang.org>
List-Owner: <mailto:ruby-talk-admin@ruby-lang.org>
List-Help: <mailto:ruby-talk-ctl@ruby-lang.org?body=help>
List-Unsubscribe: <mailto:ruby-talk-ctl@ruby-lang.org?body=unsubscribe>
Cheers
robert
2008/6/25 J-H Johansen <ondemannen@gmail.com>:
And if you don't have a clue of what a "header" is:
X-ML-Name: ruby-talk
X-Mail-Count: 306167
X-MLServer: fml [fml 4.0.3 release (20011202/4.0.3)]; post only (only
members can post)
X-ML-Info: If you have a question, send e-mail with the body
"help" (without quotes) to the address ruby-talk-ctl@ruby-lang.org;
help=<mailto:ruby-talk-ctl@ruby-lang.org?body=help>
X-Spam-Checker-Version: SpamAssassin 3.1.7-deb (2006-10-05) on
--
use.inject do |as, often| as.you_can - without end
grrr ... I'll have to learn to use page-down key.
cheers =)
On Wed, Jun 25, 2008 at 3:20 PM, Robert Klemme <shortcutter@googlemail.com> wrote:
2008/6/25 J-H Johansen <ondemannen@gmail.com>:
And if you don't have a clue of what a "header" is:
X-ML-Name: ruby-talk
X-Mail-Count: 306167
X-MLServer: fml [fml 4.0.3 release (20011202/4.0.3)]; post only (only
members can post)
X-ML-Info: If you have a question, send e-mail with the body
"help" (without quotes) to the address ruby-talk-ctl@ruby-lang.org;
help=<mailto:ruby-talk-ctl@ruby-lang.org?body=help>
X-Spam-Checker-Version: SpamAssassin 3.1.7-deb (2006-10-05) onYou omitted the interesting bit:
List-Id: ruby-talk.ruby-lang.org
List-Software: fml [fml 4.0.3 release (20011202/4.0.3)]
List-Post: <mailto:ruby-talk@ruby-lang.org>
List-Owner: <mailto:ruby-talk-admin@ruby-lang.org>
List-Help: <mailto:ruby-talk-ctl@ruby-lang.org?body=help>
List-Unsubscribe: <mailto:ruby-talk-ctl@ruby-lang.org?body=unsubscribe>Cheers
robert
--
use.inject do |as, often| as.you_can - without end
--
J-H Johansen
--
There are 10 kinds of people in the world: Those who understand binary and
those who don't...
On the other hand, I'd venture to guess that a large proportion of people
who need to resort to sending a post to a list to ask how to unsubscribe
don't know how to view the headers.
Many popular mail-clients bury headers under one or more levels of
user-friendliness. For example gmail, has a show details link, which
DOESN'T show the headers. You have to click on a pull-down list next to the
reply link and select " Show original"
So, for the OP if you still haven't managed to unsubscribe, the way to do it
is to send an email from the email address which is receiving the postings
to ruby-talk-ctl@ruby-lang.org with just the text unsubscribe as the body of
the email.
On Wed, Jun 25, 2008 at 9:20 AM, Robert Klemme <shortcutter@googlemail.com> wrote:
2008/6/25 J-H Johansen <ondemannen@gmail.com>:
> And if you don't have a clue of what a "header" is:
>
> X-ML-Name: ruby-talk
> X-Mail-Count: 306167
> X-MLServer: fml [fml 4.0.3 release (20011202/4.0.3)]; post only (only
> members can post)
> X-ML-Info: If you have a question, send e-mail with the body
> "help" (without quotes) to the address
ruby-talk-ctl@ruby-lang.org;
> help=<mailto:ruby-talk-ctl@ruby-lang.org?body=help>
> X-Spam-Checker-Version: SpamAssassin 3.1.7-deb (2006-10-05) onYou omitted the interesting bit:
List-Id: ruby-talk.ruby-lang.org
List-Software: fml [fml 4.0.3 release (20011202/4.0.3)]
List-Post: <mailto:ruby-talk@ruby-lang.org>
List-Owner: <mailto:ruby-talk-admin@ruby-lang.org>
List-Help: <mailto:ruby-talk-ctl@ruby-lang.org?body=help>
List-Unsubscribe: <mailto:ruby-talk-ctl@ruby-lang.org?body=unsubscribe>
--
Rick DeNatale
My blog on Ruby
http://talklikeaduck.denhaven2.com/