Subversion Repositories wimsdev

Rev

Rev 14873 | Blame | Compare with Previous | Last modification | View Log | RSS feed

  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.  
  21. #include <regex.h>
  22. #include "../../Lib/libwims.h"
  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.  
  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. extern int objlinecnt;
  72. extern int thisobjline;
  73. extern int thislinelen;
  74. extern int expl1;
  75. extern int expl2;
  76.  
  77. extern char *reqtype;
  78. extern int logdir;
  79. extern int linelogdir;
  80. extern char *objline[MAX_OBJLINES];
  81.  
  82. extern int nocomma;
  83. void req_cut(void);
  84. void req_extract(void);
  85. void req_not(void);
  86. void req_type(void);
  87.