Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Context Free Grammars?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-08-12 (18:13)
From: David McClain <David.McClain@A...>
Subject: Re: [Caml-list] Context Free Grammars?

> 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 

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.
+1.520.390.7738 (USA)

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: