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.C < prev    next >
C/C++ Source or Header  |  1994-07-23  |  2KB  |  66 lines

  1. static char rcsid[] = "$Id: caseitem.c,v 1.2 1993/10/15 18:48:48 libes Exp $";
  2.  
  3. /************************************************************************
  4. ** Module:    Case_Item
  5. ** Description:    This module implements the Case_Item abstraction.  A
  6. **    case item represents a single branch in a case statement; it
  7. **    thus consists of a list of labels and a statement to execute
  8. **    when one of the labels matches the selector.
  9. ** Constants:
  10. **    CASE_ITEM_NULL    - the null item
  11. **
  12. ************************************************************************/
  13.  
  14. /*
  15.  * This code was developed with the support of the United States Government,
  16.  * and is not subject to copyright.
  17.  *
  18.  * $Log: caseitem.c,v $
  19.  * Revision 1.2  1993/10/15  18:48:48  libes
  20.  * CADDETC certified
  21.  *
  22.  * Revision 1.3  1992/08/18  17:13:43  libes
  23.  * rm'd extraneous error messages
  24.  *
  25.  * Revision 1.2  1992/06/08  18:06:57  libes
  26.  * prettied up interface to print_objects_when_running
  27.  */
  28.  
  29. #define CASEITEM_C
  30. #include "caseitem.h"
  31.  
  32. /*
  33. ** Procedure:    CASE_ITinitialize
  34. ** Parameters:    -- none --
  35. ** Returns:    void
  36. ** Description:    Initialize the Case Item module.
  37. */
  38.  
  39. void
  40. CASE_ITinitialize(void)
  41. {
  42.     MEMinitialize(&CASE_IT_fl,sizeof(struct Case_Item),500,100);
  43. }
  44.  
  45. /*
  46. ** Procedure:    CASE_ITcreate
  47. ** Parameters:    Linked_List labels    - list of Expressions for case labels
  48. **        Statement   statement    - statement associated with this branch
  49. **        Error*      errc    - buffer for error code
  50. ** Returns:    Case_Item        - the case item created
  51. ** Description:    Create and return a new case item.
  52. **
  53. ** Notes:    If the 'labels' parameter is LIST_NULL, a case item
  54. **        matching in the default case is created.
  55. */
  56.  
  57. Case_Item
  58. CASE_ITcreate(Linked_List labels, Statement statement)
  59. {
  60.     struct Case_Item *s = CASE_IT_new();
  61.  
  62.     s->labels = labels;
  63.     s->action = statement;
  64.     return(s);
  65. }
  66.