-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparser.h
More file actions
41 lines (35 loc) · 702 Bytes
/
parser.h
File metadata and controls
41 lines (35 loc) · 702 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <math.h>
#define M_E 2.71828182845904523536
#define M_PI 3.14159265358979323846
typedef enum {
MEMORY_ERROR = 1,
UNKNOWN_VARIABLE,
UNKNOWN_FUNCTION,
ILLEGAL_LOG_ARG,
ILLEGAL_TG_ARG,
ILLEGAL_CTG_ARG,
ILLEGAL_ASIN_ARG,
ILLEGAL_ACOS_ARG,
ILLEGAL_SQRT_ARG,
ILLEGAL_NUMBER,
ILLEGAL_EXP_ARG,
NO_CLOSING_BRACKET,
DIVISION_BY_ZERO,
CANNOT_PARSE
} ERROR;
static int pos = -1;
static char pch;
static char ch;
static char nch;
static char n2ch;
char* substring(char*, int, int);
void nextChar();
int parse(char *, double *);
int internalParse();
int parseExpression();
int parseTerm();
int parseFactor();