home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / ip / manage / condor / Condor_4.1.3b / src / h / expr.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-06-17  |  2.5 KB  |  94 lines

  1. /* 
  2. ** Copyright 1986, 1987, 1988, 1989, 1990, 1991 by the Condor Design Team
  3. ** 
  4. ** Permission to use, copy, modify, and distribute this software and its
  5. ** documentation for any purpose and without fee is hereby granted,
  6. ** provided that the above copyright notice appear in all copies and that
  7. ** both that copyright notice and this permission notice appear in
  8. ** supporting documentation, and that the names of the University of
  9. ** Wisconsin and the Condor Design Team not be used in advertising or
  10. ** publicity pertaining to distribution of the software without specific,
  11. ** written prior permission.  The University of Wisconsin and the Condor
  12. ** Design Team make no representations about the suitability of this
  13. ** software for any purpose.  It is provided "as is" without express
  14. ** or implied warranty.
  15. ** 
  16. ** THE UNIVERSITY OF WISCONSIN AND THE CONDOR DESIGN TEAM DISCLAIM ALL
  17. ** WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
  18. ** OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE UNIVERSITY OF
  19. ** WISCONSIN OR THE CONDOR DESIGN TEAM BE LIABLE FOR ANY SPECIAL, INDIRECT
  20. ** OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
  21. ** OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  22. ** OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
  23. ** OR PERFORMANCE OF THIS SOFTWARE.
  24. ** 
  25. ** Authors:  Allan Bricker and Michael J. Litzkow,
  26. **              University of Wisconsin, Computer Sciences Dept.
  27. ** 
  28. */ 
  29.  
  30.  
  31.     /* Element types */
  32. #define LT        1
  33. #define LE        2
  34. #define GT        3
  35. #define GE        4
  36. #define EQ        5
  37. #define NE        6
  38. #define AND        7
  39. #define OR        8
  40. #define NOT        9
  41. #define PLUS    10
  42. #define MINUS    11
  43. #define MUL        12
  44. #define DIV        13
  45. #define GETS    14
  46. #define LPAREN    15
  47. #define RPAREN    16
  48. #define NAME    17
  49. #define STRING    18
  50. #define FLOAT    19
  51. #define INT        20
  52. #define BOOL    21
  53. #define ERROR    22
  54.  
  55. #define ENDMARKER    -1
  56.  
  57. #define MAX_EXPR_LIST        512        /* Max elements in an expression */
  58. #define MAX_STRING            1024    /* Max lenght of a name or string */
  59.  
  60. #define f_val val.float_val
  61. #define i_val val.integer_val
  62. #define s_val val.string_val
  63. #define b_val val.integer_val
  64.  
  65. typedef struct {
  66.     int        type;
  67.     union {
  68.         int        integer_val;    /* Integer value */
  69.         float    float_val;        /* Floating point value */
  70.         char    *string_val;    /* String value */
  71.     } val;
  72. } ELEM;
  73.  
  74. typedef struct {
  75.     int        len;
  76.     int        max_len;
  77.     ELEM    **data;
  78. } EXPR;
  79. #define EXPR_INCR 25
  80.  
  81. typedef struct {
  82.     int        top;
  83.     ELEM    *data[MAX_EXPR_LIST];
  84. } STACK;
  85.  
  86. typedef struct {
  87.     int        len;
  88.     int        max_len;
  89.     EXPR    **data;
  90. } CONTEXT;
  91.  
  92. #define IN_STACK    1
  93. #define IN_COMING    2
  94.