Recommendation for simple command parser

R

Ratbert

Hi,

I'm searching for a portable library, providing some sort of
parsing functionality. The library should help to encode and
decodes command phrases. Commands are plain text C-strings,
consisting of a command name and parameters (defined by parameter
name and value); e.g.:

command{param1{123}param2{ghij}param3{1.234}param4{param5{param6{x}param7{0}}}}

where
- command is the command name
- paramX are parameter names
- parameters may consist of other parameters

Background:
I need such parser for the communication between a host based library
and an embedded system, which interacts with the host via a
stream-based communication channel (TCP/IP, USB or memory mapped).

Thanks in advance,
Ratbert
 
P

Pierre Senellart

Ratbert ,comp.lang.c++:
I'm searching for a portable library, providing some sort of
parsing functionality. The library should help to encode and
decodes command phrases. Commands are plain text C-strings,
consisting of a command name and parameters (defined by parameter
name and value); e.g.:

command{param1{123}param2{ghij}param3{1.234}param4{param5{param6{x}param7{0}}}}

You can have a look at Boost.Spirit: http://spirit.sourceforge.net/

Or you could use something like lex/yacc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top