|
|
|
How to select
the object kind |
How to select the object kind
To get the information about the kind of an object, you have the
routine s_o_k(), look at the following part of the pseudostandard
routine print:
...
INT print(a) OP a;
...
switch(s_o_k(a)) {
case INTEGER: return(print_integer(a));
...
}
...
The complete description of this selection of the object's kind is:
- The NAME is s_o_k, which abbreviates
- The SYNOPSIS reads as follows:
OBJECTKIND s_o_k(OP object) |
- Its DESCRIPTION is: As OP is a pointer, there is first a check,
whether it is the NULL pointer, then it returns the kind of the
object
- RETURN: The returnvalue is the kind, or in the case of an error
the value (OBJECTKIND)ERROR. You have to cast because in the normal
case ERROR is of type INT.
- The corresponding MACRO: There is a macro S_O_K without a
check
harald.fripertinger "at" uni-graz.at, May 26,
2011
|
|
|
|
|
How to select
the object kind |
|
|