Texas Instruments TI89 Developer Guide - Page 212
User and Application Defined Functions and Programs, External Versus Internal Tokenized Polish
![]() |
UPC - 033317198566
View all Texas Instruments TI89 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 212 highlights
170 Chapter 15: Expressions and The Expression Stack Expression ClrHome DelVar x Disp a, b Representation CLRHOME_TAG COMMAND_TAG X_VAR_TAG DELVAR_TAG COMMAND_TAG END_TAG B_VAR_TAG A_VAR_TAG DISP_TAG COMMAND_TAG Table 15.11: Command Tag Examples 15.2.10. User and Application Defined Functions and Programs Both calculator users and application developers can provide new functions and programs. References to them are all represented in the same way. The topmost identifying tag is USER_FUN_TAG. Next comes a variable name representation that specifies the name of the function or program. Finally comes a tail of arguments. Thus, if a user or application defines a function f(x), then the function reference f(0) is represented by END_TAG 0 NONNEGATIVE_INTEGER_TAG F_VAR_TAG USER_FUN_TAG. If a user or application defines a program pa(x, y, z), then the program reference pa( c, "dd", L1) is represented by END_TAG 1 1 NEGATIVE_INTEGER_TAG 0 d d 0 STR_DATA_TAG C_VAR_TAG VAR_TAG p a VAR_TAG USER_FUN_TAG. 15.3. External Versus Internal Tokenized Polish The system actually uses two slightly different tokenized forms. The tokenizer produces a form called external tokenized form, which has been described in the previous sections. This form has individual tags for representing all of the operators, functions, and commands provided by the system. This form allows for all the different ways that expressions may be represented including multiple representations of the same expression. For example, a / b and a * (b ^ L1) are different representations of the same expression. The simplifier produces a form called internal tokenized form. The two primary reasons for this second form are expression recognition and efficiency of implementation. The simplifier must be able to recognize when expressions are similar or the same. Thus, expressions are translated into a standard form using fewer tags, allowing the simplifier to more easily recognize expressions that combine or cancel. Fewer tags and a standardized form allow the implementation of the simplifier to be smaller and faster. The following tags only occur in external tokenized form. Simplification replaces these tags with a standard internal form. TI-89 / TI-92 Plus Developer Guide Not for Distribution Beta Version January 26, 2001
![](/manual_guide/products/texas-instruments-ti89-developer-guide-95b636f/212.png)