Appendix A: System Routines — EStack Utilities
527
TI
-
89 / TI
-
92 Plus Developer Guide
Not for Distribution
Beta Version January 26, 2001
next_expression_index
Declaration:
EStackIndex
next_expression_index
(EStackIndex
i
)
Category(ies):
EStack Utilities
Description:
Returns the index of the next expression deeper than the one indexed
by
i
.
Inputs:
i
— Index of the top (highest address) tag of an expression.
Outputs:
Index of the quantum just below (lower address) the entire expression
indexed by
i
.
Assumptions:
None
Side Effects:
Throws an ILLEGAL_TAG_ERROR, if
i
or one of its subexpressions does
not contain a valid tag. This indicates a malformed estack or an
i
that is
pointing to an END_TAG, into the middle of a number, or into the middle of
a variable name, for example.
Availability:
All versions of the TI
-
89 / TI
-
92 Plus.
TI
-
89 / TI
-
92 Plus
Differences:
None
See Also:
None
Example:
/*********************************************************/
/* Title: remaining_element_count */
/* Description: Get number of expressions in tail. */
/* Input: estack index i */
/* i indexes a tail of expressions terminated */
/* by END_TAG. */
/* Output: unsigned number of expressions in the tail */
/*********************************************************/
ELEMENT_COUNT remaining_element_count (EStackIndex i) {
ELEMENT_COUNT ans = 0u;
while (ESTACK (i) != END_TAG) {
++ans;
i = next_expression_index (i);
}
return (ans);
}