DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦83a4662eb⟧ TextFile

    Length: 331 (0x14b)
    Types: TextFile
    Names: »pig.l«

Derivation

└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987
    └─⟦this⟧ »EUUGD18/General/Pig/pig.l« 

TextFile

/* PIG - a pig-latin translator */

%{
#include <ctype.h>
char *c, start;
%}
%%
[A-Za-z]+	{
	if(yyleng >=2){
		c=yytext;
		if(isupper(yytext[0]))
			start = tolower(yytext[0]);
		else
			start = yytext[0];
		c++;
		if(isupper(yytext[0]))
			*c=toupper(*c);
		printf("%s%ca",c,start);
	} else {
		ECHO;
	}
}
%%
main()
{
	yylex();
}