Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

parser.h

Go to the documentation of this file.
00001 /*LabPlot : parser.h*/
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 /* Functions type.                                   */
00036 #ifdef HAVE_SOLARIS 
00037 typedef double (*func_t) (double);
00038 #else
00039 typedef double (*func_t) ();
00040 #endif
00041 
00042 /* Data type for links in the chain of symbols.      */
00043 struct symrec {
00044         char *name;  /* name of symbol                     */
00045         int type;    /* type of symbol: either VAR or FNCT */
00046         union {
00047                 double var;                  /* value of a VAR   */
00048                 int intvar;
00049                 func_t fnctptr;              /* value of a FNCT  */
00050         } value;
00051         struct symrec *next;    /* link field              */
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 /*PARSER_H*/

Generated on Sat Oct 13 21:55:01 2007 for LabPlot by  doxygen 1.4.4