On 05/29/13 07:59, salvatore dario minonne wrote:
ATLR is LL as well More specifically, ANTLR is LL(k) for some k>0:
http://en.wikipedia.org/wiki/LL_parser Spirit is a PEG: http://www.boost.org/doc/libs/1_43_0/libs/spirit/doc/html/spirit/abstracts/p... Both PEG and LL)k) are recursive descent; however, LL(k) means the parser can lookahead K tokens to decide which alternative to parse. I think spirit's expect operator means it can lookahead 1 token. Also, spirit will try alternatives in order until it finds a match; whereas LL{k) will not try to parse each alternative because it looks ahead k tokens to decide which alternative is the only one possible(as mentioned in the LL_parser page mentioned above). Also, w.r.t. natural language parsing, wikipedia says that's probably not a good idea ( as mentioned in the parsing_expression_grammar.html page). HTH.
On Wed, May 29, 2013 at 2:32 PM, Mathias Gaunard
mailto:mathias.gaunard@ens-lyon.org> wrote: On 27/05/13 20:06, Olivier Austina wrote:
Hi,
I would like to choose a parser.
I would like to use a parser for text processing (natural language text). Which parser is suited in this case. In general which are the benefit to use boost spirit instead of ANTLR or ANTLR instead of boost spirit. Thank you.
ANTLR is LR, Spirit is LL. Spirit is embedded in C++, ANTLR is a separate preprocessor.
Spirit is slow to compile and isn't very efficient at runtime, but it's fairly nice to use once you get used to it.
_________________________________________________ Boost-users mailing list Boost-users@lists.boost.org mailto:Boost-users@lists.boost.org http://lists.boost.org/__mailman/listinfo.cgi/boost-__users http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- SDM
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users