home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / c / condor40.zip / CONDOR / src / h / expr.h < prev    next >
Text File  |  1989-05-15  |  2KB  |  92 lines

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