Subversion Repositories tendra.SVN

Rev

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

Rev 2 Rev 7
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 68... Line 98...
68
#include "machine.h"
98
#include "machine.h"
69
#include "exp.h"
99
#include "exp.h"
70
#include "dump_distr.h"
100
#include "dump_distr.h"
71
#include "construct_v.h"
101
#include "construct_v.h"
72
#include "reader_v.h"
102
#include "reader_v.h"
73
extern void output_symtab PROTO_S (( char* ));
103
extern void output_symtab(char*);
74
 
104
 
75
 
105
 
76
/* extern int bytes_allocated; */
106
/* extern int bytes_allocated; */
77
 
107
 
78
void out_rename
108
void out_rename
79
    PROTO_N ( (oldid, newid) )
-
 
80
    PROTO_T ( char * oldid X char * newid )
109
(char * oldid, char * newid)
81
{
110
{
82
	/* ??? this may be wrong with diagnostics */
111
	/* ??? this may be wrong with diagnostics */
83
	return;
112
	return;
84
}
113
}
85
 
114
 
Line 98... Line 127...
98
bool BIGEND = (little_end == 0);
127
bool BIGEND = (little_end == 0);
99
 
128
 
100
bool do_tlrecursion = 1;
129
bool do_tlrecursion = 1;
101
 
130
 
102
bool opt
131
bool opt
103
    PROTO_N ( (c) )
-
 
104
    PROTO_T ( char c )
132
(char c)
105
{ if (c == '0' || c == 0) return 0;
133
{ if (c == '0' || c == 0) return 0;
106
  else return 1;
134
  else return 1;
107
}
135
}
108
 
136
 
109
int   main
137
int   main
110
    PROTO_N ( (argc, argv) )
-
 
111
    PROTO_T ( int argc X char **argv )
138
(int argc, char **argv)
112
{
139
{
113
  long  i;
140
  long  i;
114
  char *nm;
141
  char *nm;
115
  char *aname;
142
  char *aname;
116
  char *dname;
143
  char *dname;
117
  bool withs = 0;
144
  bool withs = 0;
118
  bool no_opts = 0;
145
  bool no_opts = 0;
119
  bool override_diags = 0;
146
  bool override_diags = 0;
120
/*  bool show_size = 0; */
147
/*  bool show_size = 0; */
121
 
148
 
122
  as_file = (FILE *) 0;
149
  as_file = (FILE *)0;
123
  do_inlining = 1;
150
  do_inlining = 1;
124
  redo_structfns = 1;
151
  redo_structfns = 1;
125
  do_unroll = 1;
152
  do_unroll = 1;
126
  do_extern_adds = 0;
153
  do_extern_adds = 0;
127
 
154
 
Line 201... Line 228...
201
		    else
228
		    else
202
		      break;
229
		      break;
203
		  }
230
		  }
204
		}
231
		}
205
 
232
 
206
		if (s[ind] != '.') {
233
		if (s[ind]!= '.') {
207
		  fprintf(stderr,
234
		  fprintf(stderr,
208
                "DRA TDF Mips Ultrix (as:3.x) translator %d.%d: (TDF version %d.%d)\n",
235
                "DRA TDF Mips Ultrix (as:3.x) translator %d.%d: (TDF version %d.%d)\n",
209
                 mipstrans_version,mipstrans_revision, MAJOR_VERSION, MINOR_VERSION);
236
                 mipstrans_version,mipstrans_revision, MAJOR_VERSION, MINOR_VERSION);
210
                 fprintf(stderr, "reader %d.%d: \n", reader_version,
237
                 fprintf(stderr, "reader %d.%d: \n", reader_version,
211
		 reader_revision);
238
		 reader_revision);
Line 241... Line 268...
241
      case 'Z': /* prints on stderr the versions of all the capsules
268
      case 'Z': /* prints on stderr the versions of all the capsules
242
                   from which this capsule was made */
269
                   from which this capsule was made */
243
        report_versions = 1;
270
        report_versions = 1;
244
        break;
271
        break;
245
      default:
272
      default:
246
	failer ("Illegal flag");
273
	failer("Illegal flag");
247
	break;
274
	break;
248
    };
275
    };
249
  };
276
  };
250
 
277
 
251
#ifdef V210
278
#ifdef V210
Line 258... Line 285...
258
		printf("This translator is not for ULTRIX versions 2.x\n");
285
		printf("This translator is not for ULTRIX versions 2.x\n");
259
		exit(EXIT_FAILURE);
286
		exit(EXIT_FAILURE);
260
	}
287
	}
261
#endif
288
#endif
262
 
289
 
263
  if (override_diags) diagnose = 0;
290
  if (override_diags)diagnose = 0;
264
  if (diagnose || no_opts) {		/* line numbering goes to hell with
291
  if (diagnose || no_opts) {		/* line numbering goes to hell with
265
				   optimisations */
292
				   optimisations */
266
 
293
 
267
        do_inlining = 0;
294
        do_inlining = 0;
268
        do_loopconsts = 0;
295
        do_loopconsts = 0;
Line 273... Line 300...
273
  };
300
  };
274
 
301
 
275
 
302
 
276
  if (withs) {			/* requires assembler text */
303
  if (withs) {			/* requires assembler text */
277
    aname = argv[argc - 1];
304
    aname = argv[argc - 1];
278
    as_file = fopen (aname, "w");
305
    as_file = fopen(aname, "w");
279
    if (as_file == (FILE *) 0) {
306
    if (as_file == (FILE *)0) {
280
      failer ("can't find .s file");
307
      failer("can't find .s file");
281
      return 1;
308
      return 1;
282
    }
309
    }
283
    argc--;
310
    argc--;
284
  }
311
  }
285
 
312
 
286
 
313
 
287
  dname = argv[argc - 1];	/* the .T file */
314
  dname = argv[argc - 1];	/* the .T file */
288
  nm = argv[argc - 2];		/* the .G file */
315
  nm = argv[argc - 2];		/* the .G file */
289
  ba_file = fopen (nm, "w");
316
  ba_file = fopen(nm, "w");
290
  if (ba_file == (FILE *) 0) {
317
  if (ba_file == (FILE *)0) {
291
    printf ("install: can't open output file %s\n", nm);
318
    printf("install: can't open output file %s\n", nm);
292
    return (1);
319
    return(1);
293
  }
320
  }
294
 
321
 
295
 
322
 
296
  if (!initreader (argv[argc - 3])) {
323
  if (!initreader(argv[argc - 3])) {
297
    failer ("cant read .t file");
324
    failer("cant read .t file");
298
    return (1);
325
    return(1);
299
  };
326
  };
300
 
327
 
301
  init_flpt();
328
  init_flpt();
302
#include "inits.h"
329
#include "inits.h"
303
  top_def = (dec*)0;
330
  top_def = (dec*)0;