/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1982-2012 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* David Korn <dgk@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
#ifndef SEQPOINT
/*
* D. G. Korn
*
* arithmetic expression evaluator
*/
/* The following only is needed for const */
#include <ast.h>
#include <math.h>
#include "defs.h"
#if _AST_VERSION >= 20030127L
# include <ast_float.h>
#endif
#endif
#ifndef LDBL_LLONG_MAX
# ifdef LLONG_MAX
# else
# ifdef LLONG_MAX
# else
# endif
# endif
#endif
#ifndef LDBL_ULLONG_MAX
# ifdef ULLONG_MAX
# else
# endif
#endif
#ifndef LDBL_LLONG_MIN
# ifdef LLONG_MIN
# else
# endif
#endif
#ifndef LDBL_DIG
#endif
struct lval
{
char *value;
char *ovalue;
const char *expr;
const void *ptr;
int nosub;
short flag;
short nargs;
short emode;
short level;
short elen;
char eflag;
char isfloat;
};
struct mathtab
{
};
typedef struct _arith_
{
unsigned char *code;
const char *expr;
short size;
short staksize;
short emode;
short elen;
} Arith_t;
/* define error messages */
extern const unsigned char strval_precedence[35];
extern const char strval_states[64];
extern const char e_moretokens[];
extern const char e_argcount[];
extern const char e_paren[];
extern const char e_badnum[];
extern const char e_badcolon[];
extern const char e_recursive[];
extern const char e_divzero[];
extern const char e_synbad[];
extern const char e_notlvalue[];
extern const char e_function[];
extern const char e_questcolon[];
extern const char e_incompatible[];
extern const char e_domain[];
extern const char e_overflow[];
extern const char e_singularity[];
extern const char e_dict[];
extern const char e_charconst[];
extern const struct mathtab shtab_math[];
/* function code for the convert function */
#define LOOKUP 0
extern Sfdouble_t strval(Shell_t*,const char*,char**,Sfdouble_t(*)(const char**,struct lval*,int,Sfdouble_t),int);
extern Arith_t *arith_compile(Shell_t *,const char*,char**,Sfdouble_t(*)(const char**,struct lval*,int,Sfdouble_t),int);
#endif /* !SEQPOINT */