Re: CECS343 Prog2

Kris Ganjam (cckris@mxyzptlk.atc.missouri.edu)
Wed, 8 Oct 1997 17:49:44 -0500


> It compiled with the main progam you provided, but it does not produce the
> right result. For example, given the sample input, it outputs:
>
> 1 BEGIN
> 14 EGIN EGIN
> ...
>
> I guess it chopped the first character. Then it would be an unrecognized
token.
> I'll give you
> 90/100
> Is this fair?

Actually, I was also basing my code on an older "sample1.slang" which had tabs
(or multiple spaces?) in front of every line. Since I didn't notice that your
main2.c calls nextchar() before beginning the nexttoken() loop, the very first
character in the input file is missed. My nexttoken() assumed that it would be
the only one with reason to call nextchar(). So, except for the first token,
my output is correct. I'll be more careful to check for changes to the source
and data files next time. -Kris.

p.s. - looking at the date on your main2.c, it is possible that I modified my
copy of main2.c to use nexttoken() instead of next_token(), but I don't recall
it and am not sure why I would have. I am sure, though, that my working copy
of sample1.slang was different than the current one.

--------------------------------------------------------
Kris Ganjam Advanced Technology Center
cckris@showme.missouri.edu http://www.atc.missouri.edu
voice: (573)882-7600 fax: (573)884-6700
--------------------------------------------------------