Tom Pledger <[EMAIL PROTECTED]> wrote,
> Manuel M. T. Chakravarty writes:
> > Lars Henrik Mathiesen <[EMAIL PROTECTED]> wrote,
> >
> > Ok, I should have been more precise. The problem is to make
> > it efficient. Usually, this is achieved by having a table
> > into which you index with the input character to compute
> > what state to enter next. If you have many predicates and
> > potentially have to test a large number of them for each
> > input character before being able to determine the next
> > state, this might adversely influence the performance of the
> > scanner.
>
> Would it help to use lazily populated tables, to cache the results of
> evaluating the corresponding predicates? It could be done in an outer
> layer, so that it doesn't mar the purity of the predicate composition
> approach. It may even be a happy medium, in cases where the input
> document only uses a tiny fraction of the character set.
Caching the results of predicate evaluation might be a good
idea. I will keep that in mind when attempting an
implementation.
Thanks,
Manuel