From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 11498BB88 for ; Tue, 19 Jul 2005 19:06:00 +0200 (CEST) Received: from salt.cs.brown.edu (salt.cs.brown.edu [128.148.32.122]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j6JH5xeh016939 for ; Tue, 19 Jul 2005 19:05:59 +0200 Received: from localhost (localhost [127.0.0.1]) by salt.cs.brown.edu (Postfix) with ESMTP id 79B2D15B549 for ; Tue, 19 Jul 2005 13:06:36 -0400 (EDT) Received: from salt.cs.brown.edu ([127.0.0.1]) by localhost (salt [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 31700-05 for ; Tue, 19 Jul 2005 13:06:36 -0400 (EDT) Received: from null.cs.brown.edu (null.cs.brown.edu [128.148.38.190]) by salt.cs.brown.edu (Postfix) with ESMTP id 69E8015B542 for ; Tue, 19 Jul 2005 13:06:36 -0400 (EDT) Received: from point.cs.brown.edu (point [128.148.33.31]) by null.cs.brown.edu (Postfix) with ESMTP id 031AD14800F for ; Tue, 19 Jul 2005 13:05:59 -0400 (EDT) Received: by point.cs.brown.edu (Postfix, from userid 30102) id D7DC17CDA; Tue, 19 Jul 2005 13:05:58 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by point.cs.brown.edu (Postfix) with ESMTP id CBEAA4545F for ; Tue, 19 Jul 2005 13:05:58 -0400 (EDT) Date: Tue, 19 Jul 2005 13:05:58 -0400 (EDT) From: "Nathaniel J. Gaylinn" X-X-Sender: ngaylinn@point To: OCaml Mailing List Subject: [Caml-list] parsing OCaml code Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at cs.brown.edu X-Miltered: at nez-perce with ID 42DD32F7.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 parsing:01 ocaml:01 ocaml:01 syntax:01 ocamlc:01 parsing:01 grammar:01 lex:01 tree:02 tree:02 parse:02 parse:02 output:02 output:02 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 I'm trying to figure out a nice way to parse OCaml code in a C++ program. All I need is a very basic parse tree for use in syntax highlighting and indenting OCaml code. I would love to make use of some of the programs that already come with OCaml. For instance, ocamlc and camlp4 can both output OCaml parse trees already! The only problem is the formats that these programs output are (to my knowledge) completely undocumented. If I don't use these programs, I could always try using Lex and Yacc to do the job, but I'm completely unfamiliar with these utilities and it would take me quite some time to write input for parsing OCaml. Does anyone know where I could find reference to the various OCaml parse tree formats? Does anyone know where I could find Yacc grammar descriptions of OCaml, or would I have to write them myself? Does anyone have any other suggestions of how to tackle the parsing problem? Thanks, -- Nate Gaylinn