Subversion Repositories tendra.SVN

Rev

Rev 2 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 7u83 1
/*
2
    		 Crown Copyright (c) 1997
3
 
4
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
6
    acting through the Defence Evaluation and Research Agency
7
    (DERA).  It is made available to Recipients with a
8
    royalty-free licence for its use, reproduction, transfer
9
    to other parties and amendment for any purpose not excluding
10
    product development provided that any such use et cetera
11
    shall be deemed to be acceptance of the following conditions:-
12
 
13
        (1) Its Recipients shall ensure that this Notice is
14
        reproduced upon any copies or amended versions of it;
15
 
16
        (2) Any amended version of it shall be clearly marked to
17
        show both the nature of and the organisation responsible
18
        for the relevant amendment or amendments;
19
 
20
        (3) Its onward transfer from a recipient to another
21
        party shall be deemed to be that party's acceptance of
22
        these conditions;
23
 
24
        (4) DERA gives no warranty or assurance as to its
25
        quality or suitability for any purpose and DERA accepts
26
        no liability whatsoever in relation to any use to which
27
        it may be put.
28
*/
29
 
30
 
31
/* AUTOMATICALLY GENERATED BY %ZX VERSION %ZV FROM TDF %VA.%VB */
32
 
33
#include "config.h"
34
#include "common_types.h"
35
#include "basicread.h"
36
#include "ecodes.h"
37
#include "externs.h"
38
#include "messages_r.h"
39
#include "main_reads.h"
40
#include "check.h"
41
 
42
 
43
/* REPORT AN ERROR */
44
 
45
static void decode_error
46
    PROTO_N ( ( s ) )
47
    PROTO_T ( char *s )
48
{
49
    failer ( s ) ;
50
    exit ( EXIT_FAILURE ) ;
51
}
52
@use all
53
@special exp
54
@special nat computed_nat
55
@special signed_nat computed_signed_nat
56
@special tagdef make_var_tagdef
57
@special tagdef common_tagdef
58
@loop sort
59
@if !sort.builtin
60
 
61
 
62
/* DECODE %ST */
63
 
64
%SN d_%SN
65
    PROTO_Z ()
66
{
67
@if sort.basic
68
@if sort.extends
69
    int code = get_big_code ( %SB ) ;
70
@else
71
    int code = getcode ( %SB ) ;
72
@endif
73
    switch ( code ) {
74
@loop sort.cons
75
	case e_%CN : {
76
@if cons.params
77
@loop cons.param
78
	    %PSN p%PE ;
79
@end
80
@loop cons.param
81
@if param.align
82
	    to_boundary () ;
83
@endif
84
@if param.break
85
@if param.first
86
	    start_%CN () ;
87
@else
88
	    start_%CN (%
89
@loop param.prev
90
 p%PE,%
91
@end
92
%b ) ;
93
@endif
94
@endif
95
@if param.sort.special
96
@if cons.cond
97
	    p%PE = hold_const_check ( d_%PSN () ) ;
98
@else
99
@if cons.special
100
	    p%PE = hold_const_check ( d_%PSN () ) ;
101
@else
102
	    p%PE = hold_check ( d_%PSN () ) ;
103
@endif
104
@endif
105
@else
106
	    p%PE = d_%PSN () ;
107
@endif
108
@end
109
	    return ( f_%CN (%
110
@loop cons.param
111
 p%PE,%
112
@end
113
%b ) ) ;
114
@else
115
@if sort.special
116
	    return ( f_%CN () ) ;
117
@else
118
	    return ( f_%CN ) ;
119
@endif
120
@endif
121
	}
122
@end
123
    }
124
    decode_error ( ILLEGAL_CODE_%SN ) ;
125
    return ( f_dummy_%SN ) ;
126
@else
127
@if sort.dummy
128
@loop sort.cons
129
@loop cons.param
130
    %PSN p%PE ;
131
@end
132
@loop cons.param
133
@if param.align
134
    to_boundary () ;
135
@endif
136
@if param.break
137
    start_%CN (%
138
@loop param.prev
139
 p%PE,%
140
@end
141
%b ) ;
142
@endif
143
@if param.sort.special
144
    p%PE = hold_check ( d_%PSN () ) ;
145
@else
146
    p%PE = d_%PSN () ;
147
@endif
148
@end
149
    return ( f_%CN (%
150
@loop cons.param
151
 p%PE,%
152
@end
153
%b ) ) ;
154
@end
155
@else
156
@if sort.option
157
    if ( getcode ( 1 ) ) {
158
	%SSN e ;
159
@if sort.sub.special
160
	e = hold_check ( d_%SSN () ) ;
161
@else
162
	e = d_%SSN () ;
163
@endif
164
	return ( yes_%SN ( e ) ) ;
165
    }
166
    return ( no_%SN ) ;
167
@else
168
    int i, n ;
169
    %SN temp ;
170
@if sort.list
171
    IGNORE getcode ( 1 ) ;
172
@endif
173
    n = small_dtdfint () ;
174
    temp = new_%SN ( n ) ;
175
    for ( i = 0 ; i < n; i++ ) {
176
	%SSN e ;
177
@if sort.sub.special
178
	e = hold_check ( d_%SSN () ) ;
179
@else
180
	e = d_%SSN () ;
181
@endif
182
	temp = add_%SN ( temp, e, i ) ;
183
    }
184
    return ( temp ) ;
185
@endif
186
@endif
187
@endif
188
}
189
@endif
190
@end