-
Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy pathcaseitem.h
More file actions
92 lines (72 loc) · 2.28 KB
/
caseitem.h
File metadata and controls
92 lines (72 loc) · 2.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#ifndef CASE_ITEM_H
#define CASE_ITEM_H
/** **********************************************************************
** Module: Case_Item \file caseitem.h
** Description: This module implements the Case_Item abstraction. A
** case item represents a single branch in a case statement; it
** thus consists of a list of labels and a statement to execute
** when one of the labels matches the selector.
** Constants:
** CASE_ITEM_NULL - the null item
**
************************************************************************/
/*
* This software was developed by U.S. Government employees as part of
* their official duties and is not subject to copyright.
*
* $Log: caseitem.h,v $
* Revision 1.3 1997/01/21 19:17:11 dar
* made C++ compatible
*
* Revision 1.2 1993/10/15 18:48:24 libes
* CADDETC certified
*
* Revision 1.4 1992/08/18 17:12:41 libes
* rm'd extraneous error messages
*
* Revision 1.3 1992/06/08 18:06:24 libes
* prettied up interface to print_objects_when_running
*
*/
/*************/
/* constants */
/*************/
#define CASE_ITEM_NULL (struct Case_Item_ *)0
/*****************/
/* packages used */
/*****************/
#include "expbasic.h" /* get basic definitions */
#include "scope.h"
/************/
/* typedefs */
/************/
typedef struct Case_Item_ * Case_Item;
/****************/
/* modules used */
/****************/
#include "stmt.h"
/***************************/
/* hidden type definitions */
/***************************/
struct Case_Item_ {
Symbol symbol;
Linked_List labels;
struct Statement_ * action;
};
/********************/
/* global variables */
/********************/
extern SC_EXPRESS_EXPORT struct freelist_head CASE_IT_fl;
/******************************/
/* macro function definitions */
/******************************/
#define CASE_ITget_labels(ci) ((ci)->labels)
#define CASE_ITget_statement(ci) ((ci)->action)
/***********************/
/* function prototypes */
/***********************/
#define CASE_IT_new() (struct Case_Item_ *)ALLOC_new(&CASE_IT_fl)
#define CASE_IT_destroy(x) ALLOC_destroy(&CASE_IT_fl,(Freelist *)x)
extern SC_EXPRESS_EXPORT Case_Item CASE_ITcreate( Linked_List, struct Statement_ * );
extern SC_EXPRESS_EXPORT void CASE_ITinitialize( void );
#endif /*CASE_ITEM_H*/