Original BTL Ratfor System
for 4.2
/* @(#)rlex.c 1.1 (Berkeley) %G% */
char *fcnloc
; /* spot for "function" */
char *curfile
[10] = { "" };
FILE *outfil
= { stdout
};
FILE *infile
[10] = { stdin
};
int contfld
= CONTFLD
; /* place to put continuation char */
int printcom
= 0; /* print comments if on */
int hollerith
= 0; /* convert "..." to 27H... if on */
char *bwkmeter
". bwkmeter ";
main(argc
,argv
) int argc
; char **argv
; {
while(argc
>1 && argv
[1][0]=='-') {
} else if (argv
[1][1] == 'C')
else if (argv
[1][1] == 'h')
ascbcd(bwkmeter
,bcdbwk
,24);
if ((infile
[infptr
]=fopen("s*", "r")) == NULL
)
if ((outfil
=fopen("*s", "w")) == NULL
)
for (i
=0; keyword
[i
]; i
++)
install(keyword
[i
], "", keytran
[i
]);
fcnloc
= install("function", "", 0);
/* this is the batch version of exit for gcos tss */
fclose(stderr
); /* make sure diagnostics get flushed */
/* good: copy output back to s*, call forty */
while ((c
=getc(inf
)) != EOF
)
while ((c
= getchr()) == ' ' || c
== '\t');
for (ps
=fname
; (*ps
=getchr()) != ')'; ps
++);
} else if (c
== '"' || c
== '\'') {
for (ps
=fname
; (*ps
=getchr()) != c
; ps
++);
for (ps
=fname
; (*ps
=getchr()) != ' ' &&*ps
!='\t' && *ps
!='\n' && *ps
!=';'; ps
++);
if ((infile
[++infptr
] = fopen(fname
,"r")) == NULL
) {
while ((c
=gtok(str
))==' ' || c
=='\n' || c
=='\t')
if (c
==';' || c
=='{' || c
=='}')
while ((c
=getchr())==' ' || c
=='\t');
while ((c
=getchr())==' ' || c
=='\t');
for (nstr
=0; c
=getchr(); nstr
++) {
if (type
[c
] != LET
&& type
[c
] != DIG
)
if (c
!= ' ' && c
!= '\t' && c
!= '\n' && c
!= ',') {
error("illegal define statement");
while ((c
=getchr())==' ' || c
=='\t');
for (i
=val
; (c
=getchr())!='\n' && c
!='#' && c
!='\0'; i
++)
while ((c
=getchr())==' ' || c
=='\t' || c
==',' || c
=='\n');
for (i
=val
; nlp
>=0 && (c
=str
[i
]=getchr()); i
++)
if (str
[i
-1] != ' ' && str
[i
-1] != '\t')
install(str
, &str
[val
], 0);