
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] https://svn.boost.org/svn/boost/trunk/boost/chrono/detail/scan_keyword.hpp
The symbol parser seems to be your friend here. http://tinyurl.com/7vue9nu 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. Regards, -- Joel de Guzman http://www.boostpro.com http://boost-spirit.com