home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
c
/
lex.arc
/
CAP.LXI
< prev
next >
Wrap
Text File
|
1983-11-24
|
553b
|
35 lines
/*
* capitalise things
*/
letter = [A-Z];
open = ["'(];
close = ["')];
any = [\0-\377];
eos = [.?!];
%{
extern char *token();
main()
{
while (yylex())
;
}
%}
%%
%{
register char *cp;
char *et;
%}
(".PP\n"|eos close* " "* (" "|"\n"))open*letter {
cp = token(&et);
while (cp < et)
putchar(*cp++);
}
$letter {putchar(token(0)[1]);}
letter {putchar(*token(0)+'a'-'A');}
any {putchar(*token(0));}
%%