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 HAA27785; Mon, 1 Dec 2003 07:21:30 +0100 (MET) 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 HAA28305 for ; Mon, 1 Dec 2003 07:21:28 +0100 (MET) Received: from anu.edu.au (anumail3.anu.edu.au [150.203.2.43]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id hB168r123971 for ; Mon, 1 Dec 2003 07:08:57 +0100 (MET) Received: from pulp.anu.edu.au (pulp.anu.edu.au [150.203.126.25]) by anu.edu.au (8.12.10/8.12.10) with ESMTP id hB168kXn023499 for ; Mon, 1 Dec 2003 17:08:46 +1100 (EST) Received: from pulp.anu.edu.au (localhost [127.0.0.1]) by pulp.anu.edu.au (8.12.10/8.12.10/Debian-5) with ESMTP id hB168f2Z000717 for ; Mon, 1 Dec 2003 17:08:45 +1100 Received: (from abate@localhost) by pulp.anu.edu.au (8.12.10/8.12.10/Debian-5) id hB15tW4j027934 for caml-list@inria.fr; Mon, 1 Dec 2003 16:55:32 +1100 Date: Mon, 1 Dec 2003 16:55:32 +1100 From: Pietro Abate To: ocaml ml Subject: [Caml-list] parse Message-ID: <20031201055532.GA27781@anu.edu.au> Mail-Followup-To: Pietro Abate , ocaml ml Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: GNU/Linux X-Organization: Research School of Information Science and Engineering (Australian National University) User-Agent: Mutt/1.5.4i X-Sender: abate@pulp.anu.edu.au X-Sender-Domain: pulp.anu.edu.au X-Spam-Status: Scanned X-Spam-Score: (-2.9) X-Spam-Tests: USER_AGENT_MUTT X-Scanned-By: MIMEDefang 2.36 X-Loop: caml-list@inria.fr X-Spam: no; 0.00; pietro:01 abate:01 pietro:01 abate:01 camlp:01 foo:01 'kwd:01 foo:01 printf:01 printf:01 'kwd:01 imply:02 parser:02 parser:02 men:97 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi all, I'm trying to write a simple parser (below) but I've problems parsing tag-like keywords. Probably this is a problem related with the lexer. does anybody know a solution that doesn't imply heavy modifications to the (Genlex) lexer ? p code: #load "camlp4o.cma";; (* this doesn't work and it's what I want *) open Genlex;; let s = "";; let flexer = make_lexer [s];; let s' = flexer (Stream.of_string s);; let parse_input_line = parser [< 'Kwd "" >] -> Printf.printf "bingo !" ;; parse_input_line s';; (* this works, but I want < > !! *) let s = "foo";; let flexer = make_lexer [s];; let s' = flexer (Stream.of_string s);; let parse_input_line = parser [< 'Kwd "foo" >] -> Printf.printf "bingo ?" ;; parse_input_line s';; -- ++ As I grow older, I pay less attention to what men say. I just watch what they do. Andrew Carnegie (1835-1919). ++ Please avoid sending me Word or PowerPoint attachments. See http://www.fsf.org/philosophy/no-word-attachments.html ------------------- 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