Rev 8177 | Rev 14873 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
10 | reyssat | 1 | /* Copyright (C) 2002-2003 XIAO, Gang of Universite de Nice - Sophia Antipolis |
2 | * |
||
3 | * This program is free software; you can redistribute it and/or modify |
||
4 | * it under the terms of the GNU General Public License as published by |
||
5 | * the Free Software Foundation; either version 2 of the License, or |
||
6 | * (at your option) any later version. |
||
7 | * |
||
8 | * This program is distributed in the hope that it will be useful, |
||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
11 | * GNU General Public License for more details. |
||
12 | * |
||
13 | * You should have received a copy of the GNU General Public License |
||
14 | * along with this program; if not, write to the Free Software |
||
15 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
||
16 | */ |
||
17 | |||
18 | /* Mathematical expression manipulations for WIMS, header declarations */ |
||
19 | |||
8177 | bpr | 20 | |
21 | #include <regex.h> |
||
8185 | bpr | 22 | #include "../../Lib/libwims.h" |
10 | reyssat | 23 | |
24 | /* maximal number of object lines */ |
||
25 | #define MAX_OBJLINES 2048 |
||
26 | /* maximal number of cuts */ |
||
27 | #define MAX_COMMAS 1024 |
||
28 | /* maximal number of regex strings */ |
||
29 | #define MAX_REGEX 16 |
||
30 | |||
31 | |||
8136 | bpr | 32 | enum{ |
33 | exp_number, exp_variable, |
||
34 | exp_paren, exp_matrix, exp_set, exp_fn, |
||
35 | exp_exp, exp_muldiv, exp_cupcap, exp_add, |
||
36 | exp_eq, exp_ineq, exp_not, exp_and, exp_or, exp_imply, |
||
37 | exp_comma, exp_quantifier |
||
38 | }; |
||
39 | |||
40 | extern char *typenames[]; |
||
41 | |||
42 | typedef struct op { |
||
43 | char *name; |
||
44 | int lvl; |
||
45 | } op; |
||
46 | |||
47 | typedef struct ex { |
||
48 | char *name; |
||
49 | int lvl1, lvl2; |
||
50 | } ex; |
||
51 | |||
52 | extern op oppunct[]; |
||
53 | extern op opalpha[]; |
||
54 | extern ex exptype[]; |
||
55 | extern int oppunctno, opalphano, exptypeno; |
||
56 | |||
57 | typedef struct regex{ |
||
58 | char *srcreg; |
||
59 | regex_t cmpreg; |
||
60 | int isvar; |
||
61 | } regex; |
||
62 | extern regex regexchk[]; |
||
63 | |||
64 | int checkregex(char *p); |
||
65 | void error(char *msg); |
||
66 | void getregex(char *p); |
||
67 | |||
68 | extern int regexcnt; |
||
69 | int _type(char *p, int commas[], int *commacnt); |
||
70 | |||
71 | int objlinecnt, thisobjline, thislinelen; |
||
72 | int expl1, expl2; |
||
73 | char *reqtype; |
||
74 | int logdir, linelogdir; |
||
75 | char *objline[MAX_OBJLINES]; |
||
76 | |||
77 | int nocomma; |
||
78 | void req_cut(void); |
||
79 | void req_extract(void); |
||
80 | void req_not(void); |
||
81 | void req_type(void); |