Chapter 6.7 does not define ts

91 views
Skip to first unread message

Seth King

unread,
Oct 10, 2013, 3:54:53 PM10/10/13
to ppp-p...@googlegroups.com
At the end of chapter 6.6 we are to modify expression(), term(), and primary(). In 6.7 we are to test the new version of the calculator. However, before I can do that, I first need to compile my new version. I get these compile errors:

http://pastebin.com/dqT02tw0

So, I'm going to need to declare ts, but that code is not provided anywhere that I can see. Here is my current calculator00.cpp that does not yet compile:

http://pastebin.com/n9Fs1D3U

Stroustrup doesn't really seem to address Token Streams until 6.8, but I should still at least be able to get the calculator working from 6.7 from the information already given, which doesn't declare ts or provide the code for any Token_stream class or anything. Any help to get the second version calculator00 working would be great. Thank you.

cortical_iv

unread,
Jun 18, 2018, 10:27:16 AM6/18/18
to PPP-public
You sort of have to read the entire chapter, and implement bits piece by piece. And he has the code at his site with some bugs (on purpose as an exercise for you to fix). here is a full working version highly annotated:
Reply all
Reply to author
Forward
0 new messages