26 Jun
2013
26 Jun
'13
7:50 p.m.
Hi, A good starting point for writing a lexer is the conjure tutorial: https://github.com/boostorg/spirit/tree/master/example/qi/compiler_tutorial/... and of course epoch: http://code.google.com/p/epoch-language/source/browse/#hg/EpochCompiler/Lexe... 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