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 XAA04313; Mon, 28 Apr 2003 23:33:23 +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 XAA04320 for ; Mon, 28 Apr 2003 23:33:22 +0200 (MET DST) Received: from ep09.kernel.pl (ep09.kernel.pl [212.87.11.162]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h3SLXLH24642 for ; Mon, 28 Apr 2003 23:33:21 +0200 (MET DST) Received: (qmail 2870 invoked by uid 566); 28 Apr 2003 21:33:05 -0000 Date: Mon, 28 Apr 2003 23:30:53 +0200 From: Michal Moskal To: Alan Schmitt Cc: caml-list@inria.fr Subject: Re: [Caml-list] a few lexing questions Message-ID: <20030428213053.GA23545@roke.freak> References: <20030428181348.GM9337@alan-schm1p> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030428181348.GM9337@alan-schm1p> User-Agent: Mutt/1.4.1i X-PGP-Fingerprint: CF89 1B14 11BE 1CC9 2CA3 7497 5E32 69B4 BC71 B4C2 X-AntiVirus: scanned for viruses by AMaViS 0.2.1 (http://amavis.org/) X-Spam: no; 0.00; michal:01 moskal:01 malekith:01 pld-linux:01 caml-list:01 0400,:01 wroclaw:01 kernel:01 bytes:02 gcs:03 wrote:03 interface:03 pld:03 merged:04 merging:05 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Mon, Apr 28, 2003 at 02:13:48PM -0400, Alan Schmitt wrote: > A second question is about integration this code with other lexing code > or streams. An iCalendar file cannot have a line that is longer than 75 > bytes, excluding line break. A line may be broken anywhere as long as > there is a space at the beginning of the next line, as in: > > this is a very lo > ng line > > represents "this is a very long line". As this break may occur anywhere > (even inside keywords), I assume when writing the lexer these kind of > lines have been already merged together. I know how to implement the > merging using a temp file, but I'm looking for a nicer solution (like > using a stream, or using one lexer to feed the current lexer). Any > suggestion ? Maybe Lexing.from_function ? and implement what you would do with temp file using it. Unfortunately Lexing.from_function has very C-ish interface using indices in strings, so it is easy to make a mistake when writing this, so be careful. -- : Michal Moskal :: http://www.kernel.pl/~malekith : GCS {C,UL}++++$ a? !tv : PLD Linux ::::::::: Wroclaw University, CS Dept : {E-,w}-- {b++,e}>+++ h ------------------- 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