XSLPqparse
PurposePerform a quick parse on a free-format character string, identifying where each token startsSynopsisint XPRS_CC XSLPqparse(char *Record, char *Token[], int NumFields);Arguments
Record Character string to be parsed. Each token must be separated by one or more spaces from the next one. Token Array of character pointers to receive the start address of each token. NumFields Maximum number of fields to be parsed.Return valueThe number of fields processed.ExampleThe following example does a quick parse of the formula "sin(x+y)" to identify where the tokens start, and then prints the first character of each token.char *Token[20]; int i, n; n = XSLPqparse("sin ( x + y )",Token,20); for (i=0;i<n;i++) printf("\nToken[%d] starts with %c",i,Token[i][0]);Further informationXSLPqparse does not change Record in any way. Although Token[i] will contain the address of the start of the ith token, the end of the token is still indicated by a space or the end of the record.
The return value of XSLPqparse is the number of fields processed. This will be less than NumFields if there are fewer fields in the record.
If you have any comments or suggestions about these pages, please send mail to docs@dashoptimization.com.