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 AAA13455; Wed, 28 Jul 2004 00:03:55 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id AAA12080 for ; Wed, 28 Jul 2004 00:03:54 +0200 (MET DST) Received: from herd.plethora.net (herd.plethora.net [205.166.146.1]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i6RM3rEV011281 for ; Wed, 28 Jul 2004 00:03:53 +0200 Received: from bhurt.plethora.net (bhurt.plethora.net [205.166.146.49]) by herd.plethora.net (8.11.6/8.10.1) with ESMTP id i6RM3Zo15049; Tue, 27 Jul 2004 17:03:35 -0500 (CDT) Date: Tue, 27 Jul 2004 17:11:32 -0500 (CDT) From: Brian Hurt X-X-Sender: bhurt@localhost.localdomain To: Josh Smith cc: caml-list@inria.fr Subject: Re: [Caml-list] Camlp4 help/questions In-Reply-To: <20040727214504.GA7950@trdlnk.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Miltered: at nez-perce with ID 4106D149.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 camlp:01 camlp:01 parses:01 function-:01 val:01 char:01 ocaml:01 ocaml:01 it'd:01 preprocessor:02 string:03 string:03 wrote:03 redirect:95 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, 27 Jul 2004, Josh Smith wrote: > I apologize if this is not the right list to send this too, but I'm > nearing my feeble wits' end and I'm starting here... I don't think Camlp4 is the right tool. It's mainly an Ocaml preprocessor, you want Ocaml code that parses the line. Ocamllex/Ocamlyacc are great for a lot of things- but I think I agree, they're also the wrong tools for the job. I think what you want is a split function- a function that takes a string and splits it up at certan characters. It'd have a type something like: val split: char -> string -> string list You'd then read an entire line, split it apart on '|'. You could then split various substrings on ';' to get the integers, etc. Hope this helps. -- "Usenet is like a herd of performing elephants with diarrhea -- massive, difficult to redirect, awe-inspiring, entertaining, and a source of mind-boggling amounts of excrement when you least expect it." - Gene Spafford Brian ------------------- 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