|
Boost : |
Subject: Re: [boost] [Spirit] Retrieve informations out of tokens
From: Andreas Pokorny (andreas.pokorny_at_[hidden])
Date: 2013-06-26 15:50:58
Hi,
A good starting point for writing a lexer is the conjure tutorial:
https://github.com/boostorg/spirit/tree/master/example/qi/compiler_tutorial/conjure2
and of course epoch:
http://code.google.com/p/epoch-language/source/browse/#hg/EpochCompiler/Lexer
Regarding tokenize vs tokenize_and_parse: the former executes the lexer on
the input, and the latter also passes the iterators received from the lexer
to the qi parse expression.
You could have a look at clang since it is implemented as a recursive
descent parser .. just for reference.
In general I think it might be quite entertaining to do the nasty and
ambiguous parts of C++ with qi's dynamic parsers.
regards
Andreas
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk