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 TAA22223; Fri, 17 Sep 2004 19:15:18 +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 TAA21909 for ; Fri, 17 Sep 2004 19:15:17 +0200 (MET DST) Received: from mail.gmx.net (pop.gmx.de [213.165.64.20]) by concorde.inria.fr (8.13.0/8.13.0) with SMTP id i8HHFHTE032135 for ; Fri, 17 Sep 2004 19:15:17 +0200 Received: (qmail 24466 invoked by uid 65534); 17 Sep 2004 17:15:16 -0000 Received: from Da045.d.pppool.de (EHLO da045.d.pppool.de) (80.184.160.69) by mail.gmx.net (mp024) with SMTP; 17 Sep 2004 19:15:16 +0200 X-Authenticated: #20477425 From: Micha To: caml-list@inria.fr Subject: [Caml-list] ocamllex/yacc question... Date: Fri, 17 Sep 2004 19:15:30 +0200 User-Agent: KMail/1.6.1 MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200409171915.30384.micha-1@fantasymail.de> X-Miltered: at concorde with ID 414B1BA5.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; micha:01 token:01 completly:03 grammar:05 ocamllex:05 problem:07 switch:08 switch:08 lexing:08 michael:08 function:09 parsing:09 lexer:09 lexer:09 solution:10 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, I have a little scanning/parsing problem and the solution which I tried was to have empty productions in the grammar, which switch the lexer (setting a ref to the new lexer function), like that: use_lexer_1 : { switch_lexer 1 } use_lexer_2 : { switch_lexer 2 } special_id: use_lexer_1 token use_lexer_2 { ... } ... This does not work, I think because of the look ahead. Is there another solution to this (to switch lexing rules) ? Or is this a completly wrong idea? thanks Michael ------------------- 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