From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id CA49CBB81 for ; Wed, 7 Dec 2005 01:42:00 +0100 (CET) Received: from smtp1.adl2.internode.on.net (smtp1.adl2.internode.on.net [203.16.214.181]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id jB70fwkw013234 for ; Wed, 7 Dec 2005 01:42:00 +0100 Received: from rosella (ppp33-4.lns1.syd2.internode.on.net [59.167.33.4] (may be forged)) by smtp1.adl2.internode.on.net (8.12.9/8.12.6) with ESMTP id jB70fuT2031890 for ; Wed, 7 Dec 2005 11:11:57 +1030 (CST) (envelope-from skaller@users.sourceforge.net) Subject: Testimonial: a tribute to Ocaml From: skaller To: caml-list@yquem.inria.fr Content-Type: text/plain Date: Wed, 07 Dec 2005 11:41:55 +1100 Message-Id: <1133916115.15333.9.camel@rosella> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 43962FD6.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocaml:01 parser:01 ocamlyacc:01 lalr:01 parser:01 lalr:01 grammar:01 expr:01 recursion:01 lexer:01 recursion:01 expr:01 syntax:01 ocaml:01 sourceforge:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 In a previous posting, I said thanks to those people who helped me integrate an RD parser with Ocamlyacc LALR1 parser. Thanks again! It allowed me to use the existing LALR1 parser engine, and allow dynamic extensions to the grammar like this: -------------------------- #keyword whenever #statement repeat statements whenever expr ; repeat f x; g k; whenever 1>0; -------------------------- This system was pretty lame, since it didn't allow recursion or alternatives -- but it was proof-of-principle, and established the mechanism for providing the linkage from the lexer to the parser. I am VERY pleased that with almost no effort, I have now been able to introduce both alternatives and arbitrary nonterminal symbols, the latter supporting recursion: ------------------------- #nonterminal idlist ident #nonterminal idlist ident , idlist #statement assign idlist = expr ; assign a,b,c = (1,2,3); ------------------------- This involved some refactoring. However the point is .. after I got rid of the syntax and type errors so it compiled .. IT WORKED FIRST TIME. So a big thanks to the Ocaml team and contributors for a fine product! -- John Skaller Felix, successor to C++: http://felix.sf.net