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] CFG's and OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jon Harrop <jon@j...>
Subject: Re: [Caml-list] CFG's and OCaml
On Sunday 15 August 2004 16:39, Brian Hurt wrote:
> Forget I said AST.  How are the yacc rules applied?
> ...

Right, yes, I see what you mean. So we're talking about using LR(1), which is 
necessarily a binary tree (albeit of function calls and not AST), to build up 
non-binary-tree data structures.

This kind of goes back to what I said originally about doing as much work as 
possible within LALR(1) and using post-processing to do the rest. Although, 
in this case, I think yacc will enforce correctness, e.g. even "a<b>c<d>e" is 
correct etc., so the post-processing doesn't need to do any checking here.

As Skaller pointed out off list, the ability to write "a<=b<c" has advantages 
in terms of short-circuit evaluation as well...


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