const char let = 'L';
const char quit = 'Q';
const char print = ';';
const char number = '8';
const char name = 'a';
Token Token_stream::get()
{
if (full) { full=false; return buffer; }
char ch;
cin >> ch;
switch (ch) {
case '(':
case ')':
case '+':
case '-':
case '*':
case '/':
case '%':
case ';':
case '=':
return Token(ch);
case '.':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
{ cin.unget();
double val;
cin >> val;
return Token(number,val);
}
default:
if (isalpha(ch)) {
string s;
s += ch;
while(cin.get(ch) && (isalpha(ch) || isdigit(ch))) s=ch;
cin.unget();
if (s == "let") return Token(let);
if (s == "quit") return Token(name);
return Token(name,s);
}
error("Bad token");
}
}
void Token_stream::ignore(char c)
{
if (full && c==buffer.kind) {
full = false;
return;
}
full = false;
I am really lost with all of this, it wasn't properly explained and no matter how much I ask for help it just seems like words dig me into a deeper misunderstanding hole..
Yes indeed I am! But, unfortunately, it's just not clicking in my head x/ Like I no matter how many times I read the book, the chapters, they're just not making any sense in my head.. Is programming somewhat like an either you get it or you don't type/deal situation? lol
Well I would believe I was lucky if I actually understood the guy haha he is indeed very intellectual and has a vast experience in the computer world, though the problem is I have none, zero experience with programming but is something I would like to do, it is why I'm in the Introduction to C++ course but it seems that everyone else in the class has had some programming experience and knowledge prior to enrolling in the course so to me it feels as if though they're making me jump from the bird's nest with no wings.. Like I guess even though it's an "Introductory" course they're assuming everyone knows most of the things (and most people do) but they (I say they because Dr. Stroustrup teaches the course with Dr. Daughterity) simply go on with terms I have never ever used before and what not.. So I'm pretty darn lost heh xP.
So..what are you doing here? xD e-mail him!!!! ask for extra classes!!!!!!! >.<
This book begins making cakes -no joke you know it-,it's aimed to beginners! -really beginners-.
You have to be emailing him!!!! asking questions every day!!!!!
You are the luckiest C++ beginner programmer in the world! >.<!!!