Subversion Repositories wimsdev

Rev

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
 
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
 
14873 georgesk 71
/**
72
 * GK 2020-04-18
73
 * bare variables must not be declared in header files
74
 * they are commented out and an extern clause is used instead
8136 bpr 75
int objlinecnt, thisobjline, thislinelen;
76
int expl1, expl2;
77
char *reqtype;
78
int logdir, linelogdir;
79
char *objline[MAX_OBJLINES];
14873 georgesk 80
int nocomma;
81
 **/
82
extern int objlinecnt;
83
extern int thisobjline;
84
extern int thislinelen;
85
extern int expl1;
86
extern int expl2;
8136 bpr 87
 
14873 georgesk 88
extern char *reqtype;
89
extern int logdir;
90
extern int linelogdir;
91
extern char *objline[MAX_OBJLINES];
92
 
93
extern int nocomma;
8136 bpr 94
void req_cut(void);
95
void req_extract(void);
96
void req_not(void);
97
void req_type(void);