Hi,
It looks to me that
t
is of type
Token
, which has a public member
value
, so to access that you need
t.value
as in:
187 188 189
|
if (t.kind == ';') // ';' for "print now"
cout << "=" << t.value << '\n';
else
|
So the rules for accessing info from a class:
1. Make a variable in main of the type of the class (An Object) (line 184);
2. Public member variables can be accessed with the Object variable name, the dot operator, and the member variable name, as in:
t.value
;
3. Public class member functions can be called through an object . If a
MyTokenFunction
existed, then one could call it with
t.MyTokenFunction()
. The function can take arguments and return a value, which should be assigned to a variable of a compatible type.
Hope all goes well :+)
Edit:
I hadn't seen
cire post, and there are several things going on here.