xref: /netbsd-src/sys/arch/amiga/stand/bootblock/txlt/txlt.l (revision 7d3af8c6a2070d16ec6d1aef203d052d6683100d)
1 	void munchit(char *);
2 %%
3 .\.l\ [._A-Za-z][A-Za-z0-9_.]*/\,	{printf("%c.l",yytext[0]);munchit(yytext+3);}
4 .\.w\ [._A-Za-z][A-Za-z0-9_.]*/\,	{printf("%c.w",yytext[0]);munchit(yytext+3);}
5 \..*\n					printf("%s", yytext);
6 pea[ 	][._A-Za-z][A-Za-z0-9_.]*$	{printf("pea");munchit(yytext+3);}
7 \ [._A-Za-z][A-Za-z0-9_.]*/\,		munchit(yytext);
8 .					putchar(*yytext);
9 %%
10 /*	$NetBSD: txlt.l,v 1.5 2011/06/20 20:25:47 he Exp $	*/
11 
12 #include <string.h>
13 
14 void
15 munchit(s)
16 	char *s;
17 {
18 	putchar(*s++);
19 	if ((!strncmp(s, "fp", 2) ||
20 	    !strncmp(s, "sp", 2) ||
21 	    ((*s == 'a')  || (*s == 'd')) && ((s[1]-'0')<=7)) &&
22 	    (s[2] == 0 || s[2] == ','))
23 		printf("%s", s);
24 	else
25 		printf("%%pc@(%s)",s);
26 }
27