00001
00002
00003 #ifndef PARSER_H
00004 #define PARSER_H
00005
00006 #include <ctype.h>
00007 #include <stdio.h>
00008 #include <stdlib.h>
00009 #include <string.h>
00010 #include <math.h>
00011
00012 #ifdef HAVE_SOLARIS
00013 #include <strings.h>
00014 #endif
00015
00016 #ifdef HAVE_GSL
00017 #include <gsl/gsl_math.h>
00018 #include <gsl/gsl_sf.h>
00019 #include <gsl/gsl_randist.h>
00020 #include <gsl/gsl_const_num.h>
00021 #ifdef HAVE_GSL14
00022 #include <gsl/gsl_const_mksa.h>
00023 #include <gsl/gsl_const_cgsm.h>
00024 #else
00025 #include <gsl/gsl_const_mks.h>
00026 #include <gsl/gsl_const_cgs.h>
00027 #endif
00028 #endif
00029
00030 #include "../cephes/cephes.h"
00031 #include "constants.h"
00032 #include "functions.h"
00033 #include "parser_struct.h"
00034
00035
00036 #ifdef HAVE_SOLARIS
00037 typedef double (*func_t) (double);
00038 #else
00039 typedef double (*func_t) ();
00040 #endif
00041
00042
00043 struct symrec {
00044 char *name;
00045 int type;
00046 union {
00047 double var;
00048 int intvar;
00049 func_t fnctptr;
00050 } value;
00051 struct symrec *next;
00052 };
00053
00054 typedef struct symrec symrec;
00055
00056 double parse(char *str);
00057 int parse_errors();
00058 symrec *putsym (const char *, int);
00059 symrec *getsym (const char *);
00060 void init_table(void);
00061 int yyerror (const char*);
00062 int yylex (void);
00063
00064 #define PARSE_STRING_SIZE 500
00065 double res;
00066 int pos;
00067 char string[PARSE_STRING_SIZE];
00068
00069
00070 #endif