Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] a few lexing questions
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-04-28 (21:33)
From: Michal Moskal <malekith@p...>
Subject: Re: [Caml-list] a few lexing questions
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 :: : GCS {C,UL}++++$ a? !tv
: PLD Linux ::::::::: Wroclaw University, CS Dept : {E-,w}-- {b++,e}>+++ h

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: