home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Encyclopedia of Graphics File Formats Companion
/
GFF_CD.ISO
/
formats
/
ttddd
/
spec
/
t3d_doc
/
igensurf.zoo
/
src
/
calcomp.h
< prev
next >
Wrap
C/C++ Source or Header
|
1991-09-28
|
2KB
|
74 lines
/* :ts=8 */
/* Copyright (c) 1986 Regents of the University of California */
#ifndef _CALCOMP_H
/* SCCSid "@(#)calcomp.h 1.5 4/23/91 LBL" */
/*
* calcomp.h - header file for expression parser.
*
*/
/* Expression_T types */
#define ET_Variable 1
#define ET_Number 2
#define ET_UMinus 3
#define ET_Chan 4
#define ET_Function 5
#define ET_Argument 6
#define ET_Timestamp 7
#define ET_Symbol 8
/* also: '+', '-', '*', '/', '^', '=', ':' */
typedef struct {
char *Function_Name; /* function name */
short Number_Args; /* # of required arguments */
short Assignment_Type; /* assignment type (':' or '=') */
double (*Func_Ptr)(); /* pointer to function */
} Function_T; /* a library function */
struct Expression_Tag; /* Forward declaration */
typedef struct Variable_Tag {
char *Name; /* variable name */
int Number_Links; /* number of references */
struct Expression_Tag *Expression; /* definition */
Function_T *Function; /* library definition */
struct Variable_Tag *Next; /* next in hash list */
} Variable_T; /* A variable definition */
typedef struct Expression_Tag {
int Node_Type; /* node type */
struct Expression_Tag *Sibling; /* next child this level*/
union {
struct Expression_Tag *Kid; /* first child */
double Number; /* number */
char *Name; /* symbol name */
int Channel; /* channel number */
long Timestamp; /* timestamp */
Variable_T *Variable; /* link */
} Value; /* value */
} Expression_T; /* an expression node */
extern double String_Eval(), Var_Value(), Func_Value();
extern double Get_Argument(), GetFloat();
extern double (*Expr_Funcs[])();
extern int GetInteger();
extern char *Get_Name(), *Get_Func_Arg_Name();
extern Expression_T *Expr_Parse(), *Expr_Kid(), *Expr_Lookup();
extern Expression_T *Expr_Pop(), *Expr_First(), *Expr_Next();
extern Expression_T *Expr_Get();
extern Expression_T *Get_E1(), *Get_E2(), *Get_E3();
extern Expression_T *Get_E4(), *Get_E5(), *Const_Reduce();
extern Variable_T *Var_Insert(), *Var_Lookup(), *Get_Func_Arg();
extern Function_T *LibFunc_Lookup();
extern long eclock;
extern int Next_Char;
extern int errno;
extern void Expr_Free(), Init_File(), Init_Str();
extern void Get_Next_Char(), Syntax_Error();
#define Expr_Value(ep) (*Expr_Funcs[(ep)->Node_Type])(ep)
#endif