|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T d
Length: 1315 (0x523)
Types: TextFile
Names: »detex.lex«
└─⟦52210d11f⟧ Bits:30007239 EUUGD2: TeX 3 1992-12
└─⟦c319c2751⟧ »unix3.0/TeX3.0.tar.Z«
└─⟦036c765ac⟧
└─⟦this⟧ »TeX3.0/TeXcontrib/trickey/detex.lex«
└─⟦060c9c824⟧ Bits:30007080 DKUUG TeX 2/12/89
└─⟦this⟧ »./tex82/TeXcontrib/trickey/detex.lex«
└─⟦52210d11f⟧ Bits:30007239 EUUGD2: TeX 3 1992-12
└─⟦63303ae94⟧ »unix3.14/TeX3.14.tar.Z«
└─⟦c58930e5c⟧
└─⟦this⟧ »TeX3.14/TeXcontrib/trickey/detex.lex«
/* Make this with: lex detex.lex; cc lex.yy.c -ll -o detex */
L [A-Za-z]
%Start Display Normal
%%
<Normal>\' {yyleng--; yymore(); /* ignore apostrophes */}
<Normal>{L}+\\- {yyleng-=2; yymore(); /* ignore hyphens */}
<Normal>[a-z]/[^A-Za-z] ; /* ignore single letter "words" */
<Normal>[A-Z]+ ; /* ignore words all in uppercase */
<Normal>{L}+('{L}*)*{L} {printf("%s\n",yytext); /* any other letter seq is a word */}
<Normal>\\. ; /* ignore single character control sequences */
<Normal>\\\n ; /* more of the same */
<Normal>"%".* ; /* ignore comments */
<Normal>\\{L}+ ; /* ignore other control sequences */
<Normal>[0-9]+ ; /* ignore numbers */
<Normal,Display>\$([^$]|\\\$)+\$ ; /* ignore things in math mode */
<Normal>\$\$ BEGIN Display; /* now in Display math mode */
<Display>[^$]|\\\$|\\\\ ; /* ignore most things in display math mode */
<Display>\$\$ BEGIN Normal; /* get out of Display math mode */
<Normal>\n|. ; /* ignore anything else, a character at a time */
%%
main(argc,argv)
char **argv;
{
int i;
BEGIN Normal; /* Starts yylex off in the right state */
if (argc==1) {
yyin = stdin;
yylex();
}
else for (i=1; i<argc; i++) {
yyin = fopen(argv[i],"r");
if (yyin==NULL) {
fprintf(stderr,"can't open %s\n",argv[i]);
exit(1);
}
yylex();
}
exit(0);
}