From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 31C95BC0A for ; Wed, 18 Apr 2007 12:01:47 +0200 (CEST) Received: from einhorn.in-berlin.de (einhorn.in-berlin.de [192.109.42.8]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l3IA1kp5023028 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Wed, 18 Apr 2007 12:01:46 +0200 X-Envelope-From: oliver@first.in-berlin.de X-Envelope-To: Received: from first (dslb-088-073-116-156.pools.arcor-ip.net [88.73.116.156]) (authenticated bits=0) by einhorn.in-berlin.de (8.13.6/8.13.6/Debian-1) with ESMTP id l3IA1icC027316 for ; Wed, 18 Apr 2007 12:01:45 +0200 Received: by first (Postfix, from userid 501) id B3D5A3A8F5F; Wed, 18 Apr 2007 12:01:42 +0200 (CEST) Date: Wed, 18 Apr 2007 12:01:42 +0200 From: Oliver Bandel To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] using different lexers with one parser? Message-ID: <20070418100142.GD336@first.in-berlin.de> References: <20070417203311.GA553@first.in-berlin.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6i X-Scanned-By: MIMEDefang_at_IN-Berlin_e.V. on 192.109.42.8 X-Miltered: at discorde with ID 4625EC8A.002 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; bandel:01 in-berlin:01 lexers:01 parser:01 0200,:01 hendrik:01 tews:01 bandel:01 in-berlin:01 lexer:01 parsing:01 parser:01 ocamlyacc:01 hacks:01 wrote:01 On Wed, Apr 18, 2007 at 09:38:20AM +0200, Hendrik Tews wrote: > Oliver Bandel writes: > > Is it possible (without too much effort) to switch > the lexer during parsing (from within the parser)? > > Yes, see > http://caml.inria.fr/pub/ml-archives/caml-list/2003/09/3e7f3495840e2bc851b91c3dba8abab9.en.html > [...] OK; I hoped to find a solution without the global-switching-var hacks; something that is built in in ocamlyacc. Maybe formy purposes then it's better to write my own parser and call ocamllex-generated functions directly. > The main problem is the lookahead token. OK; then I better hackmy own parser. As the fileformat is not too hard, this should be the better way. Ciao, Oliver