Re: maaany output

Seth <[email protected]>
Newsgroups gmane.comp.parsers.spirit.general
Message-ID <[email protected]>
On 21-07-17 07:24, Jens Kallup wrote:
>
> "SET LANG de en"
>
> without the qoutes ""
> The parser should use no_case, if possible.
> lang, de, and en should be symbols with _not speciefed_ length;
> so they should dynamic.
> Then, the parser should call a function, which handle the 3
> symbols. 

Here you go http://coliru.stacked-crooked.com/a/903160f45ed784bd

If the number of arguments is hard coded,
http://coliru.stacked-crooked.com/a/a01b9a3992018c9e

If there are other commands, Nabialek trick:
http://coliru.stacked-crooked.com/a/362620c1cc943d8e

If there are specific options, two possibilities:

  - using symbols again (note case insenstivity)
http://coliru.stacked-crooked.com/a/2a350bfc042bd1df

  - checking dynamically in the handler function(s) (you do
case-sensitivity) http://coliru.stacked-crooked.com/a/08aa6f7488f24fab

I've contributed more traditional/full blown parsers for script command
languages on Stackoverflow:

 -
https://stackoverflow.com/questions/14548592/boost-spirit-implement-small-one-line-dsl-on-a-server-application/14554966

 -
https://stackoverflow.com/questions/7893768/using-boostbind-with-boostfunction-retrieve-binded-variable-type/7897417#7897417

 -
https://stackoverflow.com/questions/44255761/parsing-a-command-language-using-boost-spirit/44261883#44261883

 -
https://stackoverflow.com/questions/18048928/c-splitting-a-string-into-strings-and-ints/18049073#18049073

 -
https://stackoverflow.com/questions/41187486/what-is-the-c-way-of-handling-a-framework-to-call-functions-of-different-types/41188557#41188557



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.