Exemple #1
0
void
verbose(void)
{
    int i;

    if (!vflag)
	return;

    null_rules = (short *)MALLOC((unsigned)nrules * sizeof(short));
    NO_SPACE(null_rules);

    fprintf(verbose_file, "\f\n");
    for (i = 0; i < nstates; i++)
	print_state(i);
    FREE(null_rules);

    if (nunused)
	log_unused();
    if (SRtotal || RRtotal)
	log_conflicts();

    fprintf(verbose_file, "\n\n%d terminals, %d nonterminals\n", ntokens,
	    nvars);
    fprintf(verbose_file, "%d grammar rules, %d states\n", nrules - 2, nstates);
}
Exemple #2
0
void verbose(void)
{
    register int i;

    if (!vflag) return;

    null_rules = (Yshort *) NEW2(nrules, null_rules[0]);
    if (null_rules == 0) no_space();

    BtYacc_puts("\f\n", verbose_file);

    for (i = 0; i < nstates; ++i)
        print_state(i);
    FREE(null_rules);

    if (nunused)
        log_unused();
    if (SRtotal || RRtotal)
        log_conflicts();

    print_tokens();

    BtYacc_printf(verbose_file, "\n\n%d terminals, %d nonterminals\n%d grammar rules, %d states\n",
                  ntokens, nvars, nrules - 2, nstates);
}
Exemple #3
0
void verbose(void)
{
    register int i;

    if (!vflag)
	return xml_output();
    
	
	/* else */
    null_rules = (short *)MALLOC(nrules * sizeof(short));
    if (null_rules == 0)
	no_space();
    fprintf(verbose_file, "\f\n");
    for (i = 0; i < nstates; i++)
	print_state(i);
    FREE(null_rules);

    if (nunused)
	log_unused();
    if (SRtotal || RRtotal)
	log_conflicts();

    fprintf(verbose_file, "\n\n%d terminals, %d nonterminals\n", ntokens,
	    nvars);
    fprintf(verbose_file, "%d grammar rules, %d states\n", nrules - 2, nstates);
}
Exemple #4
0
void
verbose(void)
{
	int i;

	if (!vflag)
		return;

	null_rules = malloc(nrules * sizeof(short));
	if (null_rules == NULL)
		no_space();
	fprintf(verbose_file, "\f\n");
	for (i = 0; i < nstates; i++)
		print_state(i);
	free(null_rules);

	if (nunused)
		log_unused();
	if (SRtotal || RRtotal)
		log_conflicts();

	fprintf(verbose_file, "\n\n%d terminals, %d nonterminals\n", ntokens,
	    nvars);
	fprintf(verbose_file, "%d grammar rules, %d states\n", nrules - 2,
	    nstates);
}
Exemple #5
0
void verbose (void)
{
    int i;

    if (!vflag)
        return;

    null_rules = TMALLOC (Value_t, nrules);
    NO_SPACE (null_rules);

    fprintf (verbose_file, "\f\n");
    for (i = 0; i < nstates; i++)
        print_state (i);
    FREE (null_rules);

    if (nunused)
        log_unused ();
    if (SRtotal || RRtotal)
        log_conflicts ();

    fprintf (verbose_file, "\n\n%d terminals, %d nonterminals\n", ntokens,
             nvars);
    fprintf (verbose_file, "%d grammar rules, %d states\n", nrules - 2,
             nstates);
#if defined(YYBTYACC)
    { /* print out the grammar symbol # and parser internal symbol # for each
     symbol as an aide to writing the implementation for YYDESTRUCT_CALL()
     and YYSTYPE_TOSTRING() */
        int maxtok = 0;

        fputs ("\ngrammar parser grammar\n", verbose_file);
        fputs ("symbol# value# symbol\n", verbose_file);
        for (i = 0; i < ntokens; ++i)
        {
            fprintf (verbose_file, " %5d  %5d  %s\n", i, symbol_value[i],
                     symbol_name[i]);
            if (symbol_value[i] > maxtok)
                maxtok = symbol_value[i];
        }
        for (i = ntokens; i < nsyms; ++i)
            fprintf (verbose_file, " %5d  %5d  %s\n", i,
                     (maxtok + 1) + symbol_value[i] + 1, symbol_name[i]);
    }
#endif
}