Boost logo

Boost Users :

From: Eric Hill (eric_at_[hidden])
Date: 2006-07-12 11:11:21


I'm past the initial learning curve with Spirit, but would like to see how
the pros handle this problem.

I have the following simple command structure:

show queues
show users
show processes
start process foo
queue user bar to process foo
...etc

I would like to parse these commands with Spirit. Easy enough. Since
this is being entered from a keyboard, it would be nice to short-circuit
the parser so you only have to enter enough of the command for the parser
to reliably figure out what you want.

e.g. "sh qu" would parse as "show queues", and "st pr foo" would parse as
"start process foo".

I can easily model the whole "show queues" command word with:

str_p("show") >> str_p("queues")

But how do I match "just enough" instead of "whole word" without doing it
manually?

TIA,
Eric


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