Boost logo

Boost Users :

Subject: Re: [Boost-users] Comparison boost spirit and ANTLR
From: Larry Evans (cppljevans_at_[hidden])
Date: 2013-05-29 10:51:01


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/parsing_expression_grammar.html

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
> <mathias.gaunard_at_[hidden] <mailto:mathias.gaunard_at_[hidden]>> 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_at_[hidden] <mailto:Boost-users_at_[hidden]>
> 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_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net