The <estack.h> Header File

Routines for symbolic manipulation and expression handling

Functions

add_to_top
Adds a value to the expression on the top of the estack.
add1_to_top
Adds 1 to the top of the estack.
all_tail
Checks whether all elements in the list have some property.
and_onto_top
Logical ANDs the expression onto the estack.
any_tail
Checks whether any element in the list has some property.
are_expressions_identical
Checks whether two expressions are identical.
can_be_approxed
Checks whether an expression can be approximated to a number.
check_estack_size
Checks if there is enough room on the expression stack.
compare_complex_magnitudes
Compares magnitudes of two complex number entries on the expression stack.
compare_expressions
Compares two expressions.
compare_Floats
Compares two floating point entries on the expression stack.
delete_between
Deletes a sequence of bytes from the expression stack.
delete_expression
Deletes an expression from the expression stack.
deleted_between
Deletes a sequence of bytes from the expression stack.
deleted_expression
Deletes an expression from the expression stack.
did_push_cnvrt_Float_to_integer
Pushes a floating point entry converted to an integer, but only if it is an exact whole number.
display_statements
Converts tokenized expressions or TI-Basic statements to the printable form.
estack_number_to_Float
Converts entry on the expression stack to floating point number.
estack_to_short
Converts entry on the expression stack to signed short integer.
estack_to_ushort
Converts entry on the expression stack to unsigned short integer.
ESTACK
Reads the expression stack at a specific index.
factor_base_index
Gets the index of the base of an expression.
factor_exponent_index
Gets the index of the exponent of an expression.
gcd_exact_whole_Floats
Finds the greatest common divisor of two floating point entries.
get_key_ptr
Converts a tag code to a tag name.
GetValue
Converts entry on the expression stack to short integer and checks whether it is in a given range.
HS_popEStack
Pops the entire expression stack into memory.
HToESI
Converts a handle to an expression stack index.
im_index
Gets the index of the imaginary part of an expression.
index_below_display_expression_aux
Main routine for detokenizing.
index_main_var
Searches an expression for a first encountered variable.
index_numeric_term
Searches terms in the expression for a numeric term.
index_of_lead_base_of_lead_term
Gets the index of the base of the lead term of an expression.
integer_non_unknown
Tests if an expression is an integer.
is0
Tests if an expression is equal to 0.
is1
Tests if an expression is equal to 1.
is_advanced_tag
Checks whether a tag is an advanced tag.
is_antisymmetric
Checks for a antisymmetry.
is_complex0
Checks whether an expression is reducible to zero.
is_complex_number
Checks whether an expression is a number.
is_constant
Checks whether an expression is constant.
is_Float_exact_whole_number
Checks whether a floating point entry is an exact whole number.
is_free_of_tag
Checks whether an expression is free of a particular tag.
is_independent_of_de_seq_vars
Checks whether an expression is independent of differential equation and sequence variables.
is_independent_of_elements
Checks whether an expression is independent of the elements of a list.
is_independent_of_tail
Checks whether an expression is independent of a sequence of variables (or expressions).
is_independent_of
Checks whether an expression is independent of a variable (or expression).
is_matrix
Checks whether an expression is a matrix.
is_minus1
Tests if an expression is equal to -1.
is_monomial_in_kernel
Checks whether an expression is a monomial in kernel.
is_monomial
Checks whether an expression is a monomial.
is_narrowly_independent_of
Checks whether an expression is narrowly independent of a variable (???).
is_negative
Tests if an expression is less than 0.
is_never0
Tests if an expression is never 0.
is_nonnegative
Tests if an expression is >= 0.
is_nonpositive
Tests if an expression is <= 0.
is_polynomial_in_var_or_kern
Checks if an expression is a polynomial with respect to another expression.
is_positive
Tests if an expression is greater than 0.
is_square_matrix
Checks whether an expression is a square matrix.
is_symmetric
Checks for symmetry.
is_tail_independent_of
Checks whether a sequence of expressions is independent of a variable (or expression).
is_totally_polynomial
Checks if an expression is polynomial in all variables.
is_valid_smap_aggregate
Checks whether an expression is a valid aggregate type.
is_variable
Checks if the expression is a variable.
is_whole_number
Tests if an expression is a whole number.
last_element_index
Searches for the last expression in the list.
lead_base_index
Gets the index of the base of the lead factor of an expression.
lead_exponent_index
Gets the index of the exponent of the lead factor of an expression.
lead_factor_index
Gets the index of the lead factor of an expression.
lead_term_index
Gets the index of the lead term of an expression.
likely_approx_to_complex_number
Checks if it is likely that an expression can be approxed to a complex number.
likely_approx_to_number
Checks is it likely that an expression can be approxed to a real number.
main_gen_var_index
Searches an expression for a generalized variable.
map_tail_Int
Applies an extended function to all elements in the list.
map_tail
Applies a function to all elements in the list.
map_unary_over_comparison
Calls callback function for both comparison terms and pushes the comparison tag.
min_quantum
Finds smaller of two tags.
move_between_to_top
Moves a sequence of bytes to the top of the expression stack.
moved_between_to_top
Moves a sequence of bytes to the top of the expression stack.
negate_top
Negates the top of the estack.
next_expression_index
Finds the next entry on the expression stack.
NG_approxESI
Evaluates an expression in "APPROX" mode.
NG_execute
Executes TI-Basic statements.
NG_graphESI
Evaluates an expressions for graphing purposes.
NG_rationalESI
Evaluates an expression in "EXACT" mode.
NG_RPNToText
Detokenizes a tokenized structure associated with a handle.
NG_tokenize
Tokenizes text associated with a handle and pushes them to the expression stack.
norm1_complex_Float
Finds the 1-norm of a complex number entry.
numeric_factor_index
Searches factors in the expression for a numeric factor.
Parms2D
Gets information about dimensions of block which will be "pretty printed".
Parse1DExpr
Parses a tokenized expression to be printed.
Parse2DExpr
Parses a tokenized expression to be pretty printed using Print2DExpr.
Parse2DMultiExpr
Parses a multi-statement expression associated with a handle to be pretty printed using Print2DExpr.
Print2DExpr
Performs "pretty printing" (or "2D printing") of an expression.
push_ANSI_string
Pushes a standard C string to the expression stack.
push_between
Pushes a sequence of bytes to the expression stack.
push_cnvrt_integer_if_whole_nmb
Pushes a floating point entry eventually converted to an integer.
push_END_TAG
Pushes end-of-list marker to the expression stack.
push_expr_quantum
Pushes an expression followed by a tag to the expression stack.
push_expr2_quantum
Pushes two expressions followed by a tag to the expression stack.
push_expression
Pushes an expression to the expression stack.
push_Float_to_nonneg_int
Rounds a floating point value to an integer, then pushes it to the expression stack.
push_Float_to_rat
Pushes a rational approximation of a floating point entry.
push_Float
Pushes a floating point value to the expression stack.
push_internal_simplify
Converts an expression into internal canonic form and pushes the result to the expression stack.
push_LIST_TAG
Pushes list tag to the expression stack.
push_long_to_integer
Pushes a signed long integer to the expression stack.
push_longint
Pushes a long integer to the expression stack.
push_longlongint
Pushes a double-long integer to the expression stack.
push_next_arb_int
Pushes a next "arbitrary integer" symbol to the expression stack.
push_next_arb_real
Pushes a next "arbitrary real" symbol to the expression stack.
push_next_internal_var
Pushes an internal variable to the expression stack.
push_offset_array
Pushes an array of offsets to the list items.
push_overflow_to_infinity
Displays a warning, and pushes a tag to the expression stack.
push_parse_text
Parses an expression given in a string and pushes tokenized expression to the expression stack.
push_quantum_pair
Pushes two bytes (tags) to the expression stack.
push_quantum
Pushes a byte (tag) to the expression stack.
push_reversed_tail
Pushes elements of the list up to tail onto the stack in reversed order.
push_round_Float
Pushes an approximation of a floating point entry.
push_shortint
Pushes a short integer to the expression stack.
push_simplify
Simplifies the argument and pushes onto the estack.
push_transpose_aux
Pushes transposed matrix to the expression stack.
push_ulong_to_integer
Pushes an unsigned long integer to the expression stack.
push_ushort_to_integer
Pushes an unsigned short integer to the expression stack.
push_zstr
Pushes a standard C string to the expression stack.
re_index
Gets the index of the real part of an expression.
reductum_index
Gets the index of remaining terms of an expression.
remaining_element_count
Returns number of elements remaining.
remaining_factors_index
Gets the index of remaining factors of an expression.
reset_control_flags
Resets the control flags for operations with the expression stack.
reset_estack_size
Reallocates the expression stack.
should_and_did_push_approx_arg2
Pushes a second floating point argument, if possible.
signum_Float
Finds the signum of a floating point entry.
subtract_from_top
Subtracts a value from the top of the estack.
subtract1_from_top
Subtracts 1 from the top of the estack.
TokenizeSymName
Tokenizes a C string into a symbol name.

Global Variables

ARb_int_count
Represents the number of times arbitrary-integer variables were already used by some calculus.
ARb_real_count
Represents the number of times arbitrary variables were already used by some calculus.
bottom_estack
Points to the bottom of the expression stack.
top_estack
Points to the top of the expression stack.

Constants

H_NULL
A null-handle value.
NULL_INDEX
Describes an empty expression stack index.

Predefined Types

bcd
Represents the internal organization of floating point numbers in the format recognized by the TIOS.
Bool
An enumeration to describe true or false values.
CESI_Callback_t
Represents a pointer to a CESI callback function.
CESI
Represents a pointer to a constant expression.
ESI_Callback_Int_t
Represents a pointer to an ESI callback function with integer extensions.
ESI_Callback_t
Represents a pointer to an ESI callback function.
ESI
Represents an index of a value on the TIOS expression stack.
ESQ
Represents a quantum within an expression.
EStackIndex
Represents an index of a value on the TIOS expression stack.
ExtTags
An enumeration to describe extra types of entries on the expression stack.
HANDLE
Represents a handle associated with an allocated memory block.
InstructionTags
An enumeration to describe types of instructions on the expression stack.
MULTI_EXPR
Describes a multi-expression, which is processed as a separate expression stack.
Quantum
Represents a quantum within an expression.
SCR_RECT
A scructure for defining a rectangular area.
SCR_STATE
A structure for saving the state of the graphics system.
SYM_STR
Represents a pointer to the terminating zero byte of a string.
SysvarTags
An enumeration to describe types of system variable entries on the expression stack.
Tags
An enumeration to describe types of entries on the expression stack.
ti_float
An alias for the standard ANSI float type.
TokenizeSymNameFlags
Contains flags specifying how a symbol name is tokenized.
WINDOW
The main window-describing structure.

See also: args.h


add_to_top

AMS 2.02 or higher

void add_to_top (CESI ptr);

Adds a value to the expression on the top of the estack.

add_to_top adds the expression pointed to by ptr to the expression currently at the top of the estack and stores the result to the top of the estack, in place of the expression that was added to.

See also: subtract_from_top, and_onto_top, negate_top, add1_to_top


add1_to_top

AMS 2.02 or higher

void add1_to_top (void);

Adds 1 to the top of the estack.

add1_to_top adds 1 (or 1.0) to the value on the top of the estack. This routine basically calls add_to_top with "1" as the pointed-to value.


all_tail

AMS 1.01 or higher

short all_tail (CESI_Callback_t f, ESI start_ptr);

Checks whether all elements in the list have some property.

all_tail is similar to map_tail, but callback function f is not void. It needs to return a Boolean value (TRUE or FALSE). If f returns FALSE, any further processing of the list tail will be stopped, even if END_TAG is not reached yet. The result of all_tail is the last value returned from f. In other words, it returns TRUE if and only if the callback function f returns TRUE for each expression in the tail of expressions indexed by element_ptr.

all_tail is very useful to check whether all elements of a list possess some property. Suppose that you defined the following function which checks whether an entry on the expression stack is a positive integer:

short is_positive_integer (ESI ptr)
{
  return (*ptr == POSINT_TAG);
}

and suppose that start_ptr points to the first element of the list (one byte below LIST_TAG). Then, you can use the following call to check whether all elements of the lists are positive integers:

are_all_positive_integers = all_tail (is_positive_integer, start_ptr);

and_onto_top

AMS 2.02 or higher

void and_onto_top (CESI ptr);

Logical ANDs the expression onto the estack.

and_onto_top replaces the top expression on the estack with the logical AND of itself and ptr.

See also: add_to_top, subtract_from_top, negate_top


any_tail

AMS 1.01 or higher

short any_tail (CESI_Callback_t f, ESI start_ptr);

Checks whether any element in the list has some property.

any_tail is similar like all_tail, except further processing of the list will be stopped if f returns TRUE instead of FALSE. In other words, it returns TRUE if and only if the callback function f returns TRUE for at least one expression in the tail of expressions indexed by element_ptr. any_tail is very useful to check whether any element of a list possesses some property. Assuming the same assumptions as in the example given with all_tail, the following call will check whether any element of the list is a positive integer:

is_any_positive_integer = any_tail (is_positive_integer, start_ptr);

are_expressions_identical

AMS 1.01 or higher

short are_expressions_identical (CESI ptr1, CESI ptr2);

Checks whether two expressions are identical.

are_expressions_identical returns TRUE if expressions pointed to by ptr1 and ptr2 are syntactically identical, else returns FALSE. At the moment, I am not exactly sure what is the criteria for equivalence. I only know that a+b and b+a are not identical for example. And, floats are never identical to rational numbers. So far, I only know that this function surely returns TRUE when two expressions are absolutely identical. But, if this is the only case of equivalence, this routine should be very simple. But it is not. It is very complicated and recursive, so I am really not sure which pairs of expressions may be treated as "identical". Any additional info is welcomed.


can_be_approxed

AMS 1.01 or higher

short can_be_approxed (CESI ptr, short Complex);

Checks whether an expression can be approximated to a number.

can_be_approxed returns TRUE if the expression pointed to by ptr can be approximated to a number (including transfinite ones) or a list of numbers (such expression are for example 'ln(2+sin(1))/5', '1/0' or 'x^2+1-x*x'), else returns FALSE. Complex is a Boolean parameter: if it is TRUE, complex results will be allowed, but if it is FALSE, complex results will be treated as "can not be approxed".

Note: can_be_approxed performs much detailed investigation than functions likely_approx_to_number and likely_approx_to_complex_number.


check_estack_size

AMS 1.01 or higher

void check_estack_size (unsigned short Size);

Checks if there is enough room on the expression stack.

check_estack_size checks if there is enough room to push Size bytes to the expression stack. If there is not enough space, it tries to enlarge the stack (using HeapRealloc) to make additional space. It throws an error if the requirement cannot be satisfied. Note that all "push_..." functions call this routine, so all of them may throw an error if there is not enough memory.


compare_complex_magnitudes

AMS 1.01 or higher

short compare_complex_magnitudes (CESI ptr1, CESI ptr2);

Compares magnitudes of two complex number entries on the expression stack.

compare_complex_magnitudes compares two complex number entries (which may be real also) on the expression stack pointed to by ptr1 and ptr2, and returns a value which is


compare_expressions

AMS 1.01 or higher

short compare_expressions (CESI ptr1, CESI ptr2);

Compares two expressions.

compare_expressions returns 0 if two expressions pointed to by ptr1 and ptr2 are equal in the sense that they have the same structure, variables, function names, and numbers that compare equal. A float and a rational number compare equal if converting the rational number to a float produces an identical number. If the expressions are not, it returns a non-zero value which may be positive or negative (more precise, 1 or -1). Positive result means that the expression pointed to by ptr1 is "more main" that the expression pointed to by ptr2, and negative result means "less main". Principally, variables are more main than symbolic constants such as pi, which are more main than numbers. In expressions such as 'expand(...,var)' or 'Integral(...,var)', a variable var is "most main". Otherwise, the 26 Roman one-letter variables order r>>s>>...>>z>>a>>b>>...>>q ('>>' means "more main"), which order more main than all other variables, which order alphabetically. Functions and operators are typically ordered by recursively comparing their first arguments, with ties broken by comparing their second arguments, etc. then finally comparing the operators or functions, if necessary. For example:

Note: Both expressions should be in internal canonic form (see push_internal_simplify), else this function may not work as expected.


compare_Floats

AMS 1.01 or higher

long compare_Floats (CESI ptr1, CESI ptr2);

Compares two floating point entries on the expression stack.

compare_Floats compares two floating point entries on the expression stack pointed to by ptr1 and ptr2, and returns a value which is

So, this function is similar like fcmp, except the arguments are different (fcmp uses floating point arguments, and compare_Floats uses pointers to floating point entries on the expression stack).


delete_between

AMS 1.01 or higher

void delete_between (ESI ptr1, ESI ptr2);

Deletes a sequence of bytes from the expression stack.

delete_between deletes a sequence of bytes between ptr1 and ptr2 (more precise, starting at ptr1+1 and ending at ptr2) from the expression stack. It does this by moving the memory from ptr2+1 to top_estack downwards (using memmove) and adjusting top_estack. This routine assumes that ptr1 and ptr2 really point to parts of the expression stack and that ptr2 is above ptr1, otherwise the result is unpredictable.


delete_expression

AMS 1.01 or higher

void delete_expression (ESI ptr);

Deletes an expression from the expression stack.

delete_expression deletes an entry on the expression stack pointed to by ptr (it needs to point to the entry tag) from the stack. The entry need not be a simple entity; it may be a complex symbolic expression too. This is achieved by calling next_expression_index and delete_between.


deleted_between

AMS 1.01 or higher

unsigned short deleted_between (ESI ptr1, ESI ptr2);

Deletes a sequence of bytes from the expression stack.

deleted_between acts like delete_between, but it also returns a number of deleted bytes. Note that delete_between calls memmove for moving memory after ptr2, but deleted_between uses an embedded loop sequence for the same task. I don't know why these two routines use different methods: as I can see, the final effect is the same. Maybe I am wrong?


deleted_expression

AMS 1.01 or higher

unsigned short deleted_expression (ESI ptr);

Deletes an expression from the expression stack.

deleted_expression acts like delete_expression, but it also returns a number of deleted bytes. It calls deleted_between instead of delete_between.


did_push_cnvrt_Float_to_integer

AMS 1.01 or higher

short did_push_cnvrt_Float_to_integer (CESI ptr);

Pushes a floating point entry converted to an integer, but only if it is an exact whole number.

did_push_cnvrt_Float_to_integer is a subroutine used in push_cnvrt_integer_if_whole_nmb. It assumes that ptr points to a floating point entry. If it is a whole number (including big numbers too), did_push_cnvrt_Float_to_integer pushes the number converted to a tagged integer to the expression stack, and returns TRUE, otherwise it does nothing and returns FALSE.


display_statements

HANDLE display_statements (CESI ptr, unsigned short Newlines, unsigned short FullPrec);

Converts tokenized expressions or TI-Basic statements to the printable form.

display_statements converts the expression (or a group of tokenized TI-Basic statements) pointed to by ptr from RPN form to the standard printable ("algebraic") form, and returns a handle to the memory block where the converted string is stored (you don't need to allocate anything by yourself, this function will do it instead; note that this routine may cause heap compression). It will return H_NULL if memory is full. Newline is a Boolean flag: when it is nonzero, all newline characters will be replaced with ':', otherwise they will remain intact. FullPrec is also a Boolean flag: when it is non-zero, all floating point values will be converted using the maximal precision (14 digits), else current precision settings (from TI-Basic MODE dialog) will be used. Here is an illustrative example for usage of this command (take a look at the "Integrate" example as well):

push_parse_text ("expand((x+1)(x+2)(x+3))");
NG_rationalESI (top_estack);
handle = display_statements (top_estack, 1, 1);
printf_xy (0, 40, "%s", HeapDeref (handle));
HeapFree (handle);

See push_parse_text, NG_rationalESI, HeapDeref and HeapFree to understand how this example works.

Note: Handles returned by display_statements aren't locked so any heap compression will move the block associated with the handle. Therefore it is safer to lock them using HLock and HeapUnlock than to just dereference them using HeapDeref.

display_statements will always convert expressions into the "canonic printing (external) form". For example, both x*3 and 3*x will be displayed as 3*x, x*y^(-1) will be displayed as x/y etc.

Note: Although display_statements is very similar to Parse1DExpr and both of them may usually be used for the same purposes, display_statements is used in TIOS for printing TI-Basic statements (from programs) and for the detokenization (in NG_RPNToText), and Parse1DExpr is used for printing expressions.


estack_number_to_Float

AMS 1.01 or higher

float estack_number_to_Float (CESI ptr);

Converts entry on the expression stack to floating point number.

estack_number_to_Float converts an entry on the expression stack pointed to by ptr (it needs to point to the entry tag) to a floating point value and returns the result. Note that the entry need not be represented by FLOAT_TAG: it also may be represented by an integer, or by a fraction. This function does not remove the entry from the stack.

Note: estack_number_to_Float will throw an error if the entry on the stack is not a floating point number, a fraction or an integer, so you will need to use ER_catch to catch eventual errors.


estack_to_short

AMS 1.01 or higher

short estack_to_short (CESI ptr, short *value_ptr);

Converts entry on the expression stack to signed short integer.

estack_to_short converts an entry on the expression stack pointed to by ptr (it needs to point to the entry tag) to a signed short integer and stores the result in the location pointed to by value_ptr. Note that the entry need not be represented by POSINT_TAG or NEGINT_TAG: it also may be represented by FLOAT_TAG for example, but the value itself needs to be a whole number. This function does not remove the entry from the stack.

estack_to_short returns 1 if the conversion was successful, 0 in the case of overflow (in this case the stored result will be -32768 or 32767 depending of the direction of the overflow), and -1 if the entry can not be represented as a whole number (in this case the result is undefined).


estack_to_ushort

AMS 1.01 or higher

short estack_to_ushort (CESI ptr, unsigned short *value_ptr);

Converts entry on the expression stack to unsigned short integer.

estack_to_ushort converts an entry on the expression stack pointed to by ptr (it needs to point to the entry tag) to a unsigned short integer and stores the result in the location pointed to by value_ptr. Note that the entry need not be represented by POSINT_TAG or NEGINT_TAG: it also may be represented by FLOAT_TAG for example, but the value itself needs to be a whole number. This function does not remove the entry from the stack.

estack_to_short returns 1 if the conversion was successful, 0 in the case of overflow (in this case the stored result will be 0 or 65535 depending of the direction of the overflow), and -1 if the entry can not be represented as a whole number (in this case the result is undefined).


ESTACK

#define ESTACK(idx) (*(idx))

Reads the expression stack at a specific index.

The ESTACK macro can be used to read the expression stack at the index idx. It simply dereferences idx, since the ESI and CESI types are in fact pointers to quantums of type ESQ.


factor_base_index

AMS 1.01 or higher

ESI factor_base_index (CESI ptr);

Gets the index of the base of an expression.

If ptr points to the POW_TAG, which is a case when it points to an expression of form base ^ exponent factor_base_index returns the pointer to base. If ptr does not point to the POW_TAG, factor_base_index returns ptr (i.e. the pointer to the expression itself).


factor_exponent_index

AMS 1.01 or higher

ESI factor_exponent_index (CESI ptr);

Gets the index of the exponent of an expression.

If ptr points to the POW_TAG, which is a case when it points to an expression of form base ^ exponent factor_exponent_index returns the pointer to exponent. If ptr does not point to the POW_TAG, factor_exponent_index returns a pointer to a simple expression which consists only of the number 1 (floating point or integer, depending on whether the approximation mode is active or not).


gcd_exact_whole_Floats

AMS 1.01 or higher

float gcd_exact_whole_Floats (CESI ptr1, CESI ptr2);

Finds the greatest common divisor of two floating point entries.

gcd_exact_whole_Floats finds the greatest common divisor of two floating point entries pointed to by ptr1 and ptr2 and returns the result (the result is a garbage if ptr1 or ptr2 doesn't point to floating point entries).

Note: Although the name of the function suggests that both entries need to be whole numbers, this is not true. This function, in fact, returns "generalized" GCD of two numbers x and y which is defined as the greatest number z which has a property that both x/z and y/z are whole numbers.


get_key_ptr

AMS 1.01 or higher

char *get_key_ptr (ESQ Tag1, ESQ Tag2);

Converts a tag code to a tag name.

get_key_ptr returns a static pointer to the string which represents the name of the tag Tag1. Tag2 is used only if Tag1 is an extended tag (i.e. EXT_TAG, EXT_INSTR_TAG or EXT_SYSTEM_TAG) which can't be fully represented using only one byte.

If the tag corresponds to a function, AMS 1.xx does not append '(' at the end of the string, but AMS 2.xx does. Thus, anyone who intends to use this function for function tokens should use extra code to handle both cases.


GetValue

AMS 1.01 or higher

long GetValue (CESI ptr, long low, long high);

Converts entry on the expression stack to short integer and checks whether it is in a given range.

GetValue converts an entry on the expression stack pointed to by ptr (it needs to point on the entry tag) to a short integer value using estack_to_short or estack_to_ushort, depending on the sign of low. Then, a "Domain Error" is thrown if the value is smaller than low or greater than high, otherwise the value will be returned as the result of the function. It will also throw a "Data type" error if the entry can not be represented as an integer.


HToESI

ESI HToESI (HANDLE Handle);

Converts a handle to an expression stack index.

HToESI is a simple but very useful routine. It returns a pointer to the last byte of the MULTI_EXPR structure referenced by Handle. Therefore it allows for the use of TIOS variables as input data in expression stack routines. Assuming that Handle is a handle of a TIOS variable which contains an expression, HToESI will return a pointer to the tag of the expression contained in the variable. Such a pointer may be used in any routine which needs an argument of type CESI, like NG_approxESI, etc. (except in functions which manipulate the actual memory space on the expression stack, like delete_between). In fact, HToESI simply dereferences Handle and adds the size plus 1 to the address. It also may be used to determine the type of a TIOS variable, because after execution the result points to the data type tag of the variable data.

Note: If the handle is not locked, HToESI must be called again after a heap compression since the block of memory associated with the handle may have moved.


im_index

AMS 1.01 or higher

ESI im_index (CESI ptr);

Gets the index of the imaginary part of an expression.

If ptr points to the COMPLEX_TAG (i.e. if the expression is complex), im_index returns the pointer to the imaginary part of the expression. If ptr does not point to the COMPLEX_TAG (i.e. if the expression is real), im_index returns a pointer to a simple zero expression, i.e. expression which consists only of the number 0 (floating point or integer, depending on whether the approximation mode is active or not).

Note: The expression should be in internal canonic form (see push_internal_simplify), else this function is not reliable.


index_below_display_expression_aux

AMS 1.01 or higher

ESI index_below_display_expression_aux (CESI ptr);

Main routine for detokenizing.

index_below_display_expression_aux is main (recursive) routine for detokenizing. As it is just an auxiliary routine used in display_statements and Parse1DExpr, it shouldn't need to be used directly.


index_main_var

AMS 1.01 or higher

ESI index_main_var (CESI ptr);

Searches an expression for a first encountered variable.

index_main_var returns the index of the first encountered variable in the expression pointed to by ptr. More precise, it repeatedly decreases value of ptr by one until the tag of a variable, a number or a symbolic constant (like pi) is reached. As expressions are usually organized in "internal canonic" form (see notes given with description of numeric_factor_index) in which all constants are always "below" variables on the stack, a variable will always be reached before any constant, except if there are not any variables in the expression (in this case, a pointer to a constant is returned). Obviously, this function is not reliable if the expression is not in the internal canonic form (see push_internal_simplify).


index_numeric_term

AMS 1.01 or higher

ESI index_numeric_term (CESI ptr);

Searches terms in the expression for a numeric term.

If ptr points to the ADD_TAG, which is a case when it points to an expression of form term1 + term2 + ... (i.e. if the expression is a sum of simpler terms), index_numeric_term returns the pointer to the eventual numeric term in the expression. If the expression is a number, index_numeric_term returns ptr (i.e. the pointer to the expression itself). If ptr does not point to the ADD_TAG (i.e. if the expression is not a sum of simpler terms), or if there are not any numeric terms in the expression, index_numeric_factor returns a pointer to a simple expression which consists only of the number 0 (floating point or integer, depending on whether the approximation mode is active or not).

Note: This function is not implemented to be very universal. TIOS always "reorganizes" expressions on such way that numeric terms are at the beginning of the expression (for example, x+3 will be reorganized into 3+x, although it will be displayed just reversed, i.e. as x+3), and this function assumes that the expression is organized on such way. In other words, it must be in internal canonic form (such expressions always have at most one term with a numeric tag, in which case it is the deepest term). Fortunately, all expressions in argument are always in internal canonic form. However, this is not true after push_parse_text function, nor after an evaluation using NG_rationalESI or NG_approxESI. In other words, results of these commands are not always "correctly" organized. To force converting an expression to the internal canonic form, always call push_internal_simplify after usage of any of the functions mentioned above.


index_of_lead_base_of_lead_term

AMS 1.01 or higher

ESI index_of_lead_base_of_lead_term (CESI ptr);

Gets the index of the base of the lead term of an expression.

index_of_lead_base_of_lead_term first calls lead_term_index, then apply lead_base_index on the result. So, it returns the pointer to the base of the lead factor of the first term of the expression pointed to by ptr.


integer_non_unknown

AMS 2.02 or higher

short integer_non_unknown (CESI ptr);

Tests if an expression is an integer.

Returns 1 if the expression pointed to by ptr is an integer or floating-point value; returns -1 for constants like p or e. Returns 0 for everything else - this includes expressions like ln(2), 2p, or Ö(2).


is0

AMS 2.00 or higher

short is0 (CESI ptr);

Tests if an expression is equal to 0.

Returns TRUE if the expression pointed to by ptr is equal to zero (integer or floating point).

See also: is1, is_minus1, is_never0


is1

AMS 2.00 or higher

short is1 (CESI ptr);

Tests if an expression is equal to 1.

Returns TRUE if the expression pointed to by ptr is equal to one (integer or floating point).

See also: is0, is_minus1


is_advanced_tag

AMS 1.01 or higher

short is_advanced_tag (ESQ Tag);

Checks whether a tag is an advanced tag.

is_advanced_tag returns TRUE if a byte Tag is an advanced tag, otherwise it returns FALSE. Advanced tags are all tags which do not represent a variable, a number (integer, fraction or float) or an expression which consists only of simple operations "+", "-", "*", "/" and "^" (including element-by-element versions "+.", "-.", "*.", "/." and "^.").


is_antisymmetric

AMS 1.01 or higher

short is_antisymmetric (CESI expr_ptr, CESI var_ptr);

Checks for a antisymmetry.

is_antisymmetric returns TRUE if the expression pointed to by expr_ptr is such that it changes the sign but keeps the same magnitude when the variable pointed to by var_ptr changes it sign, otherwise it returns FALSE.


is_complex0

AMS 1.01 or higher

short is_complex0 (CESI ptr);

Checks whether an expression is reducible to zero.

is_complex0 returns TRUE if the expression pointed to by ptr is a zero (signed, unsigned, or even complex), otherwise it returns FALSE.

Note: The information about this routine in releases of TIGCCLIB before 2.3 was wrong.


is_complex_number

AMS 1.01 or higher

short is_complex_number (CESI ptr);

Checks whether an expression is a number.

is_complex_number returns TRUE if the expression (in RPN form, of course) pointed to by ptr is a "number" (integer, rational, floating point, or complex, but not irrational), otherwise it returns FALSE. Note that 'sqrt(2)' is not a "number" in this convention. A complex number is a "number" if both real and imaginary parts are "numbers" in a sense of the convention given above.

Note: The information about this routine in releases of TIGCCLIB before 2.3 was wrong.

See also: likely_approx_to_number


is_constant

AMS 2.02 or higher

short is_constant (CESI ptr);

Checks whether an expression is constant.

is_constant returns TRUE if the expression pointed to by ptr does not rely on any variables (initialized, built-in, but not constants like p), otherwise it returns FALSE.


is_Float_exact_whole_number

AMS 1.01 or higher

short is_Float_exact_whole_number (CESI ptr);

Checks whether a floating point entry is an exact whole number.

is_Float_exact_whole_number returns TRUE if the floating point entry pointed to by ptr is an exact whole number whose magnitude is less than the smallest whole number that is not represented exactly (1e15), otherwise it returns FALSE.


is_free_of_tag

AMS 1.01 or higher

short is_free_of_tag (CESI ptr, ESQ Tag);

Checks whether an expression is free of a particular tag.

is_free_of_tag is a recursive function which returns TRUE if the expression structure pointed to by ptr is free of tag Tag, otherwise it returns FALSE.


is_independent_of_de_seq_vars

AMS 1.01 or higher

short is_independent_of_de_seq_vars (CESI ptr);

Checks whether an expression is independent of differential equation and sequence variables.

is_independent_of_de_seq_vars returns TRUE if the expression pointed to by expr_ptr is independent of system variables which are used for differential equation and sequence graphing (i.e. variables u1-u99 and y1'-y99'), otherwise it returns FALSE.


is_independent_of_elements

AMS 1.01 or higher

short is_independent_of_elements (CESI expr_ptr, CESI varlist_ptr);

Checks whether an expression is independent of the elements of a list.

is_independent_of_elements is very similar to is_independent_of_tail. Assuming that varlist_ptr points to the list of variables or expressions (more precise, to the LIST_TAG of such list), is_independent_of_elements returns TRUE if the expression pointed to by expr_ptr is independent of all variables from the list pointed to by varlist_ptr, otherwise it returns FALSE. More precisely,

is_independent_of_elements (expr_ptr, varlist_ptr)

is the same as

is_independent_of_tail (expr_ptr, varlist_ptr - 1)

is_independent_of_tail

AMS 1.01 or higher

short is_independent_of_tail (CESI expr_ptr, CESI start_ptr);

Checks whether an expression is independent of a sequence of variables (or expressions).

is_independent_of_tail returns TRUE if the expression pointed to by expr_ptr is independent of all entries on the expression stack stored below start_ptr up to END_TAG tag, otherwise it returns FALSE.

See also: is_independent_of, is_independent_of_elements, map_tail, all_tail


is_independent_of

AMS 1.01 or higher

short is_independent_of (CESI expr_ptr, CESI var_ptr);

Checks whether an expression is independent of a variable (or expression).

is_independent_of returns TRUE if the expression pointed to by expr_ptr is independent of the variable pointed to by var_ptr, else returns FALSE. Although var_ptr may point to something which is not a variable, the independence of the "expression" is not well defined, so avoid such situations until more information about what such "independence" means (TI says that this means "syntactical independence", but this is not well defined either).

Note: This routine (and all other "independence" routines also) is not reliable if expressions are not in internal canonic form (see push_internal_simplify).


is_matrix

AMS 1.01 or higher

short is_matrix (CESI ptr);

Checks whether an expression is a matrix.

is_matrix returns TRUE if the expression pointed to by ptr is a matrix (i.e. a list which consists of equally sized lists), otherwise it returns FALSE.


is_minus1

AMS 2.02 or higher

short is_minus1 (CESI ptr);

Tests if an expression is equal to -1.

Returns TRUE if the expression pointed to by ptr is equal to negative one (integer or floating point).

See also: is0, is1


is_monomial_in_kernel

AMS 1.01 or higher

short is_monomial_in_kernel (CESI ptr);

Checks whether an expression is a monomial in kernel.

is_monomial_in_kernel returns TRUE if the expression pointed to by ptr is a monomial in kernel, i.e. if it is a monomial function of kernels, where "kernel" means any irrational subexpression, else returns FALSE. For example, 'sin(x)*ln(y)' is not monomial (in respect to 'x' and 'y'), but it is monomial in kernel (in respect to 'sin(x)' and 'ln(y)').


is_monomial

AMS 1.01 or higher

short is_monomial (CESI ptr);

Checks whether an expression is a monomial.

is_monomial returns TRUE if the expression pointed to by ptr is a monomial expression, otherwise it returns FALSE. For example, the expression 'x*y^3' is a monomial, and x+y*z' or 'ln(x)' are not.


is_narrowly_independent_of

AMS 1.01 or higher

short is_narrowly_independent_of (CESI expr_ptr, CESI var_ptr);

Checks whether an expression is narrowly independent of a variable (???).

is_narrowly_independent_of returns TRUE if the expression pointed to by expr_ptr is narrowly independent of the variable pointed to by var_ptr, otherwise it returns FALSE. I am not sure what "narrowly independent" really means, and what the difference between this function and is_independent_of is.


is_negative

AMS 2.02 or higher

short is_negative (CESI ptr);

Tests if an expression is less than 0.

Returns TRUE if the expression pointed to by ptr is known to be negative, FALSE otherwise.

See also: is_nonnegative, is_positive, is_nonpositive


is_never0

AMS 2.02 or higher

short is_never0 (CESI ptr);

Tests if an expression is never 0.

Returns TRUE if the expression pointed to by ptr cannot be equal to zero.

See also: is0


is_nonnegative

AMS 2.02 or higher

short is_nonnegative (CESI ptr);

Tests if an expression is >= 0.

Returns TRUE if the expression pointed to by ptr is known to be positive or zero, FALSE otherwise.

See also: is_negative, is_positive, is_nonpositive


is_nonpositive

AMS 2.02 or higher

short is_nonpositive (CESI ptr);

Tests if an expression is <= 0.

Returns TRUE if the expression pointed to by ptr is known to be negative or zero, FALSE otherwise.

See also: is_positive, is_negative, is_nonnegative


is_polynomial_in_var_or_kern

AMS 2.02 or higher

short is_polynomial_in_var_or_kern (CESI test, CESI var_or_kern);

Checks if an expression is a polynomial with respect to another expression.

is_polynomial_in_var_or_kern returns TRUE if the expression pointed to by test is a polynomial with respect to the expression var_or_kern, otherwise it returns FALSE. The definition of "polynomial with respect to" is more complicated when dealing with expressions in var_or_kern. For example, "x+sin(x)" is polynomial with respect to "sin(x)" but not to "x". Interestingly, when testing with respect to "sin(x)", "x" seems to be treated like a constant.


is_positive

AMS 2.02 or higher

short is_positive (CESI ptr);

Tests if an expression is greater than 0.

Returns TRUE if the expression pointed to by ptr is known to be positive (not zero), FALSE otherwise.

See also: is_nonpositive, is_negative, is_nonnegative


is_square_matrix

AMS 1.01 or higher

short is_square_matrix (CESI ptr);

Checks whether an expression is a square matrix.

is_square_matrix returns TRUE if the expression pointed to by ptr is a square matrix, otherwise it returns FALSE.


is_symmetric

AMS 1.01 or higher

short is_symmetric (CESI expr_ptr, CESI var_ptr);

Checks for symmetry.

is_symmetric returns TRUE if the expression pointed to by expr_ptr is such that it remains the same when the variable pointed to by var_ptr changes its sign, otherwise it returns FALSE.


is_tail_independent_of

AMS 1.01 or higher

short is_tail_independent_of (CESI start_ptr, CESI var_ptr);

Checks whether a sequence of expressions is independent of a variable (or expression).

is_tail_independent_of returns TRUE if all expressions on the expression stack which are stored below start_ptr up to END_TAG are independent of the variable pointed to by var_ptr, otherwise it returns FALSE.

See also: is_independent_of, map_tail, all_tail


is_totally_polynomial

AMS 2.02 or higher

short is_totally_polynomial (CESI ptr);

Checks if an expression is polynomial in all variables.

is_totally_polynomial returns TRUE if the expression pointed to by ptr is polynomial with respect to all variables - that is, consists only of variables raised to positive constant powers (with coefficients) and multiplied or added together. Otherwise it returns FALSE.


is_valid_smap_aggregate

AMS 1.01 or higher

short is_valid_smap_aggregate (CESI ptr);

Checks whether an expression is a valid aggregate type.

is_valid_smap_aggregate returns TRUE if the expression pointed to by ptr is a valid aggregate type (i.e. list or valid matrix), otherwise it returns FALSE. This is not a simple check whether a tag pointed to by ptr is LIST_TAG. For example, list which consists of lists which are not equally sized (like {{1,2,3},{4,5}}) are not valid. Also, matrices whose elements are list or matrices are also not valid aggregate types.


is_variable

AMS 2.00 or higher

short is_variable (CESI ptr);

Checks if the expression is a variable.

is_variable returns TRUE if the expression is a variable and FALSE if it is not.


is_whole_number

AMS 2.02 or higher

short is_whole_number (CESI ptr);

Tests if an expression is a whole number.

Returns TRUE if the expression pointed to by ptr is a whole number (it can be a floating-point value).


last_element_index

AMS 1.01 or higher

ESI last_element_index (CESI ptr);

Searches for the last expression in the list.

last_element_index calls next_expression_index in a loop starting from ptr until END_TAG is reached, then returns the pointer to the last encountered expression before END_TAG. So, assuming that ptr points to a member of the list (including argument lists too), last_element_index will return the pointer to the last element of the list.


lead_base_index

AMS 1.01 or higher

ESI lead_base_index (CESI ptr);

Gets the index of the base of the lead factor of an expression.

lead_base_index first calls lead_factor_index, then applies factor_base_index to the result. So, it returns the pointer to the base of the lead factor (i.e. the lead base) of the expression pointed to by ptr.


lead_exponent_index

AMS 1.01 or higher

ESI lead_exponent_index (CESI ptr);

Gets the index of the exponent of the lead factor of an expression.

lead_exponent_index first calls lead_factor_index, then applies factor_exponent_index to the result. So, it returns the pointer to the exponent of the lead factor (i.e. the lead exponent) of the expression pointed to by ptr.


lead_factor_index

AMS 1.01 or higher

ESI lead_factor_index (CESI ptr);

Gets the index of the lead factor of an expression.

If ptr points to the MUL_TAG, which is the case when it points to an expression of form factor1 * factor2 * ... (i.e. if the expression is a product of simpler factors), lead_factor_index returns the pointer to factor1 (i.e. to the lead factor). If ptr does not point to the MUL_TAG (i.e. if the expression is not a product of simpler factors), lead_factor_index returns ptr (i.e. the pointer to the expression itself).

Note: Expressions in internal canonic form have the most main factor shallowest, with less main factors deeper (see compare_expressions for more info about "main" ordering). Also, the lead factor of an internally-simplified product is never a product. For example, lead factor of '(3*x^2)*y' converted into canonic form is 'x^2'. Internally-simplified numeric denominator factors are combined with numeric numerator factors into a fractional numeric factor. Non-numeric denominator factors are internally simplified to be merged with numerator factors as negative powers. For example, the lead factor of '2/x' converted into canonic form is 'x^-1'. A factor having a sum as its base orders shallower than a factor having the sumís main variable as its base. For example, the lead factor of '(x+1)^-2*x^3' converted into canonic form is '(x+1)^-2'. See push_internal_simplify for more info about how to convert an expression into the internal canonic form.


lead_term_index

AMS 1.01 or higher

ESI lead_term_index (CESI ptr);

Gets the index of the lead term of an expression.

If ptr points to the ADD_TAG, which is a case when it points to an expression of form term1 + term2 + ... (i.e. if the expression is a sum of simpler terms), lead_term_index returns the pointer to term1 (i.e. to the lead term). If ptr does not point to the ADD_TAG (i.e. if the expression is not a sum of simpler terms), lead_term_index returns ptr (i.e. the pointer to the expression itself).

Note: Expressions in internal canonic form have the most main term shallowest, with less main terms deeper (see compare_expressions about more info about "main" ordering). Also, the lead term of an internally-simplified sum is never a sum. For example, the lead term of '(2+x)+y' converted to canonic form is 'x'. By default, similar powers of the main variable are collected in internal canonic forms. For example, the lead term of 'x^2*y+x^2+5' converted to canonic form is 'x^2*(y+1)'. See push_internal_simplify for more info about how to convert an expression into the internal canonic form.


likely_approx_to_complex_number

AMS 1.01 or higher

short likely_approx_to_complex_number (CESI ptr);

Checks if it is likely that an expression can be approxed to a complex number.

likely_approx_to_complex_number is very similar to likely_approx_to_number, except that it checks for the possibility of approximation to numbers which need not be real numbers.


likely_approx_to_number

AMS 1.01 or higher

short likely_approx_to_number (CESI ptr);

Checks is it likely that an expression can be approxed to a real number.

If likely_approx_to_number returned TRUE, it is sure that the expression pointed to by ptr can be approxed to a real number, but returning FALSE does not mean that the approximation is not possible: it only means that the approximation to a number is not obvious. For example, it is obvious that expression 'ln(2+sin(1))/5' can be approxed to a number, but this is not so obvious for expression 'x^2+1-x*x', because it contains a symbolic variable name. See can_be_approxed for a more detailed investigation of possibility of approximation.


main_gen_var_index

AMS 1.01 or higher

ESI main_gen_var_index (CESI ptr);

Searches an expression for a generalized variable.

main_gen_var_index is a variant of index_main_var, but it searches for a "generalized variable", which may also be a subexpression. For example, if the expression is 'sin(x)+y', index_main_var will return a pointer to 'x', but main_gen_var_index will return a pointer to 'sin(x)'. Generalized variable can be an ordinary variable, the base of a noninteger power, or a kernel (like 'sin(x)'), meaning any other irrational subexpression.

More precise, main_gen_var_index skips all ADD_TAG, MUL_TAG and POW_TAG tags, then stops at the first tag which is not equal to some of them. In addition to this, if the tag is POW_TAG, function next_expression_index will be called, to get access to the base of the power (note that "powers" cannot be "reorganized" on such way that constants are always in front of variables, because '2^x' and 'x^2' are not the same expression). This implies that "main generalized variable" of a sum, a product or an integer power is equal to the main generalized variable of a lead term, a lead factor or a base respectively. Otherwise, main generalized variable is the expression itself. For example, main "generalized variables" of expressions 'sin(x)^2*y+ln(z)', '3^(1/5)+2' and '(x+y)^(1/2)+x' are 'sin(x)', '3' and 'x+y' respectively.


map_tail_Int

AMS 1.01 or higher

short map_tail_Int (ESI_Callback_Int_t f, ESI start_ptr, short n);

Applies an extended function to all elements in the list.

map_tail_Int is very similar to map_tail, except callback function f has one additional parameter n. Each time f is called, the parameter n passed to map_tail_Int is passed to f. Also, the callback function is not void but returns a Boolean value (TRUE or FALSE). The result of map_tail_Int is the logical OR of all the values returned by f.


map_tail

AMS 1.01 or higher

void map_tail (ESI_Callback_t f, ESI start_ptr);

Applies a function to all elements in the list.

map_tail first pushes END_TAG on the expression stack, then calls callback function f for every expression on the expression stack (in reversed order), starting from the expression pointed to by start_ptr until END_TAG is reached. Each time f is called, a pointer to the actual expression is passed to it. This function is very useful if you want to apply some operation on all elements of the list (then start_ptr need to point to the first element of the list). If the callback function does not push anything on the stack, the END_TAG pushed by map_tail should probably be deleted.

Note: map_tail calls next_expression_index to step from one expression to another.


map_unary_over_comparison

AMS 1.01 or higher

void map_unary_over_comparison (ESI_Callback_t f, ESI cmptag_ptr);

Calls callback function for both comparison terms and pushes the comparison tag.

map_unary_over_comparison assumes that cmptag_ptr points to a comparison tag. It calls the callback function f twice, passing to it pointers to both comparison terms, i.e. the two expressions below the comparison tag (the callback function should push something to the expression stack). The callback function is applied first to the deeper argument on the stack, then to the shallower argument. Finally, map_unary_over_comparison will push the tag pointed to by cmptag_ptr (one byte) to the expression stack. This function is useful to perform some transformations on both sides of a comparison (e.g. to transform 'n<5' into 'n!<120'). Beware that squaring of both sides of an inequality can cause loss of solutions, and squaring both sides of an equation may introduce spurious solutions!


min_quantum

AMS 1.01 or higher

ESQ min_quantum (ESQ Tag1, ESQ Tag2);

Finds smaller of two tags.

min_quantum returns Tag1 if it is smaller than Tag2, else returns Tag2.


move_between_to_top

AMS 1.01 or higher

void move_between_to_top (ESI ptr1, ESI ptr2);

Moves a sequence of bytes to the top of the expression stack.

move_between_to_top moves a sequence of bytes between ptr1 and ptr2 (more precise, starting at ptr1+1 and ending at ptr2) to the top of the expression stack. It acts like a combination of push_between and delete_between (in fact, it is). This routine assumes that ptr1 and ptr2 really point to parts of the expression stack and that ptr2 is above ptr1, otherwise the result is unpredictable.


moved_between_to_top

AMS 1.01 or higher

unsigned short moved_between_to_top (ESI ptr1, ESI ptr2);

Moves a sequence of bytes to the top of the expression stack.

moved_between_to_top acts like move_between_to_top, but it also returns a number of moved bytes. It calls deleted_between instead of delete_between.


negate_top

AMS 2.02 or higher

void negate_top (void);

Negates the top of the estack.

negate_top changes the sign of the expression on the top of the estack.

See also: add_to_top, subtract_from_top, and_onto_top


next_expression_index

ESI next_expression_index (CESI ptr);

Finds the next entry on the expression stack.

Assuming that ptr points to an expression entry on the expression stack, next_expression_index returns the pointer which points to an expression which is located just below the expression pointed to by ptr. So, by successive calls to next_expression_index starting from top_estack, you can locate all expressions on the stack. This command will throw an error if ptr points to the END_TAG, so be careful.

Note: next_expression_index calls index_after_match_endtag for TI-Basic functions and program tags, so that inline functions are counted as entire expressions rather than of their components.


NG_approxESI

void NG_approxESI (CESI ptr);

Evaluates an expression in "APPROX" mode.

NG_approxESI executes the entry on the expression stack pointed to by ptr (it needs to point to the entry tag) in "APPROX" mode, then pushes the result (i.e. a new expression) on the top of the expression stack. The pushed result is NOT in internal canonic form (if necessary, do push_internal_simplify to force conversion to the internal canonic form). The following example illustrates this very powerful command:

push_parse_text ("sin(1.3)+log(2)/7");
NG_approxESI (top_estack);
printf_xy (0, 50, "%f", estack_number_to_Float (top_estack));

See push_parse_text and estack_number_to_Float to understand how this example works.

Note: The expression must not contain TI-Basic statements. For executing TI-Basic statements, use NG_execute. Also, this command may cause expansion of the expression stack or heap compression, and may throw various errors is something is wrong.


NG_execute

void NG_execute (HANDLE Handle, short approx_flag);

Executes TI-Basic statements.

NG_execute executes a sequence of TI-Basic statements in tokenized form, which are located in a memory block pointed to by handle Handle. It is a handle to a MULTI_EXPR structure. To create such a block, the functions push_parse_text and HS_popEStack may be very useful, like in the following example:

push_parse_text ("ClrGraph:Graph sin(x)");
handle = HS_popEStack ();
NG_execute (handle, FALSE);
HeapFree (handle);

If approx_flag is non-zero, the sequence will be executed in "approx" mode (like running with [DIAMOND]+[ENTER]). Otherwise, the current mode settings will be used. This routine is called after NG_RPNToText from the home screen.

NG_execute can also evaluate expressions. In this case, the result of the evaluation is pushed on the top of the expression stack.

Note: This routine always clears the error context, resets control flags, may cause estack expansion or heap compression. It may throw various errors if something is wrong.


NG_graphESI

void NG_graphESI (CESI ptr, HANDLE Handle);

Evaluates an expressions for graphing purposes.

NG_graphESI is the function used in TIOS during drawing function graphs. It evaluates the entry on the expression stack pointed to by ptr in "APPROX" mode then pushes the result on the top of the expression stack, similar to what NG_approxESI does, but NG_graphESI requires that all variables in the expression must be defined, i.e. the expression must evaluate to a number (else "Undefined variable" error will be thrown). Handle is the handle of the function in which the expression is defined. I don't know exactly when and why this function needs this handle (probably to check which variables are parameters of the function, which variables are local etc.). When I tried to pass H_NULL to this function, nothing bad happened. However, in the absence of more info, avoid this function.


NG_rationalESI

void NG_rationalESI (CESI ptr);

Evaluates an expression in "EXACT" mode.

NG_rationalESI executes the entry on the expression stack pointed to by ptr (it needs to point to the entry tag) in "EXACT" mode, then pushes the result (i.e. a new expression) on the top of the expression stack. See the example of usage given with display_statements. The same notes given with NG_approxESI are true with this command too.

Note: The expression must not contain TI-Basic statements. For executing TI-Basic statements, use NG_execute. Also, this command may cause expansion of the expression stack or heap compression, and may throw various errors is something is wrong.


NG_RPNToText

HANDLE NG_RPNToText (HANDLE hRPN, unsigned short NewLines, unsigned short FullPrec);

Detokenizes a tokenized structure associated with a handle.

NG_RPNToText detokenizes a tokenized structure (an expression, TI-Basic statement or a group of statements) associated with handle hRPN and returns a handle to the memory block where detokenized string is stored (you don't need to allocate anything by yourself, this function will do it instead). The first word of the data associated with hRPN should be the length of the data which is used to find the first tag of the tokenized data. It throws an error if the detokenization fails. This function is mainly identical to display_statements except NG_RPNToText requires a handle instead of the pointer to the structure which needs to be detokenized. See display_statements for more info.


NG_tokenize

short NG_tokenize (HANDLE hTEXT, unsigned short *ErrCode, unsigned short *ErrOffset);

Tokenizes text associated with a handle and pushes them to the expression stack.

NG_tokenize is more powerful variant of push_parse_text. It tokenizes the text associated with the handle hTEXT, and pushes the converted text to the expression stack. Returns TRUE if the operation was successful, otherwise it returns FALSE. If there was an error, then the variable pointed to by ErrCode contains the error code, and the variable pointed to by ErrOffset contains the offset in the text where the error occurred. If there were not any errors, then the variable pointed to by ErrCode contains multi state (this is the result returned from push_parse_text) and ErrOffset is undefined. This routine may expand the expression stack, may cause the heap compression, or even may throw an error if something goes really wrong (not enough memory, for example).


norm1_complex_Float

AMS 1.01 or higher

float norm1_complex_Float (CESI ptr);

Finds the 1-norm of a complex number entry.

norm1_complex_Float finds the 1-norm (i.e. the sum of absolute values of real and imaginary part) of the complex number entry pointed to by ptr and returns the result. If the entry is not a complex or real floating point number, the result is garbage (in the case of a real number, norm1_complex_Float reduces to a simple absolute value).


numeric_factor_index

AMS 1.01 or higher

ESI numeric_factor_index (CESI ptr);

Searches factors in the expression for a numeric factor.

If ptr points to the MUL_TAG, which is a case when it points to an expression of form factor1 * factor2 * ... (i.e. if the expression is a product of simpler factors), numeric_factor_index returns the pointer to the eventual numeric factor in the expression. If the expression is a number, numeric_factor_index returns ptr (i.e. the pointer to the expression itself). If ptr does not point to the MUL_TAG (i.e. if the expression is not a product of simpler factors), or if there is not any numeric factors in the expression, lead_factor_index returns a pointer to a simple expression which consists only of the number 1 (floating point or integer, depending of whether the approximation mode is active or not).

Note: This function is not implemented to be very universal. TIOS always "reorganizes" expressions on such way that numeric factors are at the beginning of the expression (i.e. x*3 will be reorganized into 3*x), and this function assumes that the expression is organized on such way. This is the so-called "internal canonic" form, and such expressions always have at most one factor with a numeric tag, in which case it is the deepest factor. So, '3*x^2*y' contains a numeric factor (3), but '2*x+3' does not. Also, numeric factors in numerators and denominators are always simplified into a single numeric factor in internal canonic forms (so, the numeric factor of '6*x/(4*y)' after conversion to canonic form is 3/2. Fortunately, all expressions in arguments are always in internal canonic form. However, this is not true after push_parse_text function, nor after an evaluation using NG_rationalESI or NG_approxESI. In other words, results of these commands are not always "correctly" organized. To force converting an expression to the internal canonic form, always call push_internal_simplify after usage any of functions mentioned above.


Parms2D

void Parms2D (CESI ptr, short *Width, short *Bottom, short *Top);

Gets information about dimensions of block which will be "pretty printed".

Parms2D gets information about the screen space which will be occupied by displayed expression. It should be called after calling Parse2DExpr (or Parse2DMultiExpr), and ptr should be a result returned from it. Params2D stores the information in three variables pointed to by Width, Bottom and Top. Width is the width of the displayed block, and Top and Bottom are distances of top and bottom edge of the block measured from the wanted y position. More precise, if the expression is printed at (x, y) using Print2DExpr, the left corner of the occupied space will be at (x, y-*Top), and the right corner of the occupied space will be at (x+*Width, y+*Bottom). So, the 2D expression has an imaginary center line above which is the "Top", and below (counting this line too) is the "Bottom".


Parse1DExpr

HANDLE Parse1DExpr (CESI ptr, unsigned short FullPrec, unsigned short width);

Parses a tokenized expression to be printed.

Parse1DExpr does a similar job as display_statements (i.e. converts a RPN expression to the TEXT and returns the handle to the text), but the parameters are somewhat different. Here, width is the maximum width of text result (0 indicates no width restriction). So, when necessary, symbolic expressions are truncated to width-1 characters and terminated with an ellipsis character ('...'). When ptr points to a tagged floating point number, the number is rounded to fit in width characters. When the number cannot be rounded to fit in width characters, an ellipsis character ('...') is returned. See display_statements for more info.


Parse2DExpr

ESI Parse2DExpr (CESI ptr, unsigned short FullPrec);

Parses a tokenized expression to be pretty printed using Print2DExpr.

Parse2DExpr parses the expression pointed to by ptr, so it can be displayed with Print2DExpr. This function splits up expression into blocks with information about their relative position and size. This splitting is performed for efficiency reasons, so the expression may be displayed again without having to calculate the positions again. Parse2DExpr returns the pointer to a created structure (it needs to be passed to Print2DExpr). This pointer is in fact the new value of top_estack, because the created structure (known as "boxed RPN") is also pushed on the expression stack. FullPrec is a Boolean flag: when it is non-zero, all floating point values will be converted using the maximal precision (14 digits), else current precision settings (from TI-Basic MODE dialog) will be used. If there is not enough memory, a special symbol is pushed onto the expression stack to signify this. This routine may cause heap compression. See Print2DExpr for an example of usage.

Parse2DExpr will always convert expressions into the "canonic printing (external) form". For example, both x*3 and 3*x will be displayed as 3*x, x*y^(-1) will be displayed as x/y etc.

Note: Break key (ON) is checked during execution of this function, and pressing it will throw an error!


Parse2DMultiExpr

ESI Parse2DMultiExpr (HANDLE Handle, unsigned short FullPrec);

Parses a multi-statement expression associated with a handle to be pretty printed using Print2DExpr.

Parse2DMultiExpr parses a multi-expression (see MULTI_EXPR) associated with Handle so that it can be displayed with Print2DExpr. Parameter FullPrec has the same meaning as in Parse2DExpr. The expression associated with Handle may contain multiple expressions separated with NEXTEXPR_TAG (in opposite to Parse2DExpr). I must admit that I don't understand this function very well, so avoid it except if you know about it more than I know...


Print2DExpr

void Print2DExpr (CESI ptr, WINDOW *w, short x, short y);

Performs "pretty printing" (or "2D printing") of an expression.

Print2DExpr prints the expression in "pretty" or "2D" style. Before printing, the expression needs first to be "parsed" using Parse2DExpr, and argument ptr should be a result returned from Parse2DExpr (an error may be thrown if ptr points to something else). w is a pointer to the WINDOW structure which describes the window in which the expression will be displayed (see wingraph.h header file for more info about windows). If you didn't create your own windows in the program, you can pass DeskTop as the parameter (as in the example given below). x and y are coordinates (window-relative) where the expression will be printed. x determines the left edge of the expression, and the expression goes (in y direction) both above and below the value of y. See Parms2D for exact information about dimensions of displayed expression. If the displayed expression can not fit into the given window, it will be simply clipped at edges of the window.

Here is an example (called "Pretty Print") which first calculates the integral of 1/((x-3)(x^2+4)), then "pretty prints" the result on the screen:

// Calculate an integral and pretty print it

#define USE_TI89              // Compile for TI-89
#define USE_TI92PLUS          // Compile for TI-92 Plus
#define USE_V200              // Compile for V200

#define MIN_AMS 101           // Compile for AMS 1.01 or higher
#define SAVE_SCREEN           // Save/Restore LCD Contents

#include <tigcclib.h>         // Include All Header Files

// Main Function
void _main(void)
{
  TRY
    push_END_TAG ();
    push_quantum (VAR_X_TAG);
    push_parse_text ("1/((x-3)(x^2+4))");
    push_quantum (INTEGRATE_TAG);
    NG_rationalESI (top_estack);
    WinClr (DeskTop);
    Print2DExpr (Parse2DExpr (top_estack, FALSE), DeskTop, 0, 50);
  ONERR
    DrawStr (20, 20, "Error!", A_NORMAL);
  ENDTRY
  ngetchx ();
}

It is also possible to use

Parse2DExpr (top_estack, FALSE);
Print2DExpr (top_estack, DeskTop, 0, 50);

instead of

Print2DExpr (Parse2DExpr (top_estack, FALSE), DeskTop, 0, 50);

You can use Parms2D to get information about the height and the width of the printed expression without displaying it on the screen. This may be used to determine coordinates where the expression needs to be displayed.


push_ANSI_string

AMS 1.01 or higher

void push_ANSI_string (const char *str);

Pushes a standard C string to the expression stack.

push_ANSI_string is an alias (known from earlier versions of the TIGCC Library) for the TIOS function push_zstr.


push_between

AMS 1.01 or higher

void push_between (void *ptr1, void *ptr2);

Pushes a sequence of bytes to the expression stack.

push_between pushes a sequence of bytes starting at ptr1+1 and ending at ptr2 to the expression stack.

Note: The break key (ON) is checked during execution of this routine, and an error is thrown if it is pressed!


push_cnvrt_integer_if_whole_nmb

AMS 1.01 or higher

void push_cnvrt_integer_if_whole_nmb (CESI ptr);

Pushes a floating point entry eventually converted to an integer.

push_cnvrt_integer_if_whole_nmb checks the entry on the expression stack pointed to by ptr. If it is not a floating point value (represented by FLOAT_TAG), or if it is a floating point value which is not a whole number, yet another copy of the entry is pushed on the expression stack. If the entry is a floating point value which is a whole number, this number is pushed on the expression stack, but this time as an integer (i.e. with POSINT_TAG or NEGINT_TAG).


push_END_TAG

void push_END_TAG (void);

Pushes end-of-list marker to the expression stack.

push_END_TAG pushes END_TAG to the expression stack. This is the same as push_quantum (END_TAG).

push_END_TAG may be useful when you want to push a list on the expressions stack: first push END_TAG, then all elements of the list in reverse order, and finally push LIST_TAG (using push_LIST_TAG).

See also: push_quantum


push_expr_quantum

AMS 1.01 or higher

void push_expr_quantum (CESI ptr, ESQ Tag);

Pushes an expression followed by a tag to the expression stack.

push_expr_quantum pushes an entry (expression) pointed to by ptr (it needs to point to the entry tag) to the top of the expression stack, then pushes a byte Tag. The entry does not need to be a simple entity; it may be a complex symbolic expression, too. This is achieved by calling next_expression_index and push_between. This function is useful when you need to perform a unary operation on the expression.

See also: push_expression, push_expr2_quantum


push_expr2_quantum

AMS 1.01 or higher

void push_expr2_quantum (CESI ptr1, CESI ptr2, ESQ Tag);

Pushes two expressions followed by a tag to the expression stack.

push_expr2_quantum pushes two entries (expressions) on the expression stack pointed to by ptr1 and ptr2 to the top of the stack, then pushes a byte Tag. This function is useful when you need to perform a binary operation on two expressions.

See also: push_expression, push_expr_quantum


push_expression

AMS 1.01 or higher

void push_expression (CESI ptr);

Pushes an expression to the expression stack.

push_expression pushes an entry (expression) pointed to by ptr (it needs to point to the entry tag) to the top of the expression stack. The entry does not need to be a simple entity; it may be a complex symbolic expression, too. This is achieved by calling next_expression_index and push_between.

See also: push_quantum, push_expr_quantum, push_expr2_quantum


push_Float_to_nonneg_int

AMS 1.01 or higher

void push_Float_to_nonneg_int (float value);

Rounds a floating point value to an integer, then pushes it to the expression stack.

push_Float_to_nonneg_int rounds value to the nearest integer, then pushes it to the expression stack, as a tagged integer value. The sign of value is ignored. This routine may throw an error if the truncated integer part of value is not representable as a big integer.


push_Float_to_rat

AMS 1.01 or higher

void push_Float_to_rat (CESI ptr);

Pushes a rational approximation of a floating point entry.

push_Float_to_rat finds a rational approximation of the floating point entry pointed to by ptr (of course, ptr points to the tag), and pushes it on the top of the expression stack. The relative error can be specified using the AMS global variable RAtionalize_tol. This routine works well even with transfinite floats (e.g. POSITIVE_INF will be pushed as INFINITY_TAG).


push_Float

AMS 1.01 or higher

void push_Float (float value);

Pushes a floating point value to the expression stack.

push_Float rounds value to the 14 significant digits (using round14), then pushes it to the expression stack. If value is not representable as a finite float, the most appropriate transfinite tag is pushed.


push_internal_simplify

AMS 1.01 or higher

void push_internal_simplify (CESI ptr);

Converts an expression into internal canonic form and pushes the result to the expression stack.

This extremely important low-level subroutine converts an expression pointed to by ptr to the internal canonic form (see top_estack for more info about the internal canonic form), and pushes the converted expression at the top of the expression stack. This routine accepts all valid (algebraic, calculus, relational, logical or Boolean) tokenized expressions. During the conversion, various simplifications may be performed as well. This routine may cause heap compression, stack expansion, and may throw an error if something goes wrong.


push_LIST_TAG

void push_LIST_TAG (void);

Pushes list tag to the expression stack.

push_LIST_TAG pushes LIST_TAG to the expression stack. This is the same as push_quantum (LIST_TAG).

push_LIST_TAG may be useful when you want to push a list on the expressions stack: first push END_TAG (using push_END_TAG), then all elements of the list in reverse order, and finally push LIST_TAG.

See also: push_quantum


push_long_to_integer

AMS 2.00 or higher

void push_long_to_integer (long value);

Pushes a signed long integer to the expression stack.

push_long_to_integer pushes the long integer value value to the expression stack. It is the same as push_longint, except that it is implemented in the operating system instead of by TIGCC.

See also: push_ulong_to_integer, push_ushort_to_integer, push_longint


push_longint

AMS 1.01 or higher

void push_longint (long value);

Pushes a long integer to the expression stack.

push_longint pushes the long integer value value to the expression stack.

Note: push_longint is not a TIOS entry; it is implemented "by hand" using push_quantum. This means that either push_shortint or push_longint should be used in a program, but using both is usually not desirable.

See also: push_shortint, push_longlongint


push_longlongint

AMS 1.01 or higher

void push_longlongint (long long value);

Pushes a double-long integer to the expression stack.

push_longlongint pushes the double-long integer value value to the expression stack.

Note: push_longlongint is not a TIOS entry; it is implemented "by hand" using push_quantum.

See also: push_shortint, push_longint


push_next_arb_int

AMS 1.01 or higher

void push_next_arb_int (void);

Pushes a next "arbitrary integer" symbol to the expression stack.

push_next_arb_int pushes a next "arbitrary integer" symbol (i.e. symbol @nxxx) to the top of the expression stack. More precise, it increments an internal counter for arbitrary integers, pushes the counter on the stack, then pushes ARB_INT_TAG. The counter wraps to zero after 255 is reached.


push_next_arb_real

AMS 1.01 or higher

void push_next_arb_real (void);

Pushes a next "arbitrary real" symbol to the expression stack.

push_next_arb_int pushes a next "arbitrary real" symbol (i.e. symbol @xxx) to the top of the expression stack. More precise, it increments an internal counter for arbitrary reals, pushes the counter on the stack, then pushes ARB_REAL_TAG. The counter wraps to zero after 255 is reached.


push_next_internal_var

AMS 1.01 or higher

void push_next_internal_var (ESQ Tag);

Pushes an internal variable to the expression stack.

push_next_internal_var is an auxiliary function used in calculus operations. It pushes the sequence 0, Tag+1, count, 0 to the expression stack, where count is the internal counter of internal variables. Then, the counter is increased by one. TIOS usually passes 0 or 1 for Tag, so it manages a two independent sets of internal variables. You can see that internal variable names consist of two bytes (see VAR_NAME_TAG): one byte is "set number", and another byte is "number of a variable in the set".


push_offset_array

AMS 1.01 or higher

unsigned short push_offset_array (CESI elements_ptr, unsigned short **dest);

Pushes an array of offsets to the list items.

This function is not complicated, but it is a bit hard to explain. It first increments the pointer to the top of the expression stack to the nearest even address, then pushes a word array which contains the offsets to all entries on the expression stack below elements_ptr until END_TAG is reached. The offset is expressed relative to the elements_ptr. push_offset_array returns the size of pushed array in words (i.e. the number of elements), and stores in the pointer variable pointed to by dest the top address of pushed array. For example, if you execute the following sequence

unsigned int *offsets;
ESI esi;
unsigned int count;
...
esi=top_estack;
count=push_offset_array (esi, &offsets);

then esi-offsets[0], esi-offsets[-1], esi-offsets[-2], ..., esi-offsets[1-count] will point to entries on the expression stack. esi-offsets[0] will point to the further entry from the top of the expression stack, esi-offsets[-1] will point to the next one, and finally, esi-offsets[1-count] will point to the entry on the top of the expression stack (more precise, offsets[1-count] is always zero). This function is useful when you need a fast way to access to all entries on the expression stack many times.


push_overflow_to_infinity

AMS 1.01 or higher

void push_overflow_to_infinity (ESQ inf_tag);

Displays a warning, and pushes a tag to the expression stack.

push_overflow_to_infinity displays the warning message "Warning: Overflow replaced by INF or -INF", then pushes byte inf_tag to the expression stack (it is usually INFINITY_TAG or NEGINFINITY_TAG).


push_parse_text

AMS 1.01 or higher

short push_parse_text (const char *str);

Parses an expression given in a string and pushes tokenized expression to the expression stack.

push_parse_text is an extremely powerful function: it parses the expression given in the string str, and pushes the expressions (in RPN form) to the expression stack. This function also can parse TI-Basic statements (after parsing, the tokenized form of these statements is pushed on the expression stack too). push_parse_text returns FALSE if the expression is a multi expression (i.e. if it contains ":" [separator], "->" [store] or TI-Basic statements), otherwise it returns TRUE. This routine may cause expansion of the expression stack or heap compression. TIGCCLIB internally uses this function (together with estack_number_to_Float) in the implementation of atof function. For more examples of usage of this function, see NG_approxESI, NG_rationalESI, NG_execute etc. The "inverse" function of push_parse_text is display_statements.

If you want to perform highly advanced symbolic operations with expressions, you should know that expressions created by push_parse_text are not always organized on a way which allows the most efficient symbolic processing (so-called internal canonic form). For example, TIOS always converts 'x*3' into '3*x' and converts 'x-y' into 'x+y*(-1)', although it will be printed as 'x-y'. However, expressions created by push_parse_text are always as-is, i.e. '3*x' will be just '3*x', not 'x*3'. Some routines (like numeric_factor_index for example) may be fooled if the expression is not "sorted" correctly. Also, some routines (like lead_term_index, lead_factor_index etc.) may also be fooled with expressions like 'x-y' and 'x/y', because operators '-' and '/' are usually never seen in expressions during symbolic processing (the processing is more unique if addition and subtraction are treated as the same operation; the same is true for '*' and '/'). So, if you planed to perform some advanced symbolic processing which is based on accessing various part of the expression, always call push_internal_simplify after calling push_parse_text. This function pushes on the expression stack the same expression but converted in internal canonic form.

Note: push_parse_text will throw an error if the string contains expression with wrong syntax, so you need to use TRY etc. to catch eventual errors. And, the string must be built using TI-Basic conventions (for example, you must use 0xAD ("small" minus) instead of '-' for unary minus, etc. See NG_tokenize for a more powerful function which doesn't throw any errors, and which can determine the exact location and type of the error.


push_quantum_pair

AMS 1.01 or higher

void push_quantum_pair (ESQ Tag1, ESQ Tag2);

Pushes two bytes (tags) to the expression stack.

push_quantum_pair pushes the bytes Tag1 and Tag2 to the expression stack. Basically, it acts like:

push_quantum (Tag1);
push_quantum (Tag2);

but it is a little more optimized.

See also: push_quantum


push_quantum

void push_quantum (ESQ Tag);

Pushes a byte (tag) to the expression stack.

push_quantum is the basic function for manipulating the expression stack, and many other functions are based on it. It pushes a byte Tag to the expression stack. For example, you can push a complex value to the expression stack using the following construction:

push_Float (real_part);
push_Float (imaginary_part);
push_quantum (COMPLEX_TAG);

See push_Float, and info about top_estack and Tags for more info about this example.

Note: This routine (as well as all other "push_..." routines) may cause heap compression, and may throw an error if there is not enough space on the expression stack.

See also: push_quantum_pair, push_expression, push_expr_quantum


push_reversed_tail

AMS 1.01 or higher

void push_reversed_tail (CESI ptr);

Pushes elements of the list up to tail onto the stack in reversed order.

push_reversed_tail first pushes END_TAG to the expression stack, then pushes all expressions starting from the expression pointed to by ptr one by one (by calling next_expression_index) until END_TAG is reached. So after calling this function, the expressions up to tail will be pushed onto the stack in reversed order. See other "tail" operations like map_tail.


push_round_Float

AMS 1.01 or higher

void push_round_Float (CESI ptr);

Pushes an approximation of a floating point entry.

push_round_Float first finds a rational approximation of the floating point entry pointed to by ptr using push_Float_to_rat, then converts this fraction back to the floating point number and pushes it on the top of the expressions stack. The summary effect is rounding float to the precision of about 1e-5.


push_shortint

AMS 1.01 or higher

void push_shortint (short value);

Pushes a short integer to the expression stack.

push_shortint pushes the short integer value value to the expression stack.

Note: push_shortint is not a TIOS entry; it is implemented "by hand" using push_quantum. This means that either push_shortint or push_longint should be used in a program, but using both is usually not desirable.

See also: push_longint, push_longlongint


push_simplify

AMS 2.00 or higher

void push_simplify (CESI ptr);

Simplifies the argument and pushes onto the estack.

push_simplify is like push_internal_simplify, but does not convert into internal canonic form.


push_transpose_aux

AMS 1.01 or higher

void push_transpose_aux (CESI ptr, short ConjFlag);

Pushes transposed matrix to the expression stack.

Assuming that ptr points to the tag of a matrix (which is, in fact, a list of equally sized lists), push_transpose_aux pushes the transpose of the matrix to the expression stack. If ConjFlag is TRUE, a complex conjugate transpose will be produced, and if ConjFlag is FALSE, an ordinary transpose will be produced. For complex conjugate transposition, the matrix should be in canonic internal form (see push_internal_simplify). If ptr doesn't point to a matrix, the behavior is unpredictable.


push_ulong_to_integer

AMS 2.00 or higher

void push_ulong_to_integer (unsigned long value);

Pushes an unsigned long integer to the expression stack.

push_ulong_to_integer pushes the long integer value value to the expression stack. It is the same as push_long_to_integer, except that the value is interpreted as an unsigned value.

See also: push_long_to_integer, push_ushort_to_integer, push_longint


push_ushort_to_integer

AMS 2.00 or higher

void push_ushort_to_integer (unsigned short value);

Pushes an unsigned short integer to the expression stack.

push_ushort_to_integer pushes the short integer value value to the expression stack. It is the same as push_shortint, except that the value is interpreted as an unsigned value, and that it is implemented in the operating system instead of by TIGCC.

See also: push_long_to_integer, push_ulong_to_integer, push_shortint


push_zstr

AMS 1.01 or higher

void push_zstr (const char *str);

Pushes a standard C string to the expression stack.

push_zstr pushes the string str to the expression stack. str is a standard ANSI (zero-terminated) string.


re_index

AMS 1.01 or higher

ESI re_index (CESI ptr);

Gets the index of the real part of an expression.

If ptr points to the COMPLEX_TAG (i.e. if the expression is complex), re_index returns the pointer to the real part of the expression. If ptr does not point to the COMPLEX_TAG (i.e. if the expression is real), re_index returns ptr (i.e. the pointer to the expression itself).

Note: The expression should be in internal canonic form (see push_internal_simplify), else this function is not reliable.


reductum_index

AMS 1.01 or higher

ESI reductum_index (CESI ptr);

Gets the index of remaining terms of an expression.

If ptr points to the ADD_TAG, which is a case when it points to an expression of form term1 + term2 + ... (i.e. if the expression is a sum of simpler terms), reductum_index returns the pointer to the subexpression term2 + ... (which is a reductum subexpression of the given expression). If ptr does not point to the ADD_TAG (i.e. if the expression is not a sum of simpler terms), reductum_index returns a pointer to a simple zero expression, i.e. expression which consists only of number 0 (floating point or integer, depending of whether the approximation mode is active or not).

Note: Expressions in internal canonic form have the most main term shallowest (see lead_term_index. So, the reductum of '2+x+y' converted to canonic form is 'y+2'. By default, similar powers of the main variable are collected in internal canonic forms. For example, the reductum of 'x^2*y+x^2+5' converted to canonic form is '5'. See push_internal_simplify for more info about how to convert an expression into the internal canonic form.


remaining_element_count

AMS 1.01 or higher

unsigned short remaining_element_count (CESI start_ptr);

Returns number of elements remaining.

remaining_element_count counts how many expressions are stored on the expressions stack below the expression pointed to by ptr (including this one). END_TAG is treated as the terminator, so eventual expressions below END_TAG are not counted. So, if ptr points to an element of the list, remaining_element_count returns the number of elements in the list starting from this element up to the end of the list.

remaining_element_count works using repeated calling next_expression_index and increasing a counter until END_TAG is reached.


remaining_factors_index

AMS 1.01 or higher

ESI remaining_factors_index (CESI ptr);

Gets the index of remaining factors of an expression.

If ptr points to the MUL_TAG, which is a case when it points to an expression of form factor1 * factor2 * ... (i.e. if the expression is a sum of simpler terms), remaining_factors_index returns the pointer to the subexpression term2 * ... (i.e. to the remaining factors of the expression). If ptr does not point to the MUL_TAG (i.e. if the expression is not a product of simpler factors), remaining_factors_index returns a pointer to a simple expression which consists only of number 1.

Note: Expressions in internal canonic form have the most main factor shallowest, with less main factors below that (see compare_expressions for more info about "main" ordering). Also, the lead factor of an internally-simplified product is never a product. For example, remaining factors of '(3*x^2)*y' converted into canonic form are '3*y'. By default, similar powers of the main variable are collected, so remaining factor of 'x^2*y+x^2' after conversion into canonic form is 'y+1'. Internally-simplified numeric denominator factors are combined with numeric numerator factors into a fractional numeric factor. Non-numeric denominator factors are internally simplified to be merged with numerator factors as negative powers. See push_internal_simplify for more info about how to convert an expression into the internal canonic form.


reset_control_flags

AMS 1.01 or higher

void reset_control_flags (void);

Resets the control flags for operations with the expression stack.

reset_control_flags resets various control flags which control operations which use the expression stack. It is good idea to call this function before starting any calculation using the expression stack.


reset_estack_size

AMS 1.01 or higher

void reset_estack_size (unsigned short NewSize);

Reallocates the expression stack.

reset_estack_size changes the size of the expression stack to NewSize. It throws an error if the requirement cannot be satisfied. If NewSize is smaller than the current amount of used space, then the expression stack is set to the current amount of used space instead of NewSize. Default size of the expression stack is 16384 bytes.


should_and_did_push_approx_arg2

AMS 1.01 or higher

short should_and_did_push_approx_arg2 (CESI arg1_ptr, CESI arg2_ptr);

Pushes a second floating point argument, if possible.

This function is combination of "push" and "check" operations. If the entry on the expressions stack pointed to by arg1_ptr is not a floating point number (i.e. if arg1_ptr does not point to FLOAT_TAG), this function does nothing and returns FALSE. Otherwise, it checks if it is likely that the entry on the expression stack pointed to by arg2_ptr can be approxed to a real number (using likely_approx_to_number). If it is, should_and_did_push_approx_arg2 pushes the approximated value to the expression stack and returns TRUE, otherwise it does nothing more and returns FALSE.


signum_Float

AMS 1.01 or higher

long signum_Float (CESI ptr);

Finds the signum of a floating point entry.

signum_Float finds the signum of the floating point entry pointed to by ptr (i.e. returns 1 if the entry is positive, -1 if it is negative, 0 if it is zero). If the entry is not a floating point number, the result is garbage.


subtract_from_top

AMS 2.02 or higher

void subtract_from_top (CESI ptr);

Subtracts a value from the top of the estack.

subtract_from_top subtracts the expression pointed to by ptr from the expression currently at the top of the estack.

See also: add_to_top, and_onto_top, negate_top, subtract1_from_top


subtract1_from_top

AMS 2.02 or higher

void subtract1_from_top (void);

Subtracts 1 from the top of the estack.

add1_to_top subtracts 1 (or 1.0) from the value on the top of the estack. This routine basically calls add_to_top with "-1" as the pointed-to value.


TokenizeSymName

ESI TokenizeSymName (const char *src, unsigned short Flags);

Tokenizes a C string into a symbol name.

TokenizeSymName converts a symbol name pointed to by src, which is an ordinary ANSI C string, into a tokenized form, and pushes the tokenized form on the expression stack. After pushing, the new value of top_estack points to the variable tag on the expression stack. TokenizeSymName returns the old value of top_estack (which you can use to restore top_estack), or NULL_INDEX if the symbol name was invalid.

The parameter Flags is a set of binary flags from TokenizeSymNameFlags with the following meaning:

TSF_FULLY_QUALIFIED Add current default folder to the name if no folder specified in the name (do not use if tokenizing standalone folder names).
TSF_ALLOW_RESERVED Allow reserved names to be tokenized (otherwise they cause throwing an error).
TSF_PASS_ERRORS Throw errors instead of returning NULL_INDEX.

Note: This routine may cause heap compression.

See also: StrToTokN


ARb_int_count

AMS 2.04 or higher

ESQ ARb_int_count;

Represents the number of times arbitrary-integer variables were already used by some calculus.

Arbitrary-integer variables (of the form "@nx") are generated by TI-Basic function calls such as solve(sin(x)=0,x).

This variable is set to 0 every time the calculator is reset, or if cmd_clrhome is called. ARb_int_count wraps back to 0 after 255.

See also: ARb_real_count, cmd_clrhome, cmd_newprob


ARb_real_count

AMS 2.04 or higher

ESQ ARb_real_count;

Represents the number of times arbitrary variables were already used by some calculus.

Arbitrary variables (of the form "@x") are generated by TI-Basic function calls such as zeros(0,x).

This variable is set to 0 every time the calculator is reset, or if cmd_clrhome is called. ARb_real_count wraps back to 0 after 255.

See also: ARb_int_count, cmd_clrhome, cmd_newprob


bottom_estack

CESI bottom_estack;

Points to the bottom of the expression stack.

bottom_estack is a global variable which points to the bottom of the expression stack, i.e. the first byte used. The quantum at bottom_estack is always ENDSTACK_TAG. Usually, you should not change this pointer, although it seems that it is possible to change it temporarily. If you do this, however, you need to make sure that it is changed back in any case, even if an error occurs.

This variable can be used together with top_estack to determine the amount of memory on the expression stack which is currently used.

The following example (called "Print EStack") prints the values of bottom_estack and top_estack:

// Print bottom_estack and top_estack

#define USE_TI89              // Compile for TI-89
#define USE_TI92PLUS          // Compile for TI-92 Plus
#define USE_V200              // Compile for V200

#define MIN_AMS 100           // Compile for AMS 1.00 or higher
#define SAVE_SCREEN           // Save/Restore LCD Contents

#include <tigcclib.h>         // Include All Header Files

// Main Function
void _main(void)
{
  ClrScr ();
  printf_xy (0, 40, "Bottom = 0x%lp", bottom_estack);
  printf_xy (0, 50, "Top = 0x%lp", top_estack);
  ngetchx ();
}

See also: top_estack


top_estack

ESI top_estack;

Points to the top of the expression stack.

The global variable top_estack points to the top (i.e. the last byte) of the expression stack. Strictly speaking, in "nostub" mode it is not a real variable but smart macro, although it works like it is a variable. The expression stack is the place in the memory where TI keeps expressions during evaluation. All statements are tokenized before being executed (interpreted). Instructions are reduced to (byte sized) quanta and parsed into Reverse Polish Notation (RPN). This is a common technique in interpreted languages. Expressions, functions, etc. are all stored in RPN form, to allow for efficient operation of the expressions stack. See below for more details about organization of the expression stack.

The actual processing of all expressions is done via the expression stack. The position in the stack is given by top_estack. Pushing a value appends it to the expression stack and increments top_estack. When a expression is interpreted, expressions are reduced, and executed as far as possible. Whatever remains on the stack is the result, this may then be stored or processed later.

When a file is interpreted the end of the variable is found and it is processed as a separate expression stack. It is then processed recursively, producing a simplified version on the real expression stack. Expressions are therefore interpreted from the top (high memory) recursively.

As an artefact of expressions processing mechanism, the arguments of the called program are kept also on the expression stack. It grows upwards, and the last argument is stored first. After the assembly program is called, the image of the expression stack is as follows:

Each string entry on the expression stack is stored as follows (from lower to higher addresses):

Each integer entry is stored as follows:

Each fraction entry is stored as follows:

Each floating point entry is stored as follows:

If the entry is complex number, real part is stored first (which can be integer, float, fraction, etc.), then imaginary part. COMPLEX_TAG (0x9D) is stored after them, so if the current argument type is complex, decrease the argument pointer by one, then first read imaginary part, then real part separately.

If the entry is composite (i.e. if it is a list or a matrix), the first byte is end_of_list marker (byte END_TAG or 0xE5), then follow each element of the list in reverse order (starting from the last element), and the last byte is LIST_TAG (0xD9). Now, you surely have an idea how you can pick up elements from the list. Note that a matrix is a "list of lists".

Signed zeros (POSITIVE_ZERO and NEGATIVE_ZERO) are represented as fractions +0/1 and -0/1.

Variable names are stored exactly like strings without terminating STR_TAG (i.e. it is a sequence of letters bounded with two zero bytes), so "variable" tag is just a zero byte. There is an exception: one-letter variables have unique one-byte tags (see Tags for more info. Also, note that variable names are always stored with lowercase letters. Variables whose names ends with an underscore are assumed to be complex, and variables whose names starts with an underscore are assumed to represent physical units.

Expressions are stored in RPN (Reverse Polish Notation) form (also known as postfix form). So, function calls like func(arg1,arg2,...argn) are stored as sequence

argn ... arg2 arg1 func_tag

and terms like arg1 operator arg2 are stored as arg1 arg2 operator_tag or arg2 arg1 operator_tag, depending on the concrete operator. The situation is analogous for unary operators. Note that a "pointer to an expression" is a pointer to the last byte of the expression! When a function (or operator) has variable number of arguments, END_TAG is used to indicate "no more arguments". See Tags for complete list of various tags. This will be illustrated with some examples:

Algebraic form: integrate (e^(x^2), x, 1, 2)
RPN form: 2 1 x 2 x ^ e ^ integrate
Sequence of bytes:    [02 01 1F] [01 01 1F] [08] [02 01 1F] [08] [93] [25] [93] [C4]

Algebraic form: sum (sqrt (1 + x), x, 0, a) (where sum is actually the capital sigma)
RPN form: a 0 x x 1 + sqrt sum
Sequence of bytes:    [0B] [00 1F] [08] [08] [01 01 1F] [8B] [51] [BA]

Algebraic form: a + b + a - b + (a + b) * (a - b) -> a
RPN form: a b + a + b - a b + a b - * + a ->
Sequence of bytes:    [0B] [0C] [8B] [0B] [8B] [0C] [8D] [0B] [0C] [8B] [0B] [0C] [8D] [8F] [8B] [0B] [80]

Algebraic form: {{1, 2}, {3, 4}}
RPN form: END_TAG END_TAG 4 3 LIST_TAG END_TAG 2 1 LIST_TAG LIST_TAG
Sequence of bytes:    [E5] [E5] [04 01 1F] [03 01 1F] [D9] [E5] [02 01 1F] [01 01 1F] [D9] [D9]

Algebraic form: my_func (a, b, c)
RPN form: END_TAG c b a my_func USERFUNC_TAG
Sequence of bytes:    [E5] [0D] [0C] [0B] [00 6D 79 5F 66 75 6E 63 00] [DA]

To perform some algebraic transformations on more unique way, expressions should be transformed into an equivalent form called "internal canonic form". In such form, for example, all constants are always in front of variables, e.g. 'x*3' and 'x+3' becomes '3*x' and '3+x' (although the second example will be printed as 'x+3'). Also, expressions like 'x/y' or 'x-y' in internal canonic form do not contain subtractions and divisions. As the parameter list (when the program is called from TI-Basic) is always in internal canonic form, such expressions will never be observed as-is in parameter lists etc. because they will be converted before passing them to the program. A lot of functions for algebraic manipulations automatically convert the expression in the internal canonic form, but when this is not true, you can always force the conversion using explicit call to push_internal_simplify function. Note that the reverse conversion (i.e. back from the canonic form into a regular form) is performed anytime when you try to print out the expression. Here is the list of the most common transformations which appears during the transformation into the internal canonic form:

ExpressionStandard canonic form
-x(-1)*x
x-yx+y*(-1)
x/yx*y^(-1)
e^xexp(x)
x^yexp(ln(x)*y)
[ except when "y" is an integer or a fraction ]
eexp(1)
sqrt(x)x^(1/2)
log(x)ln(x)*(ln(10)^(-1))
sin(x)trig(x,0)
[ assuming "radian" mode; for "trig" function, see SINCOS_TAG ]
cos(x)trig(x,1)
tan(x)trig(x,0)*trig(x,1)^(-1)
sinh(x)exp(x)*(1/2)+exp(x)^(-1)*(-1/2)
cosh(x)exp(x)*(1/2)+exp(x)^(-1)*(1/2)
tanh(x)(exp(x)^2+1)^(-1)*(exp(x)^2+(-1))
x xor y(not x and y) or (x and not y)

Mode dependent calculations are performed by converting expressions to a specific format, i.e. for trigonometric functions all values are converted to radians before passing them to radian trigonometric functions.

A variable may consist of multiple expressions, these are separated by several special quanta: NEXTEXPR_TAG and NEWLINE_TAG. The last expression is marked with ENDSTACK_TAG. See MULTI_EXPR.

If everything mentioned above is not so clear for you, compile and run the following example (called "Print EStack"):

// Print bottom_estack and top_estack

#define USE_TI89              // Compile for TI-89
#define USE_TI92PLUS          // Compile for TI-92 Plus
#define USE_V200              // Compile for V200

#define MIN_AMS 100           // Compile for AMS 1.00 or higher
#define SAVE_SCREEN           // Save/Restore LCD Contents

#include <tigcclib.h>         // Include All Header Files

// Main Function
void _main(void)
{
  ClrScr ();
  printf_xy (0, 40, "Bottom = 0x%lp", bottom_estack);
  printf_xy (0, 50, "Top = 0x%lp", top_estack);
  ngetchx ();
}

Run this program in VTI and pass to it parameters as you want. top_estack will be shown on the screen. During waiting for a keypress, enter the debugger and look at the addresses shown, to see how parameters are stored.

See also: bottom_estack


NULL_INDEX

#define NULL_INDEX ((CESI) 0)

Describes an empty expression stack index.

NULL_INDEX is an expression stack index (ESI) equivalent to NULL. It can be used as a function argument in cases where the argument is optional.


CESI_Callback_t

typedef CALLBACK unsigned short (*CESI_Callback_t) (CESI);

Represents a pointer to a CESI callback function.

CESI_Callback_t is a pointer to a function taking a CESI (expression stack index with constant data) as a parameter and returning an integer. It is used in all_tail and any_tail.


CESI

typedef const ESQ *CESI;

Represents a pointer to a constant expression.

The type CESI acts like ESI, but the value pointed to by it may have to be constant. For example, it may be a SYM_STR whose contents are stored at a fixed place in the program.


ESI_Callback_Int_t

typedef CALLBACK unsigned short (*ESI_Callback_Int_t) (ESI, unsigned short);

Represents a pointer to an ESI callback function with integer extensions.

ESI_Callback_Int_t is a pointer to a function taking an ESI (expression stack index) and an integer as a parameter and returning an integer. It is used in map_tail_Int.


ESI_Callback_t

typedef CALLBACK void (*ESI_Callback_t) (ESI);

Represents a pointer to an ESI callback function.

ESI_Callback_t is a pointer to a function taking an ESI (expression stack index) as a parameter and returning nothing. It is used in map_tail and map_unary_over_comparison.


ESI

typedef ESQ *ESI;

Represents an index of a value on the TIOS expression stack.

The type ESI is an "expression stack index", which is, in fact, a pointer to a tag byte on the TIOS expression stack.

See top_estack and Tags for more info about the expression stack.


ESQ

typedef unsigned char ESQ;

Represents a quantum within an expression.

ESQ represents a quantum (the smallest meaningful unit) of an expression. It can be a tag from the Tags enum, or any other byte value.


EStackIndex

#define EStackIndex ESI

Represents an index of a value on the TIOS expression stack.

EStackIndex is a synonym for ESI.


ExtTags

enum ExtTags {...};

An enumeration to describe extra types of entries on the expression stack.

If the tag of an entry on the expression stack is EXT_TAG (0xE3), then the byte below it is the extra TI-Basic function tag. ExtTags is enumerated type for describing such extended entries (see top_estack for more info about how entries on the expression stack are organized). This enum is quite big, and here is a complete list of extended function tags defined in it (all values are in hex), with their meaning (used notation is RPN):

01INDIR_TAGstring_expr # (indirection)
02GETKEY_TAG[] getKey
03GETFOLD_TAG[] getFold
04SWITCH_TAG[int] switch
05UNITCONV_TAGunit1 unit2 > (unit conversion, unit1 |> unit2)
06ORD_TAGstring ord
07EXPR_TAGstring expr
08CHAR_TAGint char
09STRING_TAGexpr string
0AGETTYPE_TAGvar getType
0BGETMODE_TAGstring getMode
0CSETFOLD_TAGvar setFold
0DPTTEST_TAGy x ptTest
0EPXLTEST_TAGcolumn row pxlTest
0FSETGRAPH_TAGstring string setGraph
10SETTABLE_TAGstring string setTable
11SETMODE_TAG[] string string setMode
12FORMAT_TAG[string] expr format
13INSTRING_TAG[start] substring search-string inString
14APPEND_TAGstring1 string2 & (append)
15DD_TAGdmsnumber >DD
16EXPR2DMS_TAGexpr >DMS
17VEC2RECT_TAGvec >Rect
18VEC2POLAR_TAGvec >Polar
19VEC2CYLIND_TAGvec >Cylind
1AVEC2SPHERE_TAGvec >Sphere
1BPARENTH_START_TAG(   (used only internally for the parser, not in expressions)
1CPARENTH_END_TAG)   (used only internally for the parser, not in expressions)
1DMAT_START_TAG[   (used only internally for the parser, not in expressions)
1EMAT_END_TAG]   (used only internally for the parser, not in expressions)
1FLIST_START_TAG{   (used only internally for the parser, not in expressions)
20LIST_END_TAG}   (used only internally for the parser, not in expressions)
21COMMA_TAG,   (used only internally for the parser, not in expressions)
22SEMICOLON_TAG;   (used only internally for the parser, not in expressions)
23COMPLEX_ANGLE_TAG   /_   (used only internally for the parser, not in expressions)
24SINGLE_QUOTE_TAG'   (used only internally for the parser, not in expressions)
25QUOTE_TAG"   (used only internally for the parser, not in expressions)
26POLCPLX_TAGmagnitude angle /_    (polar complex number)
27TMPCNV_TAGexpr2 expr1 tmpCnv
28DELTA_TMPCNV_TAGexpr2 expr1 DtmpCnv
29GETUNITS_TAG[] getUnits
2ASETUNITS_TAGlist setUnits
2BBIN_TAGint 0b   (i.e. 0bint)
2CHEX_TAGexpr 0h   (i.e. 0hexpr)
2DINT2BIN_TAGint >Bin
2EINT2DEC_TAGint >Dec
2FINT2HEX_TAGint >Hex
30DET_TOL_TAGtol mat det
31REF_TOL_TAGtol mat ref
32RREF_TOL_TAGtol mat rref
33SIMULT_TOL_TAGtol vec mat simult
34GETCONFG_TAG[] getConfg
35V_AUGMENT_TAGmat2 ; mat1 augment
36MEAN_TWOARG_TAGlist list mean (AMS 2.00 or higher)
37PRODUCT_TWOARG_TAG[end] start list product (AMS 2.00 or higher)
38STDDEV_TWOARG_TAGlist list stdDev (AMS 2.00 or higher)
39SUM_TWOARG_TAG[end] start list sum (AMS 2.00 or higher)
3AVARIANCE_TWOARG_TAGlist list variance (AMS 2.00 or higher)
3BDELTA_LIST_TAGlist Dlist (AMS 2.00 or higher)
46ISCLKON_TAG[] isClkOn (AMS 2.07 or higher)
47GETDATE_TAG[] getDate (AMS 2.07 or higher)
48GETTIME_TAG[] getTime (AMS 2.07 or higher)
49GETTMZN_TAG[] getTmZn (AMS 2.07 or higher)
4ASETDATE_TAG[] d mo y setDate (AMS 2.07 or higher)
4BSETTIME_TAG[] s min h setTime (AMS 2.07 or higher)
4CSETTMZN_TAGint setTmZn (AMS 2.07 or higher)
4DDAYOFWK_TAG[] d mo y dayOfWk (AMS 2.07 or higher)
4ESTARTTMR_TAG[] startTmr (AMS 2.07 or higher)
4FCHECKTMR_TAGseconds checkTmr (AMS 2.07 or higher)
50TIMECNV_TAGseconds timeCnv (AMS 2.07 or higher)
51GETDTFMT_TAG[] getDtFmt (AMS 2.07 or higher)
52GETTMFMT_TAG[] getTmFmt (AMS 2.07 or higher)
53GETDTSTR_TAG[int] getDtStr (AMS 2.07 or higher)
54GETTMSTR_TAG[int] getTmStr (AMS 2.07 or higher)
55SETDTFMT_TAG[int] setDtFmt (AMS 2.07 or higher)
56SETTMFMT_TAG[int] setTmFmt (AMS 2.07 or higher)

Note: An empty list [] of optional arguments means the function does not take any optional arguments, but an END_TAG is needed nonetheless.

Note: For compatibility with TI's compiler, their tag names are also supported.


InstructionTags

enum InstructionTags {...};

An enumeration to describe types of instructions on the expression stack.

If the tag of an entry on the expression stack is EXT_INSTR_TAG (0xE4), then the byte below it is the tag of a TI-Basic command token. Although TI-Basic tokens are not interesting for programming, they are defined in enumerated type InstructionTags, due to completeness. This enum is quite big, and here is a complete list of TI-Basic instruction token tags defined in it (all values are in hex), with their meaning (used notation is RPN):

01CLRDRAW_ITAGClrDraw
02CLRGRAPH_ITAGClrGraph
03CLRHOME_ITAGClrHome
04CLRIO_ITAGClrIO
05CLRTABLE_ITAGClrTable
06CUSTOM_ITAGCustom
07CYCLE_ITAGdisplacement Cycle (displacement towards the instruction ending the loop)
08DIALOG_ITAGDialog
09DISPG_ITAGDispG
0ADISPTBL_ITAGDispTbl
0BELSE_ITAGElse (in If...EndIf statement)
0CENDCUSTM_ITAGEndCustm
0DENDDLOG_ITAGEndDlog
0EENDFOR_ITAGdisplacement EndFor
0FENDFUNC_ITAGEndFunc
10ENDIF_ITAGEndIf
11ENDLOOP_ITAGdisplacement EndLoop
12ENDPRGM_ITAGEndPrgm
13ENDTBAR_ITAGEndTBar
14ENDTRY_ITAGEndTry
15ENDWHILE_ITAGdisplacement EndWhile
16EXIT_ITAGdisplacement Exit (displacement towards the end of the loop, i.e. the instruction following the loop ending instruction)
17FUNC_ITAGFunc
18LOOP_ITAGLoop
19PRGM_ITAGPrgm
1ASHOWSTAT_ITAGShowStat
1BSTOP_ITAGStop
1CTHEN_ITAGThen
1DTOOLBAR_ITAGToolbar
1ETRACE_ITAGTrace
1FTRY_ITAGTry
20ZOOMBOX_ITAGZoomBox
21ZOOMDATA_ITAGZoomData
22ZOOMDEC_ITAGZoomDec
23ZOOMFIT_ITAGZoomFit
24ZOOMIN_ITAGZoomIn
25ZOOMINT_ITAGZoomInt
26ZOOMOUT_ITAGZoomOut
27ZOOMPREV_ITAGZoomPrev
28ZOOMRCL_ITAGZoomRcl
29ZOOMSQR_ITAGZoomSqr
2AZOOMSTD_ITAGZoomStd
2BZOOMSTO_ITAGZoomSto
2CZOOMTRIG_ITAGZoomTrig
2DDRAWFUNC_ITAG    expr DrawFunc
2EDRAWINV_ITAGexpr DrawInv
2FGOTO_ITAGexpr Goto (Expr = LABEL)
30LBL_ITAGexpr Lbl (Expr = LABEL)
31GET_ITAGvar Get
32SEND_ITAGlist Send
33GETCALC_ITAGvar GetCalc
34SENDCALC_ITAGvar SendCalc
35NEWFOLD_ITAGfoldername NewFold
36PRINTOBJ_ITAGvar PrintObj
37RCLGDB_ITAGvar RclGDB
38STOGDB_ITAGvar StoGDB
39ELSEIF_ITAGcondition ElseIf
3AIF_ITAGcondition If (simple variant)
3BIFTHEN_ITAGcondition If...Then (If condition Then)
3CRANDSEED_ITAGexpr RandSeed
3DWHILE_ITAGcondition While
3ELINETAN_ITAGpoint expr LineTan
3FCOPYVAR_ITAGvar2 var1 CopyVar
40RENAME_ITAGnewname oldname Rename
41STYLE_ITAGstring expr Style
42FILL_ITAGvar expr Fill
43REQUEST_ITAGvar string Request
44POPUP_ITAGvar itemlist PopUp
45PTCHG_ITAGy x PtChg
46PTOFF_ITAGy x PtOff
47PTON_ITAGy x PtOn
48PXLCHG_ITAGcolumn row PxlChg
49PXLOFF_ITAGcolumn row PxlOff
4APXLON_ITAGcolumn row PxlOn
4BMOVEVAR_ITAGnewfolder oldfolder var MoveVar
4CDROPDOWN_ITAGvar list title_string DropDown
4DOUTPUT_ITAGexpr column row Output
4EPTTEXT_ITAGy x string PtText
4FPXLTEXT_ITAGcolumn row string PxlText
50DRAWSLP_ITAGslope y x DrawSlp
51PAUSE_ITAG[expr] Pause
52RETURN_ITAG[expr] Return
53INPUT_ITAG[var [string]] Input
54PLOTSOFF_ITAG[9] ... [2] [1] PlotsOff
55PLOTSON_ITAG[9] ... [2] [1] PlotsOn
56TITLE_ITAG[label] string Title
57ITEM_ITAG[label] string Item
58INPUTSTR_ITAGvar [string] InputStr
59LINEHORZ_ITAG[drawmode] y LineHorz
5ALINEVERT_ITAG[drawmode] x LineVert
5BPXLHORZ_ITAG[drawmode] row PxlHorz
5CPXLVERT_ITAG[drawmode] column PxlVert
5DANDPIC_ITAG[pxlcol pxlrow] picvar AndPic
5ERCLPIC_ITAG[pxlcol pxlrow] picvar RclPic
5FRPLCPIC_ITAG[pxlcol pxlrow] picvar RplcPic
60XORPIC_ITAG[pxlcol pxlrow] picvar XorPic
61DRAWPOL_ITAG[qstep] [qmax] [qmin] DrawPol
62TEXT_ITAG[] string Text
63ONEVAR_ITAG[L4] [L3] [L2] [L1] OneVar
64STOPIC_ITAG[height width] [pxlcol pxlrow] var StoPic
65GRAPH_ITAG[var2] [var1] [expr2] expr1 Graph
66TABLE_ITAG[var] [expr2] expr1 Table
67NEWPIC_ITAG[maxcol] [maxrow] picvar mat NewPic
68DRAWPARM_ITAG[tstep] [tmax] [tmin] expr2 expr1 DrawParm
69CYCLEPIC_ITAG[direction] [cycle] [wait] N picname_string CyclePic
6ACUBICREG_ITAG[[L5 L4] [L3]] L2 L1 CubicReg
6BEXPREG_ITAG[[L5 L4] [L3]] L2 L1 ExpReg
6CLINREG_ITAG[[L5 L4] [L3]] L2 L1 LinReg
6DLNREG_ITAG[[L5 L4] [L3]] L2 L1 LnReg
6EMEDMED_ITAG[[L5 L4] [L3]] L2 L1 MedMed
6FPOWERREG_ITAG[[L5 L4] [L3]] L2 L1 PowerReg
70QUADREG_ITAG[[L5 L4] [L3]] L2 L1 QuadReg
71QUARTREG_ITAG[[L5 L4] [L3]] L2 L1 QuartReg
72TWOVAR_ITAG[[L5 L4] [L3]] L2 L1 TwoVar
73SHADE_ITAG[patres] [pat] [xhigh] [xlow] expr2 expr1 Shade
74FOR_ITAG[step] high low var For
75CIRCLE_ITAG[drawmode] r y x Circle
76PXLCRCL_ITAG[drawmode] r col row PxlCrcl
77NEWPLOT_ITAG[bucket] [mark] [inc] [cat] [frq] [ylist] xlist type N NewPlot
78LINE_ITAG[drawmode] yend xend ystart xstart Line
79PXLLINE_ITAG[drawmode] colend rowend colstart rowstart PxlLine
7ADISP_ITAG[[...] expr1] Disp
7BFNOFF_ITAG[99] ... [2] [1] FnOff
7CFNON_ITAG[99] ... [2] [1] FnOn
7DLOCAL_ITAG[...] var1 Local
7EDELFOLD_ITAG[...] var1 DelFold
7FDELVAR_ITAG[...] var1 DelVar
80LOCK_ITAG[...] var1 Lock
81PROMPT_ITAG[...] var1 Prompt
82SORTA_ITAG[...] list1 SortA
83SORTD_ITAG[...] list1 SortD
84UNLOCK_ITAG[...] var1 UnLock
85NEWDATA_ITAG[...] list1 datavar NewData
86DEFINE_ITAGexpr var|userfunc Define
87ELSE_TRY_ITAGElse (in Try...EndTry statement)
88CLRERR_ITAGClrErr
89PASSERR_ITAGPassErr
8ADISPHOME_ITAGDispHome
8BEXEC_ITAG[[...] expr] string Exec
8CARCHIVE_ITAG[...] var1 Archive
8DUNARCHIV_ITAG[...] var1 Unarchiv
8ELU_ITAG[tol] pvar uvar lvar mat LU
8FQR_ITAG[tol] rvar qvar mat QR
90BLDDATA_ITAGvar|sysdata BldData
91DRWCTOUR_ITAGexpr DrwCtour
92NEWPROB_ITAGNewProb
93SINREG_ITAG[[L4 L3] [period] [iter]] L2 L1 SinReg
94LOGISTIC_ITAG[[L4 L3] [period] [iter]] L2 L1 Logistic
95CUSTMON_ITAGCustmOn
96CUSTMOFF_ITAGCustmOff
97SENDCHAT_ITAGvar SendChat
99REQUEST_THREEARG_ITAG[] alphalock var string Request (AMS 2.07 or higher)
9ACLOCKON_ITAGClockOn (AMS 2.07 or higher)
9BCLOCKOFF_ITAGClockOff (AMS 2.07 or higher)

Note: Displacements for jumps are 2 byte quantities in little endian format. Displacements in front of loop ending instructions are towards the beginning of the loop.

Note: An empty list [] of optional arguments means the instruction does not take any optional arguments, but an END_TAG is needed nonetheless.

Note: For compatibility with TI's compiler, their tag names are also supported.


MULTI_EXPR

typedef struct {
unsigned short Size;
ESQ Expr[];
} MULTI_EXPR;

Describes a multi-expression, which is processed as a separate expression stack.

MULTI_EXPR is a structure describing a multi-expression. It can be applied to the contents of every VAT symbol, because all symbols contain size bytes at the beginning. It can also be used to describe a multi-expression passed to Parse2DMultiExpr, or used by the FIFO elements in homescr.h.

The Size field contains the size of the data in Expr, in bytes (but note that ESQ is one byte large). For real multi-expressions, Expr should start with ENDSTACK_TAG, followed by the actual expressions. These expressions are processed from the end to the beginning, as usual (using the Size field to find the end). So the last quantum needs to be a tag from the Tags enum.

Multiple expressions are separated with NEXTEXPR_TAG, or with NEWLINE_TAG (only in TI-Basic programs and functions).

If you have a handle to a MULTI_EXPR structure, you can use the HToESI function to get a pointer to the last quantum (i.e. the tag).

See also: top_estack, HToESI, Parse2DMultiExpr, homescr.h


Quantum

#define Quantum ESQ

Represents a quantum within an expression.

Quantum is a synonym for ESQ.


SYM_STR

typedef CESI SYM_STR;

Represents a pointer to the terminating zero byte of a string.

The type SYM_STR is in fact the same as CESI. It represents a string created with the SYMSTR macro. This type of string is usually used in expressions on the expression stack, or in functions from vat.h or bascmd.h.


SysvarTags

enum SysvarTags {...};

An enumeration to describe types of system variable entries on the expression stack.

If the tag of an entry on the expression stack is EXT_SYSTEM_TAG (0x1C), then the byte below it is the tag of a TI-Basic system variable. SysvarTags is enumerated type for describing such extended entries (see top_estack for more info about how entries on the expression stack are organized). This enum is quite big, and here is a complete list of system variables tags defined in it (all values are in hex), with their meaning:

01X_BAR_TAGx mean
02Y_BAR_TAGy mean
03SIGMA_X_TAGSx
04SIGMA_X2_TAGSx2
05SIGMA_Y_TAGSy
06SIGMA_Y2_TAGSy2
07SIGMA_XY_TAGSxy
08SX_TAGSx
09SY_TAGSy
0ASMLSIGMA_X_TAGsx
0BSMLSIGMA_Y_TAGsy
0CNSTAT_TAGnStat
0DMINX_TAGminX
0EMINY_TAGminY
0FQ1_TAGq1
10MEDSTAT_TAGmedStat
11Q3_TAGq3
12MAXX_TAGmaxX
13MAXY_TAGmaxY
14CORR_TAGcorr
15R2_TAGR2
16MEDX1_TAGmedx1
17MEDX2_TAGmedx2
18MEDX3_TAGmedx3
19MEDY1_TAGmedy1
1AMEDY2_TAGmedy2
1BMEDY3_TAGmedy3
1CXC_TAGxc
1DYC_TAGyc
1EZC_TAGzc
1FTC_TAGtc
20RC_TAGrc
21THETA_C_TAGqc
22NC_TAGnc
23XFACT_TAGxfact
24YFACT_TAGyfact
25ZFACT_TAGzfact
26XMIN_TAGxmin
27XMAX_TAGxmax
28XSCL_TAGxscl
29YMIN_TAGymin
2AYMAX_TAGymax
2BYSCL_TAGyscl
2CDELTA_X_TAGDx
2DDELTA_Y_TAGDy
2EXRES_TAGxres
2FXGRID_TAGxgrid
30YGRID_TAGygrid
31ZMIN_TAGzmin
32ZMAX_TAGzmax
33ZSCL_TAGzscl
34EYE_THETA_TAGeyeq
35EYE_PHI_TAGeyeF
36THETA_MIN_TAGqmin
37THETA_MAX_TAGqmax
38THETA_STEP_TAGqstep
39TMIN_TAGtmin
3ATMAX_TAGtmax
3BTSTEP_TAGtstep
3CNMIN_TAGnmin
3DNMAX_TAGnmax
3EPLOTSTRT_TAGplotStrt
3FPLOTSTEP_TAGplotStep
40ZXMIN_TAGzxmin
41ZXMAX_TAGzxmax
42ZXSCL_TAGzxscl
43ZYMIN_TAGzymin
44ZYMAX_TAGzymax
45ZYSCL_TAGzyscl
46ZXRES_TAGzxres
47Z_THETA_MIN_TAGzqmin
48Z_THETA_MAX_TAGzqmax
49Z_THETA_STEP_TAG    zqstep
4AZTMIN_TAGztmin
4BZTMAX_TAGztmax
4CZTSTEP_TAGztstep
4DZXGRID_TAGzxgrid
4EZYGRID_TAGzygrid
4FZZMIN_TAGzzmin
50ZZMAX_TAGzzmax
51ZZSCL_TAGzzscl
52ZEYE_THETA_TAGzeyeq
53ZEYE_PHI_TAGzeyeF
54ZNMIN_TAGznmin
55ZNMAX_TAGznmax
56ZPLTSTEP_TAGzpltstep
57ZPLTSTRT_TAGzpltstrt
58SEED1_TAGseed1
59SEED2_TAGseed2
5AOK_TAGok
5BERRORNUM_TAGerrornum
5CSYSMATH_TAGsysMath
5DSYSDATA_TAGsysData
5EREGEQ_TAGregEq (Name = null)
5FREGCOEF_TAGregCoef
60TBLINPUT_TAGtblInput
61TBLSTART_TAGtblStart
62DELTA_TBL_TAGDtbl
63FLDPIC_TAGfldpic (this tag is suspicious)
64EYE_PSI_TAGeyeY
65TPLOT_TAGtplot
66DIFTOL_TAGdiftol
67ZEYE_PSI_TAGzeyeY
68T0_TAGt0
69DTIME_TAGdtime
6ANCURVES_TAGncurves
6BFLDRES_TAGfldres
6CESTEP_TAGEstep
6DZT0DE_TAGzt0de
6EZTMAXDE_TAGztmaxde (Name = ztmax)
6FZTSTEPDE_TAGztstepde (Name = ztstep)
70ZTPLOTDE_TAGztplotde
71NCONTOUR_TAGncontour


Tags

enum Tags {...};

An enumeration to describe types of entries on the expression stack.

This enum is very large, as there are a lot of various entries. See top_estack for more info about how entries on the expression stack are organized. Here is a complete list of tags with their values in hexadecimal notation, along with their meaning written in RPN:

00VAR_NAME_TAGvariable name (with more than one letter): '\0' var_name '\0'
01_VAR_Q_TAGvariable q (but not used - 1B is used normally)
02VAR_R_TAGvariable r
03VAR_S_TAGvariable s
04VAR_T_TAGvariable t
05VAR_U_TAGvariable u
06VAR_V_TAGvariable v
07VAR_W_TAGvariable w
08VAR_X_TAGvariable x
09VAR_Y_TAGvariable y
0AVAR_Z_TAGvariable z
0BVAR_A_TAGvariable a
0CVAR_B_TAGvariable b
0DVAR_C_TAGvariable c
0EVAR_D_TAGvariable d
0FVAR_E_TAGvariable e
10VAR_F_TAGvariable f
11VAR_G_TAGvariable g
12VAR_H_TAGvariable h
13VAR_I_TAGvariable i
14VAR_J_TAGvariable j
15VAR_K_TAGvariable k
16VAR_L_TAGvariable l
17VAR_M_TAGvariable m
18VAR_N_TAGvariable n
19VAR_O_TAGvariable o
1AVAR_P_TAGvariable p
1BVAR_Q_TAGvariable q
1CEXT_SYSTEM_TAGsystem token (a byte before the tag identifies a system variable, see SysvarTags)
1DARB_REAL_TAGarbitrary real number @xxx (byte before the tag determines xxx)
1EARB_INT_TAGarbitrary integer number @nxxx (byte before the tag determines xxx)
1FPOSINT_TAGpositive integer tag
20NEGINT_TAGnegative integer tag
21POSFRAC_TAGpositive fraction tag
22NEGFRAC_TAGnegative fraction tag
23FLOAT_TAGfloating point tag
23BCD_TAGfloating point tag (alias tag name)
24PI_TAGconstant p
25EXP_TAGconstant e
26IM_TAGconstant i
27NEGINFINITY_TAG-¥
28INFINITY_TAG¥
29PN_INFINITY_TAG+/- ¥
2AUNDEF_TAGundef
2BFALSE_TAGfalse
2CTRUE_TAGtrue
2DSTR_TAGstring tag: '\0' string '\0' STR_TAG
2ENOTHING_TAGallows missing terms in expressions
2FACOSH_TAGexpr acosh
30ASINH_TAGexpr asinh
31ATANH_TAGexpr atanh
32ASECH_TAGexpr asech (AMS 2.08 or higher)
33ACSCH_TAGexpr acsch (AMS 2.08 or higher)
34ACOTH_TAGexpr acoth (AMS 2.08 or higher)
35COSH_TAGexpr cosh
36SINH_TAGexpr sinh
37TANH_TAGexpr tanh
38SECH_TAGexpr sech (AMS 2.08 or higher)
39CSCH_TAGexpr csch (AMS 2.08 or higher)
3ACOTH_TAGexpr coth (AMS 2.08 or higher)
3BACOS_TAGexpr acos
3CASIN_TAGexpr asin
3DATAN_TAGexpr atan
3EASEC_TAGexpr asec (AMS 2.08 or higher)
3FACSC_TAGexpr acsc (AMS 2.08 or higher)
40ACOT_TAGexpr acot (AMS 2.08 or higher)
41RACOS_TAGexpr arcos (used only internally)
42RASIN_TAGexpr arsin (used only internally)
43RATAN_TAGexpr artan (used only internally)
44COS_TAGexpr cos
45SIN_TAGexpr sin
46TAN_TAGexpr tan
47SEC_TAGexpr sec (AMS 2.08 or higher)
48CSC_TAGexpr csc (AMS 2.08 or higher)
49COT_TAGexpr cot (AMS 2.08 or higher)
4AITAN_TAGexpr tan (used only internally)
4BABS_TAGexpr abs
4CANGLE_TAGexpr angle
4DCEILING_TAGexpr ceiling
4EFLOOR_TAGexpr floor
4FINT_TAGexpr int
50SIGN_TAGexpr sign
51SQRT_TAGexpr Ö
52EXPF_TAGexpr e^
53LN_TAGexpr ln
54LOG_TAGexpr log
55FPART_TAGexpr fPart
56IPART_TAGexpr iPart
57CONJ_TAGexpr conj
58IMAG_TAGexpr imag
59REAL_TAGexpr real
5AAPPROX_TAGexpr approx
5BTEXPAND_TAGexpr tExpand
5CTCOLLECT_TAGexpr tCollect
5DGETDENOM_TAGexpr getDenom
5EGETNUM_TAGexpr getNum
5FERROR_TAGexpr _ERROR_ (used only internally)
60CUMSUM_TAGlist cumSum
61DET_TAGmat det
62COLNORM_TAGmat colNorm
63ROWNORM_TAGmat rowNorm
64NORM_TAGmat norm
65MEAN_TAGlist mean
66MEDIAN_TAGlist median
67PRODUCT_TAGlist product
68STDDEV_TAGlist stdDev
69SUM_TAGlist sum
6AVARIANCE_TAGlist variance
6BUNITV_TAGvec unitV
6CDIM_TAGmat dim
6DMAT2LIST_TAGmat mat>list
6ENEWLIST_TAGno_of_elements newList
6FRREF_TAGmat rref
70REF_TAGmat ref
71IDENTITY_TAGinteger identity
72DIAG_TAGmat diag
73COLDIM_TAGmat colDim
74ROWDIM_TAGmat rowDim
75TRANSPOSE_TAGmat T
76FACTORIAL_TAGexpr !
77PERCENT_TAGexpr %
78RADIANS_TAGexpr r
79NOT_TAGexpr not
7AMINUS_TAGexpr _negative_
7BVEC_POLAR_TAGmat _polar_vector_ (mat is assumed to be [[r,q]])
7CVEC_CYLIND_TAGmat _cylind_vector_ (mat is assumed to be [[r,q,z]])
7DVEC_SPHERE_TAGmat _sphere_vector_ (mat is assumed to be [[r,q,F]])
7ESTART_TAG( (used only internally, don't use it)
7FISTORE_TAGexpr var -> (internal version: don't use)
80STORE_TAGexpr var ->
81WITH_TAGcondition expr |
82XOR_TAGexpr2 expr1 xor
83OR_TAGexpr2 expr1 or
84AND_TAGexpr2 expr1 and
85LT_TAGexpr2 expr1 <
86LE_TAGexpr2 expr1 <=
87EQ_TAGexpr2 expr1 =
88GE_TAGexpr2 expr1 >=
89GT_TAGexpr2 expr1 >
8ANE_TAGexpr2 expr1 /=
8BADD_TAGexpr1 expr2 +
8CADDELT_TAGexpr1 expr2 .+
8DSUB_TAGexpr1 expr2 -
8ESUBELT_TAGexpr1 expr2 .-
8FMUL_TAGexpr1 expr2 *
90MULELT_TAGexpr1 expr2 .*
91DIV_TAGexpr1 expr2 /
92DIVELT_TAGexpr1 expr2 ./
93POW_TAGexpr2 expr1 ^
94POWELT_TAGexpr2 expr1 .^
95SINCOS_TAGint expr trig (where trig(expr,int)=cos(expr+(int-1)*pi/2))
96SOLVE_TAGvar equation solve
97CSOLVE_TAGvar equation cSolve
98NSOLVE_TAGvar equation nSolve
99ZEROS_TAGvar expr_in_var zeros
9ACZEROS_TAGvar expr_in_var cZeros
9BFMIN_TAGvar expr_in_var fMin
9CFMAX_TAGvar expr_in_var fMax
9DCOMPLEX_TAGcomplex number
9EPOLYEVAL_TAGexpr list polyEval
9FRANDPOLY_TAGorder var randPoly
A0CROSSP_TAGvec2 vec1 crossP
A1DOTP_TAGvec2 vec1 dotP
A2GCD_TAGexpr2 expr1 gcd
A3LCM_TAGexpr2 expr1 lcm
A4MOD_TAGexpr2 expr1 mod
A5INTDIV_TAGexpr2 expr1 intDiv
A6REMAIN_TAGexpr2 expr1 remain
A7NCR_TAGexpr2 expr1 nCr
A8NPR_TAGexpr2 expr1 nPr
A9P2RX_TAGq_expr r_expr P>Rx
AAP2RY_TAGq_expr r_expr P>Ry
ABP2PTHETA_TAGy_expr x_expr R>Pq
ACP2PR_TAGy_expr x_expr R>Pr
ADAUGMENT_TAGmat2 mat1 augment
AENEWMAT_TAGnum_columns num_rows newMat
AFRANDMAT_TAGnum_columns num_rows randMat
B0SIMULT_TAGvec mat simult
B1PART_TAG[#] expr part
B2EXP2LIST_TAGvar list exp>list
B3RANDNORM_TAGsd mean randNorm
B4MROW_TAG[] index mat expr mRow
B5ROWADD_TAG[] index2 index1 mat rowAdd
B6ROWSWAP_TAG[] index2 index1 mat rowSwap
B7ARCLEN_TAG[] end start var expr arcLen
B8NINT_TAG[] up low var expr nInt
B9PI_PRODUCT_TAG[] high low var expr Õ
BASIGMA_SUM_TAG[] high low var expr å
BBMROWADD_TAG[] index2 index1 mat expr mRowAdd
BCANS_TAG[int] ans
BDENTRY_TAG[int] entry
BEEXACT_TAG[tol] expr exact
BFLOGB_TAGexpr2 expr1 logb (where logb(expr1,expr2)=ln(expr1)/ln(expr2))
C0COMDENOM_TAG[var] expr comDenom
C1EXPAND_TAG[var] expr expand
C2FACTOR_TAG[var] expr factor
C3CFACTOR_TAG[var] expr cFactor
C4INTEGRATE_TAG[up low] var expr ò
C5DIFFERENTIATE_TAG   [order] var expr
C6AVGRC_TAG[h] var expr avgRC
C7NDERIV_TAG[h] var expr nDeriv
C8TAYLOR_TAG[point] order var expr taylor
C9LIMIT_TAG[direction] point var expr limit
CAPROPFRAC_TAG[var] expr propFrac
CBWHEN_TAG[[undef_val] false_val] true_val condition when
CCROUND_TAG[digits] expr round
CDDMS_TAG[[ss] mm] dd _DMSNUMBER_
CELEFT_TAG[num] string left
CFRIGHT_TAG[num] string right
D0MID_TAG[count] start string mid
D1SHIFT_TAG[int] list shift
D2SEQ_TAG[step] high low var expr seq
D3LIST2MAT_TAG[elements_per_row] list list->mat
D4SUBMAT_TAG[[[[col2] row2] col1] row1] mat subMat
D5SUBSCRIPT_TAG[col] row var _subscript_ (i.e. var[row] or var[row,col])
D6RAND_TAG[int] rand
D7MIN_TAG[expr2] list|expr1 min
D8MAX_TAG[expr2] list|expr1 max
D9LIST_TAGlist tag, or matrix represented as "list of list"
DAUSERFUNC_TAGuser defined function/program call: [[...] arg1] '\0' fnc_name '\0' USERFUNC_TAG
DBMATRIX_TAGmatrix tag (only in data editor)
DCFUNC_TAGprogram/function tag (not used in expressions)
DDDATA_TAGdata tag (not used in expressions)
DEGDB_TAGGDB tag (not used in expressions)
DFPIC_TAGpicture tag (not used in expressions)
E0TEXT_TAGtext tag (not used in expressions)
E1FIG_TAGfigure tag (not used in expressions)
E2MAC_TAGmacro tag (not used in expressions)
E3EXT_TAGextra TI-Basic function token (see ExtTags)
E4EXT_INSTR_TAGTI-Basic command token (not used in expressions, see InstructionTags)
E5END_TAGend of the expression or the list
E6COMMENT_TAGcomment (not used in expressions): '\0' string '\0' indentation COMMENT_TAG, where indentation is a single byte indicating the number of spaces between © and the first comment character
E7NEXTEXPR_TAG":" between tokens on same line in the program (not used in expressions): indentation NEXTEXPR_TAG, where indentation is a single byte indicating the number of spaces between : and the first character of the next logical line
E8NEWLINE_TAGmarks end of line in TI-Basic (not used in expressions): indentation NEWLINE_TAG, where indentation is a single byte indicating the number of spaces in front of the first character of the next line
E9ENDSTACK_TAGend of TI-Basic program (not used in expressions), or end of the expression stack
EAPN1_TAGexpr +/-
EBPN2_TAGexpr1 expr2 +/-
ECERROR_MSG_TAGname error_message
EDEIGVC_TAGmat eigVc
EEEIGVL_TAGmat eigVl
EFDASH_TAGexpr ' (prime, i.e. expr')
F0LOCALVAR_TAGvar _local_ (parameter/local variable reference)
F1DESOLVE_TAG[] depend_var indep_var equation deSolve
F2FDASH_TAGfunc_params func_name ' (prime, i.e. func_name'(func_params)
F3ASM_TAGASM program tag (not used in expressions)
F4ISPRIME_TAGint isPrime
F8OTH_TAGOther file tag, for custom file types (not used in expressions)
F9ROTATE_TAG[count] list|int|string rotate

Note: An empty list [] of optional arguments means the function does not take any optional arguments, but an END_TAG is needed nonetheless.

Note: For compatibility with TI's compiler, their tag names are also supported.


TokenizeSymNameFlags

enum TokenizeSymNameFlags {TSF_FULLY_QUALIFIED = 0x01, TSF_ALLOW_RESERVED = 0x02, TSF_PASS_ERRORS = 0x04};

Contains flags specifying how a symbol name is tokenized.

TokenizeSymNameFlags is an enumeration containing flags used by TokenizeSymName.


Return to the main index