File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,8 +15,9 @@ addfirstsets(grammar *g)
1515{
1616 int i ;
1717 dfa * d ;
18-
19- printf ("Adding FIRST sets ...\n" );
18+
19+ if (Py_DebugFlag )
20+ printf ("Adding FIRST sets ...\n" );
2021 for (i = 0 ; i < g -> g_ndfas ; i ++ ) {
2122 d = & g -> g_dfa [i ];
2223 if (d -> d_first == NULL )
Original file line number Diff line number Diff line change @@ -149,8 +149,9 @@ metacompile(node *n)
149149{
150150 nfagrammar * gr ;
151151 int i ;
152-
153- printf ("Compiling (meta-) parse tree into NFA grammar\n" );
152+
153+ if (Py_DebugFlag )
154+ printf ("Compiling (meta-) parse tree into NFA grammar\n" );
154155 gr = newnfagrammar ();
155156 REQ (n , MSTART );
156157 i = n -> n_nchildren - 1 ; /* Last child is ENDMARKER */
@@ -645,8 +646,8 @@ maketables(nfagrammar *gr)
645646 if (Py_DebugFlag ) {
646647 printf ("Dump of NFA for '%s' ...\n" , nf -> nf_name );
647648 dumpnfa (& gr -> gr_ll , nf );
649+ printf ("Making DFA for '%s' ...\n" , nf -> nf_name );
648650 }
649- printf ("Making DFA for '%s' ...\n" , nf -> nf_name );
650651 d = adddfa (g , nf -> nf_type , nf -> nf_name );
651652 makedfa (gr , gr -> gr_nfa [i ], d );
652653 }
Original file line number Diff line number Diff line change @@ -62,15 +62,17 @@ main(int argc, char **argv)
6262 perror (graminit_c );
6363 Py_Exit (1 );
6464 }
65- printf ("Writing %s ...\n" , graminit_c );
65+ if (Py_DebugFlag )
66+ printf ("Writing %s ...\n" , graminit_c );
6667 printgrammar (g , fp );
6768 fclose (fp );
6869 fp = fopen (graminit_h , "w" );
6970 if (fp == NULL ) {
7071 perror (graminit_h );
7172 Py_Exit (1 );
7273 }
73- printf ("Writing %s ...\n" , graminit_h );
74+ if (Py_DebugFlag )
75+ printf ("Writing %s ...\n" , graminit_h );
7476 printnonterminals (g , fp );
7577 fclose (fp );
7678 Py_Exit (0 );
You can’t perform that action at this time.
0 commit comments