Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: David McClain <David.McClain@Avisere.com>
To: caml-list@inria.fr
Subject: [Caml-list] Context Free Grammars?
Date: Thu, 12 Aug 2004 10:18:07 -0700	[thread overview]
Message-ID: <93BB4D7C-EC83-11D8-9939-000A95C19BAA@Avisere.com> (raw)

I think my mind has been poisoned from exposure to recursive descent 
parsing...

I am running into a huge number of reduce/reduce conflicts in 
OCamlYacc. It is beginning to dawn on me that Yacc really is for 
context-free grammars... (that's what they said! only now I'm starting 
to realize it..)

So the question is, does OCaml actually have a CFG description? I'm 
confused about the similarity of patterns and expression from the 
viewpoint of CFG description. They share many similarities, and in the 
correct context there can be no confusion.

But when I try to generate a parser it appears that pieces of 
expression syntax and pieces of pattern syntax are confusing the 
parser. If the parser really ignores any kind of context -- such as the 
parent tree for the subproduction -- then the lack of any context 
knowledge would certainly be confusing.

Anyone have any hints about syntax transformations so that CFG's can 
really be used here? I read a tremendous number of references that 
indicate how nasty these reduce/reduce conflicts can be. I believe 
them. Trouble is they don't go very far in explaining how to fix these 
conflicts, other than to state that "you have a mistake in your 
grammar".  Some references do hint that syntax description 
transformations can become unwieldy and unnatural to read.

I have to stop thinking like recursive descent and try to view the 
universe as flat-land...

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 17:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-12 17:18 David McClain [this message]
2004-08-12 18:02 ` Joshua Smith
2004-08-12 18:14   ` David McClain
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=93BB4D7C-EC83-11D8-9939-000A95C19BAA@Avisere.com \
    --to=david.mcclain@avisere.com \
    --cc=caml-list@inria.fr \
    /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