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:24 $
64
$Revision: 1.1.1.1 $
65
$Log: defs.h,v $
66
 * Revision 1.1.1.1  1998/01/17  15:57:24  release
67
 * First version to be checked into rolling release.
68
 *
69
 * Revision 1.2  1995/06/08  09:13:48  currie
70
 * Added sigs to tokdecs/defs
71
 *
72
 * Revision 1.1  1995/04/07  14:29:07  currie
73
 * Initial revision
74
 *
75
 * Revision 1.1  1995/04/07  14:29:07  currie
76
 * Initial revision
77
 *
78
 * Revision 1.3  1994/12/05  10:12:59  currie
79
 * Extended size of input buffer
80
 *
81
 * Revision 1.2  1994/07/21  10:36:07  currie
82
 * Added banner
83
 *
84
***********************************************************************/
85
#ifndef DEFS_INCLUDED
86
#define DEFS_INCLUDED
87
 
88
#include "namedecs.h"
89
#include "errors.h"
90
#include "util.h"
91
#include "includes.h"
92
 
93
typedef struct{
94
	int t;
95
	union Lex_v{
96
		int v;
97
		char *name;
98
		Tokdec *tokname;
99
	} val;
100
} LEX;
101
 
102
typedef struct{
103
	char *name;
104
	int t;
105
	void(*f)(void);
106
} Constructs;
107
 
108
typedef struct{
109
	char *name;
110
	int t;
111
} Terminals;
112
 
113
#define BUFFLEN 600
114
extern char buff[BUFFLEN];
115
extern unsigned long cLINE;
116
extern LEX lex_v;
117
extern long radix;
118
extern int lnum;
119
extern int bind;
120
extern long stoi(char *s, int n);
121
 
122
#define MINSI			0x80000000
123
#define MAXSI			0x7fffffff
124
#define MAXUSI			0xffffffff
125
#define MINSS			0x8000
126
#define MAXSS			0x7fff
127
#define MAXUSS			0xffff
128
#define MINSC			128
129
#define MAXSC			127
130
#define MAXUSC			255
131
#define MINSL			0x80000000
132
#define MAXSL			0x7fffffff
133
#define MAXUSL			0xffffffff
134
#define MANT_DOUBLE		53
135
#define MINEXP_DOUBLE		1022
136
#define MAXEXP_DOUBLE		1023
137
#define MANT_FLOAT		24
138
#define MINEXP_FLOAT		126
139
#define MAXEXP_FLOAT		127
140
 
141
#define UL(x)			((unsigned long)(x))
142
#define UI(x)			((unsigned int)(x))
143
#define UC(x)			((unsigned char)(x))
144
 
145
#define access_t		lex_access__cons
146
#define alignment_t		lex_alignment__cons
147
#define bitfield_variety_t	lex_bitfield__variety__cons
148
#define bool_t			lex_bool__cons
149
#define error_code_t		lex_error__code__cons
150
#define error_treatment_t	lex_error__treatment__cons
151
#define exp_t			lex_exp__cons
152
#define floating_variety_t	lex_floating__variety__cons
153
#define nat_t			lex_nat__cons
154
#define ntest_t			lex_ntest__cons
155
#define rounding_mode_t		lex_rounding__mode__cons
156
#define shape_t			lex_shape__cons
157
#define signed_nat_t		lex_signed__nat__cons
158
#define string_t		lex_string__cons
159
#define tag_t			lex_tag__cons
160
#define token_t			lex_token__cons
161
#define transfer_mode_t		lex_transfer__mode__cons
162
#define variety_t		lex_variety__cons
163
 
164
#define access_sort		lex_access__sort
165
#define al_tag_sort		lex_al__tag__sort
166
#define alignment_sort		lex_alignment__sort
167
#define bitfield_variety_sort	lex_bitfield__variety__sort
168
#define bool_sort		lex_bool__sort
169
#define error_treatment_sort	lex_error__treatment__sort
170
#define exp_sort		lex_exp__sort
171
#define floating_variety_sort	lex_floating__variety__sort
172
#define label_sort		lex_label__sort
173
#define nat_sort		lex_nat__sort
174
#define ntest_sort		lex_ntest__sort
175
#define rounding_mode_sort	lex_rounding__mode__sort
176
#define shape_sort		lex_shape__sort
177
#define signed_nat_sort		lex_signed__nat__sort
178
#define string_sort		lex_string__sort
179
#define tag_sort		lex_tag__sort
180
#define token_sort		lex_token__sort
181
#define transfer_mode_sort	lex_transfer__mode__sort
182
#define variety_sort		lex_variety__sort
183
 
184
#define access_tok		lex_access__tok
185
#define al_tag_tok		lex_al__tag__tok
186
#define alignment_tok		lex_alignment__tok
187
#define bitfield_variety_tok	lex_bitfield__variety__tok
188
#define bool_tok		lex_bool__tok
189
#define error_treatment_tok	lex_error__treatment__tok
190
#define exp_tok			lex_exp__tok
191
#define floating_variety_tok	lex_floating__variety__tok
192
#define label_tok		lex_label__tok
193
#define nat_tok			lex_nat__tok
194
#define ntest_tok		lex_ntest__tok
195
#define rounding_mode_tok	lex_rounding__mode__tok
196
#define shape_tok		lex_shape__tok
197
#define signed_nat_tok		lex_signed__nat__tok
198
#define string_tok		lex_string__tok
199
#define tag_tok			lex_tag__tok
200
#define token_tok		lex_token__tok
201
#define transfer_mode_tok	lex_transfer__mode__tok
202
#define variety_tok		lex_variety__tok
203
 
204
 
205
#endif