]>
git.saurik.com Git - bison.git/blob - lib/bitsetv-print.c
2 Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
4 This file is part of Bison.
6 Bison is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 2, or (at your option) any later
11 Bison is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 You should have received a copy of the GNU General Public License
17 along with Bison; see the file COPYING. If not, write to the Free
18 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
26 #include "bitsetv-print.h"
28 /*--------------------------------------------------------.
29 | Display the MATRIX array of SIZE bitsets of size SIZE. |
30 `--------------------------------------------------------*/
33 bitsetv_matrix_dump (FILE * out
, const char *title
, bitsetv bset
)
36 bitset_bindex hsize
= bitset_size (bset
[0]);
39 fprintf (out
, "%s BEGIN\n", title
);
43 for (i
= 0; i
< hsize
; ++i
)
44 putc (i
/ 10 ? '0' + i
/ 10 : ' ', out
);
47 for (i
= 0; i
< hsize
; ++i
)
48 fprintf (out
, "%d", (int) (i
% 10));
53 for (i
= 0; i
< hsize
; ++i
)
58 for (i
= 0; bset
[i
]; ++i
)
60 fprintf (out
, "%2lu|", (unsigned long int) i
);
61 for (j
= 0; j
< hsize
; ++j
)
62 fputs (bitset_test (bset
[i
], j
) ? "1" : " ", out
);
68 for (i
= 0; i
< hsize
; ++i
)
73 fprintf (out
, "%s END\n\n", title
);