Parse2DExpr Function (ROM Call 0x4A)

estack.h

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!


Uses: check_estack_size, delete_between, next_expression_index, push_between, push_END_TAG, push_expression, push_quantum, top_estack, ER_catch, ER_success, ER_throwVar, sprintf, strlen, NeedStack, XR_stringPtr, estack_max_index, estack_to_float, GetTagStr, primary_tag_list, _ds32s32, _ms32s32, ROM Call 0x457, ROM Call 0x4DF, ROM Call 0x5D8
Used by: cmd_disp, cmd_output, cmd_pause