[ale] Complex Parsing
Christopher Fowler
cfowler at outpostsentinel.com
Mon Nov 5 21:12:47 EST 2001
Good point regarding "natural language" on command line.
The system is embedded. I've used TCL/Tk on this hardware but for this
device I would like not to. I belive I'll use and Arg table and parse
it that way.
kinda like this
set use John password john staus admin command shell
Arg args[] = {
/* token, type, storage */
"home", ARG_STRING, &home,
"auth", ARG_STRING, &status,
"password", ARG_STRING, &password,
"command", ARG_STRING, &command,
0,0,0
};
-----Original Message-----
From: Joe [mailto:Joe]On Behalf Of Joseph A Knapka
Sent: Monday, November 05, 2001 2:49 PM
To: Christopher Fowler
Cc: Matt Shade; ale at ale.org
Subject: Re: [ale] Complex Parsing
Christopher Fowler wrote:
>
> I'm using C. Everything is in the argv array.
>
> I can use a serious of strcmp()'s to see is one argv[X] = "home". Then
> set argv[x+1] as the argument.
Yes. But if all this program is doing is maintaining
configuration files, C is certainly not the right tool
for the job. Tcl or Python or even Perl would let you
do the same job with half the effort (probably much
less).
> I'm creating a config program [that] is plain language based.
What does that mean, exactly? If you're trying to
implement a natural-language-based command-line
interface, beware: parsing natural language is
non-trivial (though fairly well-understood), and
semantic analysis of natural language is
-hard- (little universally agreed-upon theory,
and implementations tend to be computationally
intensive).
It's my opinion that most attempts at
natural-language front ends for command-line
systems are misguided: they lure the
user into thinking the computer "understands"
them, and then the user trips over their
hidden limitations. It's better to just
design a simple command syntax and tell the
user to read the fine manual. Now, unifying
a large amount of disparate software using
a -single-, -well-designed- command syntax --
that would be worth doing.
Cheers,
-- Joe
# "You know how many remote castles there are along the
# gorges? You can't MOVE for remote castles!" - Lu Tze re. Uberwald
# (Obsolete) Linux MM docs:
http://home.earthlink.net/~jknapka/linux-mm/vmoutline.html
---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be
sent to listmaster at ale dot org.
---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be
sent to listmaster at ale dot org.
More information about the Ale
mailing list