2 |
7u83 |
1 |
/*
|
|
|
2 |
Crown Copyright (c) 1996
|
|
|
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 |
VERSION INFORMATION
|
|
|
31 |
===================
|
|
|
32 |
|
|
|
33 |
--------------------------------------------------------------------------
|
|
|
34 |
$Header: /u/g/release/CVSROOT/Source/src/installers/680x0/common/spec_tok.c,v 1.1.1.1 1998/01/17 15:55:50 release Exp $
|
|
|
35 |
--------------------------------------------------------------------------
|
|
|
36 |
$Log: spec_tok.c,v $
|
|
|
37 |
* Revision 1.1.1.1 1998/01/17 15:55:50 release
|
|
|
38 |
* First version to be checked into rolling release.
|
|
|
39 |
*
|
|
|
40 |
Revision 1.1.1.1 1997/10/13 12:42:58 ma
|
|
|
41 |
First version.
|
|
|
42 |
|
|
|
43 |
Revision 1.1.1.1 1997/03/14 07:50:18 ma
|
|
|
44 |
Imported from DRA
|
|
|
45 |
|
|
|
46 |
* Revision 1.1.1.1 1996/09/20 10:56:58 john
|
|
|
47 |
*
|
|
|
48 |
* Revision 1.1.1.1 1996/03/26 15:45:17 john
|
|
|
49 |
*
|
|
|
50 |
* Revision 1.1 94/06/29 14:25:55 14:25:55 ra (Robert Andrews)
|
|
|
51 |
* Initial revision
|
|
|
52 |
*
|
|
|
53 |
--------------------------------------------------------------------------
|
|
|
54 |
*/
|
|
|
55 |
|
|
|
56 |
|
|
|
57 |
#include "config.h"
|
|
|
58 |
#include "common_types.h"
|
|
|
59 |
#include "basicread.h"
|
|
|
60 |
#include "tags.h"
|
|
|
61 |
#include "exp.h"
|
|
|
62 |
#include "expmacs.h"
|
|
|
63 |
#include "diag_fns.h"
|
|
|
64 |
#include "flags.h"
|
|
|
65 |
#include "check.h"
|
|
|
66 |
#include "me_fns.h"
|
|
|
67 |
#include "externs.h"
|
|
|
68 |
#include "installglob.h"
|
|
|
69 |
#include "messages_r.h"
|
|
|
70 |
#include "main_reads.h"
|
|
|
71 |
#include "install_fns.h"
|
|
|
72 |
#include "c_arith_type.h"
|
|
|
73 |
#include "natmacs.h"
|
|
|
74 |
#include "spec_tok.h"
|
|
|
75 |
|
|
|
76 |
|
|
|
77 |
/*
|
|
|
78 |
INTERCEPT SPECIAL TOKENS
|
|
|
79 |
*/
|
|
|
80 |
|
|
|
81 |
tokval special_token
|
|
|
82 |
PROTO_N ( ( t, pars, sortcode, done ) )
|
|
|
83 |
PROTO_T ( token t X bitstream pars X int sortcode X int *done )
|
|
|
84 |
{
|
|
|
85 |
tokval tkv ;
|
|
|
86 |
UNUSED ( sortcode ) ;
|
|
|
87 |
|
|
|
88 |
if ( t->tok_name == NULL ) {
|
|
|
89 |
/* call looks at done to see if result is meaningful */
|
|
|
90 |
SET ( tkv ) ;
|
|
|
91 |
return ( tkv ) ;
|
|
|
92 |
}
|
|
|
93 |
|
|
|
94 |
/* alloca */
|
|
|
95 |
if ( !strcmp ( t->tok_name, "~alloca" ) ) {
|
|
|
96 |
exp arg1 ;
|
|
|
97 |
place old_place ;
|
|
|
98 |
old_place = keep_place () ;
|
|
|
99 |
set_place ( pars ) ;
|
|
|
100 |
arg1 = hold_check ( d_exp () ) ;
|
|
|
101 |
set_place ( old_place ) ;
|
|
|
102 |
tkv.tk_exp = hold_check ( me_u3 ( f_pointer ( long_to_al ( 8 ) ),
|
|
|
103 |
arg1, alloca_tag ) ) ;
|
|
|
104 |
*done = 1 ;
|
|
|
105 |
has_alloca = 1 ;
|
|
|
106 |
return ( tkv ) ;
|
|
|
107 |
}
|
|
|
108 |
|
|
|
109 |
/* diagnostic tokens */
|
|
|
110 |
if ( !strcmp ( t->tok_name, "~exp_to_source" ) ||
|
|
|
111 |
!strcmp ( t->tok_name, "~diag_id_scope" ) ||
|
|
|
112 |
!strcmp ( t->tok_name, "~diag_type_scope" ) ||
|
|
|
113 |
!strcmp ( t->tok_name, "~diag_tag_scope" ) ) {
|
|
|
114 |
place old_place ;
|
|
|
115 |
old_place = keep_place () ;
|
|
|
116 |
set_place ( pars ) ;
|
|
|
117 |
tkv.tk_exp = hold_check ( d_exp () ) ;
|
|
|
118 |
*done = 1 ;
|
|
|
119 |
if ( !diagnose ) {
|
|
|
120 |
set_place ( old_place ) ;
|
|
|
121 |
return ( tkv ) ;
|
|
|
122 |
}
|
|
|
123 |
if ( !strcmp ( t->tok_name, "~exp_to_source" ) ) {
|
|
|
124 |
exp r ;
|
|
|
125 |
diag_info *di = read_exp_to_source () ;
|
|
|
126 |
crt_lno = natint ( di->data.source.end.line_no ) ;
|
|
|
127 |
crt_charno = natint ( di->data.source.end.char_off ) ;
|
|
|
128 |
crt_flnm = di->data.source.beg.file->file.ints.chars ;
|
|
|
129 |
r = getexp ( sh ( tkv.tk_exp ), nilexp, 0, tkv.tk_exp, nilexp,
|
|
|
130 |
1, 0, diagnose_tag ) ;
|
|
|
131 |
setfather ( r, tkv.tk_exp ) ;
|
|
|
132 |
dno ( r ) = di ;
|
|
|
133 |
tkv.tk_exp = r ;
|
|
|
134 |
set_place ( old_place ) ;
|
|
|
135 |
return ( tkv ) ;
|
|
|
136 |
}
|
|
|
137 |
if ( !strcmp ( t->tok_name, "~diag_id_scope" ) ) {
|
|
|
138 |
exp r ;
|
|
|
139 |
diag_info *di = read_diag_id_scope () ;
|
|
|
140 |
r = getexp ( sh ( tkv.tk_exp ), nilexp, 0, tkv.tk_exp, nilexp,
|
|
|
141 |
2, 0, diagnose_tag ) ;
|
|
|
142 |
setfather ( r, tkv.tk_exp ) ;
|
|
|
143 |
dno ( r ) = di ;
|
|
|
144 |
tkv.tk_exp = r ;
|
|
|
145 |
set_place ( old_place ) ;
|
|
|
146 |
return ( tkv ) ;
|
|
|
147 |
}
|
|
|
148 |
if ( !strcmp ( t->tok_name, "~diag_type_scope" ) ) {
|
|
|
149 |
exp r ;
|
|
|
150 |
diag_info *di = read_diag_type_scope () ;
|
|
|
151 |
r = getexp ( sh ( tkv.tk_exp ), nilexp, 0, tkv.tk_exp, nilexp,
|
|
|
152 |
3, 0, diagnose_tag ) ;
|
|
|
153 |
setfather ( r, tkv.tk_exp ) ;
|
|
|
154 |
dno ( r ) = di ;
|
|
|
155 |
tkv.tk_exp = r ;
|
|
|
156 |
set_place ( old_place ) ;
|
|
|
157 |
return ( tkv ) ;
|
|
|
158 |
}
|
|
|
159 |
if ( !strcmp ( t->tok_name, "~diag_tag_scope" ) ) {
|
|
|
160 |
exp r ;
|
|
|
161 |
diag_info *di = read_diag_tag_scope () ;
|
|
|
162 |
r = getexp ( sh ( tkv.tk_exp ), nilexp, 0, tkv.tk_exp, nilexp,
|
|
|
163 |
4, 0, diagnose_tag ) ;
|
|
|
164 |
setfather ( r, tkv.tk_exp ) ;
|
|
|
165 |
dno ( r ) = di ;
|
|
|
166 |
tkv.tk_exp = r ;
|
|
|
167 |
set_place ( old_place ) ;
|
|
|
168 |
return ( tkv ) ;
|
|
|
169 |
}
|
|
|
170 |
}
|
|
|
171 |
|
|
|
172 |
/* call looks at done to see if result is meaningful */
|
|
|
173 |
SET ( tkv ) ;
|
|
|
174 |
return ( tkv ) ;
|
|
|
175 |
}
|
|
|
176 |
|
|
|
177 |
|
|
|
178 |
/*
|
|
|
179 |
CHECK FOR MACHINE DEPENDENT TOKENS
|
|
|
180 |
*/
|
|
|
181 |
|
|
|
182 |
int machine_toks
|
|
|
183 |
PROTO_N ( ( s ) )
|
|
|
184 |
PROTO_T ( char *s )
|
|
|
185 |
{
|
|
|
186 |
return ( 0 ) ;
|
|
|
187 |
}
|