home *** CD-ROM | disk | FTP | other *** search
/ ftptest.leeds.ac.uk / 2015.02.ftptest.leeds.ac.uk.tar / ftptest.leeds.ac.uk / bionet / CAE-GROUP / SCL-WIN3x / FED_PLUS.EXE / EXPBASIC.H < prev    next >
C/C++ Source or Header  |  1994-07-23  |  5KB  |  149 lines

  1. /* $Id: expbasic.h,v 1.3 1994/05/11 19:51:05 libes Exp $ */
  2.  
  3. /*
  4.  * This software was developed by U.S. Government employees as part of
  5.  * their official duties and is not subject to copyright.
  6.  *
  7.  * $Log: expbasic.h,v $
  8.  * Revision 1.3  1994/05/11  19:51:05  libes
  9.  * numerous fixes
  10.  *
  11.  * Revision 1.2  1993/10/15  18:48:24  libes
  12.  * CADDETC certified
  13.  *
  14.  * Revision 1.6  1993/01/19  22:44:17  libes
  15.  * *** empty log message ***
  16.  *
  17.  * Revision 1.5  1992/08/18  17:12:41  libes
  18.  * rm'd extraneous error messages
  19.  *
  20.  * Revision 1.4  1992/06/08  18:06:24  libes
  21.  * prettied up interface to print_objects_when_running
  22.  */
  23.  
  24. #ifndef EXPBASIC_H
  25. #define EXPBASIC_H
  26.  
  27. #include "basic.h"    /* get basic definitions */
  28.  
  29. /************/
  30. /* typedefs */
  31. /************/
  32.  
  33. typedef int Integer;
  34. typedef double Real;
  35. typedef enum { Lfalse, Lunknown, Ltrue } Logical;
  36. /* typedef ... Binary; done below because String not defined yet */
  37.  
  38. #ifndef _CLIENTDATA
  39. #   ifdef __STDC__
  40.     typedef void *ClientData;
  41. #   else
  42.     typedef int *ClientData;
  43. #   endif /* __STDC__ */
  44. #define _CLIENTDATA
  45. #endif
  46.  
  47. /****************************/
  48. /* packages used throughout */
  49. /****************************/
  50.  
  51. #include "memory.h"
  52.  
  53. typedef struct Scope *Type;
  54. typedef struct Scope *Scope;
  55. typedef struct Scope *Schema;
  56.  
  57. typedef char * Binary;
  58. #include "linklist.h"
  59.  
  60. #define UNRESOLVED        0x0
  61. #define    RESOLVED        0x1
  62. #define RESOLVE_FAILED        0x2
  63. #define RESOLVE_IN_PROGRESS    0x4    /* only if actively being resolved */
  64.                     /* not if it's just between passes */
  65.  
  66. /* used during rename resolution to catch recursive USE/REFs */
  67. #define is_resolve_in_progress_raw(x)    ((x)->resolved & RESOLVE_IN_PROGRESS)
  68. #define resolve_in_progress_raw(x)    (x)->resolved |= RESOLVE_IN_PROGRESS
  69. #define resolve_not_in_progress_raw(x)    (x)->resolved &= ~RESOLVE_IN_PROGRESS
  70.  
  71. /* and type resolution to catch recursive types (A = B and B = A) */
  72. #define resolve_in_progress(x)        (x)->symbol.resolved |= RESOLVE_IN_PROGRESS
  73.  
  74. /* test/set whether anything has failed resolution */
  75. #define is_resolve_failed(x)        ((x)->symbol.resolved & RESOLVE_FAILED)
  76. #define is_resolve_failed_raw(x)    ((x)->resolved & RESOLVE_FAILED)
  77. #define resolve_failed(x)        (x)->symbol.resolved |= RESOLVE_FAILED
  78. #define resolve_failed_raw(x)        (x)->resolved |= RESOLVE_FAILED
  79.  
  80. /* test/set whether anything has succeeded resolution */
  81. #define is_resolved(x)            ((x)->symbol.resolved & RESOLVED)
  82.  
  83. /* test possibility of future resolution */
  84. #define is_resolvable(x)        (!is_not_resolvable(x))
  85. #define is_not_resolvable(x)        ((x)->symbol.resolved & (RESOLVE_FAILED|RESOLVED|RESOLVE_IN_PROGRESS))
  86.  
  87. /* mark something resolved */
  88. #define resolved_all(x)            x->symbol.resolved = RESOLVED
  89.  
  90.  
  91. /* define the object types that can appear in a symbol table */
  92. /* basically anything that is usefully named, but that cannot be */
  93. /* differentiated from another type when handed a generic pointer */
  94. /* Entity, schema and alg can be differentiated but it is just very */
  95. /* useful to be able to differentiate this way. */
  96. #define OBJ_ANY        '*'    /* Matches anything - special to DICT funcs */
  97. #define OBJ_EXPRESS    '!'    /* I can't figure out the mnemonic either! */
  98.  
  99. /* The following are all odd-ball scopes, that aren't ever looked up by */
  100. /* type - but the data structures might as well be descriptive */
  101. #define OBJ_INCREMENT    '+'
  102. #define OBJ_ALIAS    'a'
  103. #define OBJ_QUERY    'q'    /* isn't even stored anywhere! */
  104.  
  105. #define OBJ_PROCEDURE    'p'
  106. #define OBJ_RENAME    'n'
  107. #define OBJ_RULE    'r'
  108. #define OBJ_FUNCTION    'f'
  109. #define OBJ_TAG        'g'    /* a type, but only when used as a type tag */
  110. #define OBJ_ENTITY    'e'
  111. #define OBJ_SCHEMA    's'
  112. #define OBJ_TYPE    't'
  113. #define OBJ_UNKNOWN    'u'    /*things that won't ever be looked up by type*/
  114. #define OBJ_VARIABLE    'v'
  115. #define OBJ_WHERE    'w'
  116. #define OBJ_EXPRESSION    'x'    /* so far only enums get looked up by name & */
  117. #define OBJ_ENUM    'x'    /* appear this way, perhaps they should be */
  118.                 /* variables? */
  119. #define OBJ_AMBIG_ENUM    'z'    /* enumerations of the same name which are */
  120.                 /* visible in the same scope when qualified */
  121.                 /* z is of no mnemonic significance (so far) */
  122. #define IS_ENUM(x)    (((x) == OBJ_EXPRESSION) || ((x) == OBJ_AMBIG_ENUM))
  123.  
  124. /* these represent a different way of selecting classes of objects */
  125. /* these are particularly useful when looking for multiple types concurrently */
  126. #define OBJ_TYPE_BITS        0x1
  127. #define OBJ_ENTITY_BITS        0x2
  128. #define OBJ_FUNCTION_BITS    0x4
  129. #define OBJ_PROCEDURE_BITS    0x8
  130. #define OBJ_PASS_BITS        0x10        /* i.e., EXPRESSpass */
  131. #define OBJ_RULE_BITS        0x20
  132. #define OBJ_EXPRESSION_BITS    0x40        /* as above, only used for */
  133.                         /* finding enums */
  134. #define OBJ_SCHEMA_BITS        0x80
  135. #define OBJ_VARIABLE_BITS    0x100
  136.  
  137. #define OBJ_ANYTHING_BITS    0x0fffffff
  138. #define OBJ_UNFINDABLE_BITS    0x10000000    /* should never be found */
  139. #define OBJ_ALGORITHM_BITS    (OBJ_FUNCTION_BITS & OBJ_PROCEDURE_BITS & \
  140.                  OBJ_RULE_BITS)
  141. #define OBJ_SCOPE_BITS        (OBJ_ALGORITHM_BITS & OBJ_ENTITY_BITS & \
  142.                  OBJ_SCHEMA_BITS)
  143.  
  144. /* OBJ_UNUSED should die, but until it does, allow it to work */
  145. #define OBJ_UNUSED_BITS        OBJ_UNFINDABLE_BITS
  146.  
  147. #endif /*EXPRESS_BASIC_H*/
  148.  
  149.