Boost logo

Boost :

Subject: Re: [boost] [spirit] scan_keyword: scan an InputIterator for a keyword.
From: Joel de Guzman (joel_at_[hidden])
Date: 2011-11-28 18:47:31

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:
> 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.

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.


Joel de Guzman

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