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 / CASEITEM.H < prev    next >
C/C++ Source or Header  |  1994-07-25  |  3KB  |  108 lines

  1. #ifndef CASEITEM_H
  2. #define CASEITEM_H
  3.  
  4. /* $Id: caseitem.h,v 1.2 1993/10/15 18:48:24 libes Exp $ */
  5.  
  6. /************************************************************************
  7. ** Module:    Case_Item
  8. ** Description:    This module implements the Case_Item abstraction.  A
  9. **    case item represents a single branch in a case statement; it
  10. **    thus consists of a list of labels and a statement to execute
  11. **    when one of the labels matches the selector.
  12. ** Constants:
  13. **    CASE_ITEM_NULL    - the null item
  14. **
  15. ************************************************************************/
  16.  
  17. /*
  18.  * This software was developed by U.S. Government employees as part of
  19.  * their official duties and is not subject to copyright.
  20.  *
  21.  * $Log: caseitem.h,v $
  22.  * Revision 1.2  1993/10/15  18:48:24  libes
  23.  * CADDETC certified
  24.  *
  25.  * Revision 1.4  1992/08/18  17:12:41  libes
  26.  * rm'd extraneous error messages
  27.  *
  28.  * Revision 1.3  1992/06/08  18:06:24  libes
  29.  * prettied up interface to print_objects_when_running
  30.  * 
  31.  */
  32.  
  33. /*************/
  34. /* constants */
  35. /*************/
  36.  
  37. #define CASE_ITEM_NULL        (struct Case_Item *)0
  38.  
  39. /*****************/
  40. /* packages used */
  41. /*****************/
  42.  
  43. #include "expbasic.h"    /* get basic definitions */
  44. #include "scope.h"
  45. #include "memory.h"
  46.  
  47. /************/
  48. /* typedefs */
  49. /************/
  50.  
  51. typedef struct Case_Item *Case_Item;
  52.  
  53. /****************/
  54. /* modules used */
  55. /****************/
  56.  
  57. #include "stmt.h"
  58.  
  59. /***************************/
  60. /* hidden type definitions */
  61. /***************************/
  62.  
  63. struct Case_Item {
  64.     Symbol symbol;
  65.     Linked_List labels;
  66.     struct Statement *action;
  67. };
  68.  
  69. /********************/
  70. /* global variables */
  71. /********************/
  72.  
  73. #ifdef CASEITEM_C
  74. #include "defstart.h"
  75. #else
  76. #include "decstart.h"
  77. #endif /*CASE_ITEM_C*/
  78.  
  79. GLOBAL struct freelist_head CASE_IT_fl;
  80.  
  81. #include "de_end.h"
  82.  
  83. /******************************/
  84. /* macro function definitions */
  85. /******************************/
  86.  
  87. #define CASE_ITget_labels(ci)        ((ci)->labels)
  88. #define CASE_ITget_statement(ci)    ((ci)->action)
  89.  
  90. /***********************/
  91. /* function prototypes */
  92. /***********************/
  93.  
  94. #define CASE_IT_new()        (struct Case_Item *)MEM_new(&CASE_IT_fl)
  95. #define CASE_IT_destroy(x)    MEM_destroy(&CASE_IT_fl,(Freelist *)(Generic)x)
  96.  
  97. extern Case_Item     CASE_ITcreate PROTO((Linked_List, struct Statement *));
  98. extern void        CASE_ITinitialize PROTO((void));
  99.  
  100. /********************/
  101. /* inline functions */
  102. /********************/
  103.  
  104. #if supports_inline_functions || defined(CASEITEM_C)
  105. #endif /* supports_inline_functions || defined(CASE_ITEM_C) */
  106.  
  107. #endif /*CASE_ITEM_H*/
  108.