Initializing help system before first use

problem.parsecformula

problem.parsecformula


Purpose
Parse a formula written as a character string into internal parsed (reverse Polish) format
Synopsis
ntoken = problem.parsecformula(formula, type, value)
Arguments
ntoken 
Number of tokens in the parsed formula (not counting the terminating xslp_op_eof token).
formula 
Character string containing the formula, written in the same free-format style as used in formulae in Extended MPS format, with spaces separating tokens.
Type 
Array of token types providing the parsed formula.
Value 
Array of values corresponding to the types in Type.
Example
Assuming that x and y are already defined as columns, the following example converts the formula "sin(x+y)" into internal parsed format, and then writes it out as a sequence of tokens.
type  = []
value = []
ntoken = p.parsecformula("sin ( x + y )", Type, Value)
i = 0
while type[i] != xslp_op_eof:
  str = p.itemname(type[i], value[i])
  printf(str)
  i += 1
Further information

Tokens are identified by name, so any columns or user functions which appear in the formula must already have been defined. Unidentified tokens will appear as type xslp_UNKNOWN.


Related topics

© 2001-2019 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.