Subversion Repositories tendra.SVN

Rev

Rev 5 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5 Rev 6
Line -... Line 1...
-
 
1
/*
-
 
2
 * Copyright (c) 2002-2005 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
 */
1
/*
31
/*
2
    		 Crown Copyright (c) 1997
32
    		 Crown Copyright (c) 1997
3
 
33
 
4
    This TenDRA(r) Computer Program is subject to Copyright
34
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
35
    owned by the United Kingdom Secretary of State for Defence
Line 55... Line 85...
55
 
85
 
56
/* VARIABLES */
86
/* VARIABLES */
57
/* All variables except good_trans are initialised. This assumes
87
/* All variables except good_trans are initialised. This assumes
58
that translation stops after the first error */
88
that translation stops after the first error */
59
 
89
 
60
dec * capsule_tagtab;
90
dec *capsule_tagtab;
61
  /* the table of tags which are available at the capsule level */
91
/* the table of tags which are available at the capsule level */
62
 
92
 
63
tok_define * capsule_toktab;
93
tok_define *capsule_toktab;
64
  /* the table of tokens which are available at the capsule level */
94
/* the table of tokens which are available at the capsule level */
65
 
95
 
66
aldef * capsule_altab;
96
aldef *capsule_altab;
67
  /* the table of alignment tags which are available at the
97
/* the table of alignment tags which are available at the capsule level */
68
     capsule level */
-
 
69
 
98
 
70
diag_tagdef * capsule_diag_tagtab;	/* OLD DIAGS */
99
diag_tagdef *capsule_diag_tagtab;	/* OLD DIAGS */
71
  /* the table of diagnostic tags which are available at the
100
/* the table of diagnostic tags which are available at the capsule level */
72
     capsule level */
-
 
73
 
101
 
74
dgtag_struct * capsule_dgtab;		/* NEW DIAGS */
102
dgtag_struct *capsule_dgtab;		/* NEW DIAGS */
75
  /* the table of diagnostic tags which are available at the
103
/* the table of diagnostic tags which are available at the capsule level */
76
     capsule level */
-
 
77
 
104
 
78
int capsule_no_of_tokens;
105
int capsule_no_of_tokens;
79
  /* the number of tokens at the capsule level */
106
/* the number of tokens at the capsule level */
80
 
107
 
81
int capsule_no_of_tags;
108
int capsule_no_of_tags;
82
  /* the number of tags at the capsule level */
109
/* the number of tags at the capsule level */
83
 
110
 
84
int capsule_no_of_als;
111
int capsule_no_of_als;
85
  /* the number of alignment tags at the capsule level */
112
/* the number of alignment tags at the capsule level */
86
 
113
 
87
int capsule_no_of_diagtags;	/* OLD DIAGS */
114
int capsule_no_of_diagtags;	/* OLD DIAGS */
88
  /* the number of diagnostic tags at the capsule level */
115
/* the number of diagnostic tags at the capsule level */
89
 
116
 
90
int capsule_no_of_dgtags;	/* NEW DIAGS */
117
int capsule_no_of_dgtags;	/* NEW DIAGS */
91
  /* the number of diagnostic tags at the capsule level */
118
/* the number of diagnostic tags at the capsule level */
92
 
119
 
93
 
120
 
94
dec * unit_tagtab;
121
dec *unit_tagtab;
95
  /* the table of tags for the current unit */
122
/* the table of tags for the current unit */
96
 
123
 
97
tok_define * unit_toktab;
124
tok_define *unit_toktab;
98
  /* the table of tokens for the current unit */
125
/* the table of tokens for the current unit */
99
 
126
 
100
aldef * unit_altab;
127
aldef *unit_altab;
101
  /* the table of alignment tags for the current unit */
128
/* the table of alignment tags for the current unit */
102
 
129
 
103
int unit_no_of_tokens;
130
int unit_no_of_tokens;
104
  /* the number of tokens in the current unit */
131
/* the number of tokens in the current unit */
105
 
132
 
106
int unit_no_of_tags;
133
int unit_no_of_tags;
107
  /* the number of tags in the current unit */
134
/* the number of tags in the current unit */
108
 
135
 
109
int unit_no_of_als;
136
int unit_no_of_als;
110
  /* the number of alignment tags in the current unit */
137
/* the number of alignment tags in the current unit */
111
 
138
 
112
dec ** unit_ind_tags;
139
dec **unit_ind_tags;
113
  /* table of pointers to the tags used in the current unit */
140
/* table of pointers to the tags used in the current unit */
114
 
141
 
115
tok_define ** unit_ind_tokens;
142
tok_define **unit_ind_tokens;
116
  /* table of pointers to the tokens used in the current unit */
143
/* table of pointers to the tokens used in the current unit */
117
 
144
 
118
aldef ** unit_ind_als;
145
aldef **unit_ind_als;
119
  /* table of pointers to the alignment tags used in the current unit */
146
/* table of pointers to the alignment tags used in the current unit */
120
 
147
 
121
 
148
 
122
exp * unit_labtab;
149
exp *unit_labtab;
123
  /* table of labels used in the current unit */
150
/* table of labels used in the current unit */
124
 
151
 
125
int unit_no_of_labels;
152
int unit_no_of_labels;
126
  /* number of labels used in the current unit */
153
/* number of labels used in the current unit */
127
 
154
 
128
int crt_tagdef_unit_no;
155
int crt_tagdef_unit_no;
129
  /* number of current tagdef unit. -1 before tagdef units */
156
/* number of current tagdef unit. -1 before tagdef units */
130
 
157
 
131
int unit_index;
158
int unit_index;
132
  /* number of current unit */
159
/* number of current unit */
133
 
160
 
134
int rep_make_proc = 1;  /* identify any make_procs not in make_id_tagdef*/
161
int rep_make_proc = 1;  /* identify any make_procs not in make_id_tagdef*/
135
 
162
 
136
int replace_arith_type = 0;	/* do not use C definitions of promote
163
int replace_arith_type = 0;	/* do not use C definitions of promote
137
				   etc. */
164
				   etc. */
Line 139... Line 166...
139
int good_trans = 0;		/* 0 if translation is good, 1 for error
166
int good_trans = 0;		/* 0 if translation is good, 1 for error
140
				*/
167
				*/
141
 
168
 
142
char *crt_filename;
169
char *crt_filename;
143
 
170
 
144
capsule_frees * capsule_freelist = (capsule_frees*)0;
171
capsule_frees *capsule_freelist = (capsule_frees *)0;
145
 
172
 
146
int newcode = 1;
173
int newcode = 1;
147
 
174
 
148
#ifdef NEWDIAGS
175
#ifdef NEWDIAGS
149
int within_diags = 0;	/* mark name_tag if it's not used for producing code */
176
int within_diags = 0;	/* mark name_tag if it's not used for producing code */