expression_parse_c

	status.i4.v = expression_parse_c(expression_text.i1a.r,
					 text_length.i4.v,
					 subst_devices.i1a.r, num_devices.i4.v,
					 default_ftd.i2.v, options.u4.v,
					 expr_stack.gp.r, value.r4.r,
					 units_text.i1a.r, error_string.i1a.r)

	This routine parses and optionally evaluates an algebraic
	or logical expression which can contain device names.  This
	expression can be evaluated by a call to expression_evaluate_c.

	expression_text	algebraic expression to parse  (Device names in
			an expression should have the following form:
			"x:xxxxxx[n]" where "n" represents an array index.
			If the array index is zero, the bracketed term can
			be omitted.  If an underscore (_) character is
			entered in place of the colon, the device's setting
			will be used in the calculation rather than the
			reading.  If a pipe (|) character is entered in
			place of the colon, the device's basic status will
			be used.) (Constants can be normal floating point
			values, hex values (0xnnnn), octal values (0onnnn),
			or binary values (0bnnnn).) (The following instrinsic
			functions are also supported: "log" (base 10 log),
			"ln" (natural log), "sqrt" (square root), "sin" (sine),
			"cos" (cosine), "tan" (tangent), "round" (round),
			"trunc" (truncate), "prec"
			(precision eg. prec(value,fraction_digits)),
			"fract" (fraction), "abs" (absolute value),
			"exp" (e^n), "asin" (arc sine), "acos" (arc cosine),
			"atan" (arc tangent), "sinh" (hyperbolic sine),
			"cosh" (hyperbolic cosine),
			"tanh" (hyperbolic tangent), "or" (bitwise or),
			"and" (bitwise and), "xor" (exclusive or),
			"lor" (logical or), "land" (logical and),
			"lshft" (circular left shift), and
			"rshft" (circular right shift), "bit" (bit test),
			"min" (minimum), "max" (maximum).)
	text_length	total length of expression text  (If a value of zero
			is passed for this argument, the expression text will
			be treated as a single null terminated string.)
	subst_devices	array of substitute device names which replace
			device names in the expression having the form
			"G:DEVnnn" or "G_DEVnnn"
			(dio_get_terse_name_length characters per entry)
			(If the option EXPR_OPT_SUBST_ARRAY_DEVICES is
			 selected, there should be C_STYLE_DEVICE_NAME_LEN
			 characters per entry.)
			(A value of NULL can be passed for this argument
			 if no substitute device names are needed.)
	num_devices	number of substitute devices
	default_ftd	default reading FTD for any devices in the expression
	options		execution options
			(EXPR_OPT_NONE -> no options selected, parse and
					  evaluate the expression,
			 EXPR_OPT_PARSE_ONLY -> parse, but do not evalute
						the expression,
			 EXPR_OPT_NO_STALE -> ignore stale data errors,
			 EXPR_OPT_SUBST_ARRAY_DEVICES -> substitute device
							 names can include
							 array indices
							 (C_STYLE_DEVICE_NAME_LEN
							 characters per entry))
	expr_stack	returned expression stack which can be evaluated
			by a call to expression_evaluate_c  (The memory
			for this data is allocated by this function and
			should be freed by the caller by calling
			expression_free_c when it is no longer needed.)
			(A value of NULL can be passed for this argument
			 if this information is not needed.)
	value		returned value of the expression  (This argument
			is only used if "options" does not have the value
			of EXPR_OPT_PARSE_ONLY.)
			(A value of NULL can be passed for this argument
			 if this value is not needed.)
	units_text	returned device units text
			(LEN_DEV_UNITS characters)
			(A value of NULL can be passed for this argument
			 if units text is not needed.)
	error_string	returned error string (Allow at least 133 characters.)
			(A value of NULL can be passed for this argument
			 if this information is not needed.)

	This function returns ACNET status values as follows:

	OK			success
	CLIB_MEMFAIL		failed in allocating dynamic memory
	CLIB_SYNTAX		syntax error
	CLIB_INVSIZ		command line too long
	otherwise		other ACNET format error code

	This function requires the following include files:

	cbslib_h, acnet_errors_h

	Related functions:

	expression_evaluate_c, expression_parse_double_c,
	expression_evaluate_double_c, expression_free_c,
	expression_cancel_requests_c, expression_info_c,
	dio_get_terse_name_length

	C/C++ usage:

	static const char	expression_text[] = "2 * M:OUTTMP + 3.5";
	char	units_text[LEN_DEV_UNITS];
	char	*subst_devices = (char *) NULL;
	char	error_string[133];
	short	default_ftd = FTD_ONESHOT;
	int	status;
	int	text_length = 0;
	int	num_devices = 0;
	unsigned int	options = EXPR_OPT_PARSE_ONLY;
	float	value;
	void	*expr_stack;

	status = expression_parse_c(expression_text,text_length,
				    subst_devices,num_devices,default_ftd,
				    options,&expr_stack,&value,units_text,
				    error_string);

	status = expression_evaluate_c(expr_stack,EXPR_OPT_NONE,&value,
				       units_text,error_string);

	status = expression_free_c(&expr_stack,options,error_string);