Boost logo

Boost :

Subject: Re: [boost] [spirit] scan_keyword: scan an InputIterator for a keyword.
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2011-11-29 17:23:35

Le 29/11/11 00:47, Joel de Guzman a écrit :
> On 11/29/2011 5:45 AM, Vicente J. Botet Escriba wrote:
>> Hi,
>> for chrono input I'm using a scan_keyword function that adapted from libc++ library (you
>> can find the code in[1]).
>> Next follows the interface:
> [snip]
>> What is the better way to do that (or something similar) with Spirit/Lexer?
>> Can we hope that the Spirit solution could perform much better?
>> What about if the strings to parse are know at compile-time?
>> [1]
> The symbol parser seems to be your friend here.
> The search is O(log n+k) using a TST.

thanks for the pointer. This seems quite simple, I will try it and
compare the performances.
Does the parser try to scan the largest symbol?
Shouldn't Lexer be more adequate/efficient to this use case?
Sorry, what is a TST?
> Spirit parses at runtime, not compile time. I've seen a compile time
> parser for compile-time strings posted somewhere in this list, but
> I don't recall exactly.
Thanks anyway,

Boost list run by bdawes at, gregod at, cpdaniel at, john at