2 /********************************************
4 copyright 1991, Michael D. Brennan
6 This is a source file for mawk, an implementation of
7 the AWK programming language.
9 Mawk is distributed without warranty under the terms of
10 the GNU General Public License, version 2, 1991.
11 ********************************************/
15 * Revision 1.2 1993/07/23 13:21:51 mike
18 * Revision 1.1.1.1 1993/07/03 18:58:28 mike
21 * Revision 3.2 1991/08/13 09:10:09 brennan
24 * Revision 3.1 91/06/07 10:33:30 brennan
33 /* print a machine for debugging */
35 static char *xlat[] = {
50 { register STATE *p = (STATE *) m ;
55 if ( p->type >= END_ON )
56 { p->type -= END_ON ; end_on_string = "$" ; }
57 else end_on_string = "" ;
59 if ( p->type < 0 || p->type >= END_ON )
60 { fprintf(f, "unknown STATE type\n") ; return ; }
62 fprintf(f, "%-10s" , xlat[p->type]) ;
65 case M_STR : fprintf(f, "%s", p->data.str ) ;
70 case M_2JB : fprintf(f, "%d", p->data.jump) ;
73 { unsigned char *q = (unsigned char *) p->data.bvp ;
74 unsigned char *r = q + sizeof(BV) ;
75 while ( q < r ) fprintf(f, "%x " , *q++) ;
79 fprintf(f, "%s\n" , end_on_string) ;
80 if ( end_on_string[0] ) p->type += END_ON ;
81 if ( p->type == M_ACCEPT ) return ;