Age | Commit message (Collapse) | Author | Files | Lines |
|
This exercise was a real pain in the ass. The original use of
getch() and ungetch() was inferior to a line-based approach. It
really doesn't seem like the way a parser should be built, but
it taught me a little about the order of recursion. I'm convinced
that a debugger is necessary if you want to build a good parser.
This implementation doesn't recurse in a natural way, or even
enough to stack data type prefixes. Hopefully by the time I get to
5-20 I'll have enough ideas to implement something that *does*
recurse well.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This exercise was somewhat irritating until I caved and used the code in
section 5.6 like the exercise suggested. The solution is not what I
think is clean, but given that [mc]*alloc haven't been covered yet, it's
probably the best one can muster.
Once I used the code in ยง5.6, the program fell into place. Still, it was
a neat exercise.
|
|
|
|
This one was pretty rough. At first I wanted to include a bunch of
error-catching and "smart" stuff. When I took a second look at it and
realized `itoa` returns 0 on a string, things became a bit easier. I
may have been able to outsource a few things to a function or two, but
overall I think it worked out.
|
|
|
|
|
|
This exercise was fun and taught me a bit about initializing arrays and
working with pointers.
|
|
|
|
|
|
This exercise was not very fun or interesting. While I somewhat enjoyed
learning to use pointers, this was a bunch of busywork. It felt like
homework, and that's terrible. It's the first exercise I've outright
disliked. If you're writing a programming book, *don't* make exercises
like this one!
|
|
This exercise seemed like it was designed to "pull it all together"
with things learned in the previous few pages. Not much new in terms
of techniques, but more a test to see how you could blend everything
together.
|
|
Detailed answers below the question will only occur now if I cannot
explain myself well enough in code and nearby comments. I'm looking
to learn how to write better comments so there's less need for prose.
|
|
|
|
|
|
|