From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA16650; Thu, 2 Sep 2004 16:40:38 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA16847 for ; Thu, 2 Sep 2004 16:40:37 +0200 (MET DST) Received: from tcs.inf.tu-dresden.de (orchid.inf.tu-dresden.de [141.76.75.101]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id i82EebgA026848 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Thu, 2 Sep 2004 16:40:37 +0200 Received: from ithif59.inf.tu-dresden.de (ithif59 [141.76.75.59]) by tcs.inf.tu-dresden.de (8.12.9/8.12.9) with ESMTP id i82EeaMM024133 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT); Thu, 2 Sep 2004 16:40:36 +0200 (MET DST) Received: from tews by ithif59.inf.tu-dresden.de with local (Exim 4.34) id 1C2slQ-0000zv-9i; Thu, 02 Sep 2004 16:40:36 +0200 To: shaddin Cc: caml-list@inria.fr Subject: Re: [Caml-list] automatic documentation of ocamlyacc grammars References: <200408041615.i74GFuSU014482@mint-square.mit.edu> <41116E1A.8080902@mitre.org> From: Hendrik Tews Date: 02 Sep 2004 16:40:36 +0200 In-Reply-To: <41116E1A.8080902@mitre.org> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Scanned-By: MIMEDefang 2.33 (www . roaringpenguin . com / mimedefang) at tcs.inf.tu-dresden.de X-Miltered: at concorde with ID 413730E5.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 hendrik:01 tews:01 tews:01 parses:01 wwwtcs:01 annotate:01 wwwtcs:01 hendrik:01 compiler:01 compiler:01 tu-dresden:01 tu-dresden:01 lisp:01 lisp:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, shaddin writes: Does anybody know of a tool that, given a .mly file, parses the file and produces documentation of the BNF of the grammar in latex (or html, or anything...). This would be very useful for those of us who I just saw your question now. I use a self written emacs lisp script. From this input http://wwwtcs.inf.tu-dresden.de/~tews/ccsl/viewcvs.cgi/Ccslc/Ccsl/grammar.mly?annotate=1.29 I produce a raw grammar http://wwwtcs.inf.tu-dresden.de/~tews/ccsl/compiler.html and a user friendly version http://wwwtcs.inf.tu-dresden.de/~tews/ccsl/grammar.html The latter exists also as txt file http://wwwtcs.inf.tu-dresden.de/~tews/ccsl/grammar.txt For the user friendly version I apply some transformation that introduce [ ] and { } for optional occurence and repetition. For these transformations I also have emacs lisp functions. However, they are not very robust: Whenever I change the grammar I have to adopt the script for the user friendly version. You can download all scripts from the CCSL repository: http://wwwtcs.inf.tu-dresden.de/~tews/ccsl/viewcvs.cgi/Ccslc/ To see what you need and how it is working look for the grammar.html and compiler.html goals in Doc/GNUmakefile. Bye, Hendrik ------------------- 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