caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: David McClain <David.McClain@Avisere.com>
To: Joshua Smith <josh@trdlnk.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Context Free Grammars?
Date: Thu, 12 Aug 2004 11:14:45 -0700	[thread overview]
Message-ID: <7D827B04-EC8B-11D8-9939-000A95C19BAA@Avisere.com> (raw)
In-Reply-To: <411BB09A.7010307@trdlnk.com>



> Out of curiosity, why not use recursive descent parsing instead of
> ocamlyacc?
>

Well, not a bad idea... I suppose. It would give me better control over 
the course of things. I had the impression that YACC was a much faster 
system, being table driven and all. And possibly less bulky in 
generated code, but that isn't much of an argument in its favor 
today...

The problems I am seeing have to do with factoring the grammar, similar 
to factoring threaded code. However the parent trees of these factors 
have very different semantic notions about what that fragment should 
mean. Recursive descent would certainly handle this better.

I am not a YACC expert (no kidding!?) but I always had the notion that 
nonterminal reduction trees would somehow guide the reduce decisions. 
Now, however, it appears that YACC is simply looking blindly for 
syntactic token chains and reducing on them with absolutely no notion 
of who might be interested in the result. Kind of takes the wind out of 
my ancient understandings of YACC.

[So I guess I was writing my grammars as though there were some kind of 
recursive descent engine in control. Not apparently so...]


David McClain
Senior Corporate Scientist
Avisere, Inc.

david.mcclain@avisere.com
+1.520.390.7738 (USA)

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2004-08-12 18:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-12 17:18 David McClain
2004-08-12 18:02 ` Joshua Smith
2004-08-12 18:14   ` David McClain [this message]
2004-08-12 19:25     ` Paul Snively
2004-08-12 21:47       ` Erik de Castro Lopo
2004-08-13  5:22       ` skaller
2004-08-13  5:59         ` David Brown
2004-08-13 14:20         ` Brian Hurt
2004-08-13  4:45 ` skaller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7D827B04-EC8B-11D8-9939-000A95C19BAA@Avisere.com \
    --to=david.mcclain@avisere.com \
    --cc=caml-list@inria.fr \
    --cc=josh@trdlnk.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).