// Code derived from Stroustrup's PPP2 book// § 8.5.8 Function call implementation// -and beginning on p 286#include<iostream>usingnamespacestd;classToken{public:charkind='K';// what kind of token};classToken_stream{public:Tokenget();// get a Token (get() is defined elsewhere)private:Tokenbuffer;};TokenToken_stream::get(){returnbuffer;}doubleterm(Token_stream&ts);doubleprimary(Token_stream&ts);doubleexpression(Token_stream&ts){doubleleft=term(ts);Tokent=ts.get();// ...cout<<t.kind<<'\n';returnleft;}doubleterm(Token_stream&ts){doubleleft=primary(ts);Tokent=ts.get();switch(t.kind){// ...case'/':{doubled=primary(ts);// ...cout<<d<<'\n';}// ...}returnleft;}doubleprimary(Token_stream&ts){Tokent=ts.get();switch(t.kind){case'(':{doubled=expression(ts);// ...cout<<d<<'\n';}// ...}return0.0;}intmain(){Token_streamts;expression(ts);}