Rev 8136 | Rev 8185 | 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 | |||
20 | /* #include "../../Lib/libwims.h" */ |
||
8177 | bpr | 21 | |
22 | #include <regex.h> |
||
10 | reyssat | 23 | #include "../../wims.h" |
24 | |||
25 | /* maximal number of object lines */ |
||
26 | #define MAX_OBJLINES 2048 |
||
27 | /* maximal number of cuts */ |
||
28 | #define MAX_COMMAS 1024 |
||
29 | /* maximal number of regex strings */ |
||
30 | #define MAX_REGEX 16 |
||
31 | |||
32 | |||
8136 | bpr | 33 | enum{ |
34 | exp_number, exp_variable, |
||
35 | exp_paren, exp_matrix, exp_set, exp_fn, |
||
36 | exp_exp, exp_muldiv, exp_cupcap, exp_add, |
||
37 | exp_eq, exp_ineq, exp_not, exp_and, exp_or, exp_imply, |
||
38 | exp_comma, exp_quantifier |
||
39 | }; |
||
40 | |||
41 | extern char *typenames[]; |
||
42 | |||
43 | typedef struct op { |
||
44 | char *name; |
||
45 | int lvl; |
||
46 | } op; |
||
47 | |||
48 | typedef struct ex { |
||
49 | char *name; |
||
50 | int lvl1, lvl2; |
||
51 | } ex; |
||
52 | |||
53 | extern op oppunct[]; |
||
54 | extern op opalpha[]; |
||
55 | extern ex exptype[]; |
||
56 | extern int oppunctno, opalphano, exptypeno; |
||
57 | |||
58 | typedef struct regex{ |
||
59 | char *srcreg; |
||
60 | regex_t cmpreg; |
||
61 | int isvar; |
||
62 | } regex; |
||
63 | extern regex regexchk[]; |
||
64 | |||
65 | int checkregex(char *p); |
||
66 | void error(char *msg); |
||
67 | void getregex(char *p); |
||
68 | |||
69 | extern int regexcnt; |
||
70 | int _type(char *p, int commas[], int *commacnt); |
||
71 | |||
72 | int objlinecnt, thisobjline, thislinelen; |
||
73 | int expl1, expl2; |
||
74 | char *reqtype; |
||
75 | int logdir, linelogdir; |
||
76 | char *objline[MAX_OBJLINES]; |
||
77 | |||
78 | int nocomma; |
||
79 | void req_cut(void); |
||
80 | void req_extract(void); |
||
81 | void req_not(void); |
||
82 | void req_type(void); |