Mail Archives: djgpp/1997/04/05/08:41:22
Thomas Demmer wrote:
> flex & bison are exactly what you're looking for. You can find
> the djgpp ports under v2gnu on your local simtel mirror.
Since he's only looking to parse out simply-delimited strings, you're
probably biting off more than he can chew.
He can use the ANSI C library call strtok to do the work for him.
If commandLine is a character array holding the full command line, then
this code will print each command, presuming you want the commands
delimited by spaces:
char *s;
for (s = strtok(commandLine, " "); s; s = strtok(0, " ")
printf("%s\n", s);
Quite a bit simpler. If he wants to embed spaces in the command line with
escape characters or in double quotes, then he's going to have to do that
himself.
--
Erik Max Francis, &tSftDotIotE / email: max AT alcyone DOT com
Alcyone Systems / web: http://www.alcyone.com/max/
San Jose, California, United States / icbm: 37 20 07 N 121 53 38 W
\
"E pur, / sic muove!"
/ Galileo Galilei
- Raw text -