* Copyright (c) 1980 The Regents of the University of California.
* This module is believed to contain source code proprietary to AT&T.
* Use and redistribution is subject to the Berkeley Software License
* Agreement and your Software Agreement with AT&T (Western Electric).
"@(#) Copyright (c) 1980 The Regents of the University of California.\n\
static char sccsid
[] = "@(#)main.c 5.2 (Berkeley) 4/12/91";
* Main routine for the f77 compiler, pass 1, 4.2 BSD.
* University of Utah CS Dept modification history:
* Revision 3.2 85/01/14 04:21:31 donn
* Added changes to implement Jerry's '-q' option.
* Revision 3.1 84/10/29 05:47:03 donn
* Added Jerry Berkman's change to line buffer stderr.
char *xxxvers
[] = "\n@(#) FORTRAN 77 PASS 1, VERSION 2.10, 16 AUGUST 1980\n";
LOCAL
char *textname
= "";
LOCAL
char *asmname
= "";
LOCAL
char *initname
= "";
#define DONE(c) { retcode = c; goto finis; }
signal(SIGFPE
, flovflo
); /* catch overflows */
ldfps(01200); /* trap on overflow */
while(argc
>0 && argv
[0][0]=='-')
for(s
= argv
[0]+1 ; *s
; ++s
) switch(*s
)
if(s
[1]=='6' && s
[2]=='6')
while (*s
== 'd' || *s
== ',')
if(k
< 0 || k
>= MAXDEBUGFLAG
)
fatali("bad debug number %d",k
);
ip
= &maxequiv
; goto getnum
;
ip
= &maxext
; goto getnum
;
ip
= &maxstno
; goto getnum
;
ip
= &maxctl
; goto getnum
;
ip
= &maxhash
; goto getnum
;
fatali("invalid flag -N%c", *s
);
fatal("Table size too small");
fatali("invalid flag -i%c\n", *s
);
fatali("invalid flag %c\n", *s
);
fatali("arg count %d", argc
);
if(inilex( copys(argv
[0]) ))
fprintf(diagfile
, "%s:\n", argv
[0]);
fprintf(diagfile
, "Bad parse, return code %d\n", k
);
warn("missing END statement");
static char *ioerror
= "i/o error on intermediate file %s\n";
if (textfile
!= NULL
&& textfile
!= stdout
)
fprintf(diagfile
, ioerror
, textname
);
if (asmfile
!= NULL
&& asmfile
!= stdout
)
fprintf(diagfile
, ioerror
, asmname
);
if (initfile
!= NULL
&& initfile
!= stdout
)
fprintf(diagfile
, ioerror
, initname
);
if( fp
= fopen(fn
, "w") )
fatalstr("cannot open intermediate file %s", fn
);
if(p
!=NULL
&& *p
!=NULL
&& *p
!=stdout
)
err("floating exception during constant evaluation");
fatal("vax cannot recover from floating exception");
/* vax returns a reserved operand that generates
an illegal operand fault on next instruction,
which if ignored causes an infinite loop.