Subversion Repositories tendra.SVN

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
6 7u83 1
/*
2
 * Copyright (c) 2002-2006 The TenDRA Project <http://www.tendra.org/>.
3
 * All rights reserved.
4
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions are met:
7
 *
8
 * 1. Redistributions of source code must retain the above copyright notice,
9
 *    this list of conditions and the following disclaimer.
10
 * 2. Redistributions in binary form must reproduce the above copyright notice,
11
 *    this list of conditions and the following disclaimer in the documentation
12
 *    and/or other materials provided with the distribution.
13
 * 3. Neither the name of The TenDRA Project nor the names of its contributors
14
 *    may be used to endorse or promote products derived from this software
15
 *    without specific, prior written permission.
16
 *
17
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
18
 * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
19
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
21
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22
 * EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
24
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
27
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
 *
29
 * $Id$
30
 */
31
/*
32
    		 Crown Copyright (c) 1997
33
 
34
    This TenDRA(r) Computer Program is subject to Copyright
35
    owned by the United Kingdom Secretary of State for Defence
36
    acting through the Defence Evaluation and Research Agency
37
    (DERA).  It is made available to Recipients with a
38
    royalty-free licence for its use, reproduction, transfer
39
    to other parties and amendment for any purpose not excluding
40
    product development provided that any such use et cetera
41
    shall be deemed to be acceptance of the following conditions:-
42
 
43
        (1) Its Recipients shall ensure that this Notice is
44
        reproduced upon any copies or amended versions of it;
45
 
46
        (2) Any amended version of it shall be clearly marked to
47
        show both the nature of and the organisation responsible
48
        for the relevant amendment or amendments;
49
 
50
        (3) Its onward transfer from a recipient to another
51
        party shall be deemed to be that party's acceptance of
52
        these conditions;
53
 
54
        (4) DERA gives no warranty or assurance as to its
55
        quality or suitability for any purpose and DERA accepts
56
        no liability whatsoever in relation to any use to which
57
        it may be put.
58
*/
59
 
60
 
61
/**********************************************************************
62
$Author: release $
63
$Date: 1998/01/17 15:57:25 $
64
$Revision: 1.1.1.1 $
65
$Log: namedecs.h,v $
66
 * Revision 1.1.1.1  1998/01/17  15:57:25  release
67
 * First version to be checked into rolling release.
68
 *
69
 * Revision 1.1  1995/04/07  14:29:07  currie
70
 * Initial revision
71
 *
72
 * Revision 1.3  1994/12/01  15:35:51  currie
73
 * Fixed common_tagdefs
74
 *
75
 * Revision 1.2  1994/07/21  10:36:27  currie
76
 * Added banner
77
 *
78
***********************************************************************/
79
#ifndef NAMEDECS_INCLUDED
80
#define NAMEDECS_INCLUDED
81
 
82
#include "units.h"
83
 
84
 
85
typedef struct{
86
	char *id;
87
	Name name;
88
} IdName;
89
 
90
typedef struct Sort_struct{
91
	int sort;
92
	struct Toksort_struct *toksort;
93
} Sort;
94
	/* sort of TOKEN is { token_sort , ptr to res and pars}
95
	   other sorts are  { X_sort, nil}
96
	 */
97
 
98
 
99
typedef struct Toksort_struct{
100
	Sort ressort;
101
	struct Tokpar_struct *pars;
102
} TokSort;
103
	/* if ressort is token then pars = nil */
104
 
105
 
106
typedef struct Tokpar_struct {
107
	Sort par;
108
	struct Tokpar_struct *next;
109
} Tokpar;
110
 
111
 
112
typedef struct Tokdec_struct {
113
	IdName idname;
114
	TokSort sort;
115
	struct Tokdec_struct *next;
116
	Bool isdeffed;
117
	Bool isused;
118
	Bool iskept;
119
	Bool isparam;
120
} Tokdec;
121
 
122
extern Tokdec *tokdecs;
123
 
124
typedef union {
125
	Name shtok;
126
	TDF tdfsh;
127
} Tagshape;
128
 
129
typedef struct Tagdec_struct {
130
	IdName idname;
131
	Bool isvar;
132
	Bool isdeffed;
133
	char hassh;
134
	Bool isused;
135
	Bool iskept;
136
	Bool iscommon;
137
	Tagshape sh;
138
	struct Tagdec_struct *next;
139
} Tagdec;
140
 
141
extern Tagdec *tagdecs;
142
extern Tagdec *localdecs;
143
 
144
 
145
typedef struct Al_tagdec_struct {
146
	IdName idname;
147
	struct Al_tagdec_struct *next;
148
	Bool isdeffed;
149
	Bool iskept;
150
	Bool isused;
151
} Al_tagdec;
152
 
153
extern Al_tagdec *al_tagdecs;
154
 
155
typedef struct Labdec_struct {
156
	IdName idname;
157
	Bool declared;
158
	struct Labdec_struct *next;
159
}  Labdec;
160
 
161
extern Labdec *labdecs;
162
 
163
extern Tokdec *find_tok(char *s);
164
extern Tagdec *find_tag(char *s);
165
extern Al_tagdec *find_al_tag(char *s);
166
extern Labdec *find_lab(char *s);
167
 
168
#define NEW_IDNAME(idn, s,ent)\
169
    (idn).id = s; (idn).name = next_name(ent);
170
 
171
#define LOCNAME(x)	(unsigned long)((x).name.unit_name)
172
 
173
#endif