caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Context Free Grammars?
@ 2004-08-12 17:18 David McClain
  2004-08-12 18:02 ` Joshua Smith
  2004-08-13  4:45 ` skaller
  0 siblings, 2 replies; 9+ messages in thread
From: David McClain @ 2004-08-12 17:18 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2004-08-13 14:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-12 17:18 [Caml-list] Context Free Grammars? David McClain
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

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).