Texas Instruments TI89 Developer Guide - Page 1128
Sysvar_tag, Secondary_tag, Command_tag, If Is_user_var Q
UPC - 033317198566
View all Texas Instruments TI89 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 1128 highlights
1086 Appendix A: System Routines - Token Operations get_key_ptr (continued) Example: /* The system only uses get_key_ptr after user variables, arbitrary constants, and numbers have been processed. If i is the EStackIndex of an expression, and kp is an unsigned char pointer, then the following is an appropriate approach. */ Quantum q, r; q = ESTACK (i); /* get the topmost tag */ r = 0; /* assume the topmost tag is a primary tag */ if (IS_USER_VAR (q)) /* check for user variables */ { . . . /* code to handle user variables */ } else if (IS_ARB_TAG (q)) /* check for arbitrary constants */ { . . . /* code to handle arbitrary constants, @1, @n1, etc. */ } else if (IS_NUMBER_TAG (q)) /* check for numbers */ { . . . /* code to handle numbers */ } else if (IS_DOUBLE_TAG (q)) /* check for tokens that require two values */ { /* SYSVAR_TAG, SECONDARY_TAG, COMMAND_TAG */ r = ESTACK (i - 1); } kp = get_key_ptr (q, r); /* get pointer to catalog string */ . . . /* if q = SIN_TAG and r = 0, then get_key_ptr (q, r) returns a pointer */ /* to the string "sin(". */ /* */ /* if q = SYSVAR_TAG and r = SV_XMIN, then get_key_ptr (q, r) returns a */ /* pointer to the string "xmin". */ /* */ /* if q = SECONDARY_TAG and r = GETKEY_TAG, then get_key_ptr (q, r) */ /* returns a pointer to the string "getkey()". */ TI-89 / TI-92 Plus Developer Guide Not for Distribution Beta Version January 26, 2001