txlt.l revision 1.6
11.1Sis	void munchit(char *);
21.1Sis%%
31.4Smhitch.\.l\ [._A-Za-z][A-Za-z0-9_.]*/\,	{printf("%c.l",yytext[0]);munchit(yytext+3);}
41.4Smhitch.\.w\ [._A-Za-z][A-Za-z0-9_.]*/\,	{printf("%c.w",yytext[0]);munchit(yytext+3);}
51.1Sis\..*\n					printf("%s", yytext);
61.4Smhitchpea[ 	][._A-Za-z][A-Za-z0-9_.]*$	{printf("pea");munchit(yytext+3);}
71.4Smhitch\ [._A-Za-z][A-Za-z0-9_.]*/\,		munchit(yytext);
81.1Sis.					putchar(*yytext);
91.1Sis%%
101.6Saymeric/*	$NetBSD: txlt.l,v 1.6 2015/02/03 19:58:41 aymeric Exp $	*/
111.5She
121.5She#include <string.h>
131.2Sperry
141.1Sisvoid
151.6Saymericmunchit(char *s) {
161.6Saymeric
171.1Sis	putchar(*s++);
181.4Smhitch	if ((!strncmp(s, "fp", 2) ||
191.1Sis	    !strncmp(s, "sp", 2) ||
201.4Smhitch	    ((*s == 'a')  || (*s == 'd')) && ((s[1]-'0')<=7)) &&
211.4Smhitch	    (s[2] == 0 || s[2] == ','))
221.1Sis		printf("%s", s);
231.1Sis	else
241.3Smhitch		printf("%%pc@(%s)",s);
251.1Sis}
261.6Saymeric
271.6Saymericint
281.6Saymericmain(void) {
291.6Saymeric	while (yylex() != 0)
301.6Saymeric		;
311.6Saymeric
321.6Saymeric	return 0;
331.6Saymeric}
34