Rev 10 | 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 | |||
8136 | bpr | 18 | #include "mathexp.h" |
10 | reyssat | 19 | |
20 | char *typenames[]={ |
||
21 | "number", "variable", |
||
22 | "parentheses","matrix","set","function", |
||
23 | "exponentiation","term","cupcap","addition", |
||
24 | "equation","inequality","not","and","or","implication", |
||
25 | "comma","quantifier" |
||
26 | }; |
||
27 | |||
8136 | bpr | 28 | op oppunct[]={ |
10 | reyssat | 29 | {"(", exp_paren}, |
30 | {"[", exp_matrix}, |
||
31 | {"{", exp_set}, |
||
32 | {"^", exp_exp}, |
||
33 | {"**", exp_exp}, |
||
34 | {"*", exp_muldiv}, |
||
35 | {"/", exp_muldiv}, |
||
36 | {"-", exp_add}, |
||
37 | {"+", exp_add}, |
||
38 | {"!=", exp_eq}, |
||
39 | {"<>", exp_eq}, |
||
40 | {"<==>", exp_imply}, |
||
41 | {"<==", exp_imply}, |
||
42 | {"<=>", exp_imply}, |
||
43 | {"=>", exp_imply}, |
||
44 | {"==>", exp_imply}, |
||
45 | {"<=", exp_ineq}, |
||
46 | {">=", exp_ineq}, |
||
47 | {"<", exp_ineq}, |
||
48 | {">", exp_ineq}, |
||
49 | {"==", exp_eq}, |
||
50 | {"=", exp_eq}, |
||
51 | {",", exp_comma}, |
||
52 | {";", exp_comma}, |
||
53 | }; |
||
8136 | bpr | 54 | int oppunctno=(sizeof(oppunct)/sizeof(oppunct[0])); |
10 | reyssat | 55 | |
8136 | bpr | 56 | op opalpha[]={ |
10 | reyssat | 57 | {"cup", exp_cupcap}, |
58 | {"cap", exp_cupcap}, |
||
59 | {"and", exp_and}, |
||
60 | {"or", exp_or}, |
||
61 | {"not", exp_not}, |
||
62 | {"in", exp_quantifier}, |
||
63 | {"forall", exp_quantifier}, |
||
64 | {"exist", exp_quantifier}, |
||
65 | {"exists", exp_quantifier}, |
||
66 | }; |
||
8136 | bpr | 67 | int opalphano=(sizeof(opalpha)/sizeof(opalpha[0])); |
10 | reyssat | 68 | |
8136 | bpr | 69 | ex exptype[]={ |
10 | reyssat | 70 | {"addition", exp_add, exp_add}, |
71 | {"algexp", 0, exp_add}, |
||
72 | {"and", exp_and, exp_and}, |
||
73 | {"andor", exp_and, exp_or}, |
||
74 | {"equation", exp_eq, exp_eq}, |
||
75 | {"equations", exp_eq, exp_eq}, |
||
76 | {"function", exp_fn, exp_fn}, |
||
77 | {"functions", exp_fn, exp_fn}, |
||
78 | {"inequalities",exp_ineq, exp_ineq}, |
||
79 | {"inequality", exp_ineq, exp_ineq}, |
||
80 | {"inequation", exp_eq, exp_ineq}, |
||
81 | {"inequations", exp_eq, exp_ineq}, |
||
82 | {"logic", exp_not, exp_or}, |
||
83 | {"matrix", exp_matrix, exp_matrix}, |
||
84 | {"mult", exp_muldiv, exp_muldiv}, |
||
85 | {"multiplication", exp_muldiv, exp_muldiv}, |
||
86 | {"or", exp_or, exp_or}, |
||
87 | {"parentheses", exp_paren, exp_paren}, |
||
88 | {"parenthesis", exp_paren, exp_paren}, |
||
89 | {"predicate", exp_eq, exp_quantifier}, |
||
90 | {"set", exp_set, exp_set}, |
||
91 | {"term", 0, exp_muldiv}, |
||
92 | {"variable", exp_variable, exp_variable}, |
||
93 | {"variables", exp_variable, exp_variable}, |
||
94 | }; |
||
95 | |||
8136 | bpr | 96 | int exptypeno=(sizeof(exptype)/sizeof(exptype[0])); |
97 |