Exemplo n.º 1
0
void   print_subprogram_head(subprogram_head_t * node, int spaces) {
	print_spaces(spaces);
	fprintf(stderr, "SUBPROGRAM HEAD:\n");
	print_identifier(node->ident, spaces + SP_INDENT);
	print_parameter_list(node->params, spaces + SP_INDENT);
	print_type(node->type, spaces + SP_INDENT);
}
Exemplo n.º 2
0
/** print       print the symbol table node to the list file.
 *              First print the node's left__ subtree, then the
 *              node itself, and finally the node's right__
 *              subtree.  For the node itself, first print its
 *              symbol string, and then its line numbers.
 */
void cx_symtab_node::print(void) const {
    const int max_name_print_width = 16;

    // Pirst, print left__ subtree
    if (left__) left__->print();

    // print the node:  first the name, then the list of line numbers,
    //                  and then the identifier information.
    sprintf(list.text, "%*s", max_name_print_width, p_string);
    if (p_line_num_list) {
        p_line_num_list->print(strlen(p_string) > max_name_print_width,
                max_name_print_width);
    } else list.put_line();
    print_identifier();

    // Finally, print right__ subtree
    if (right__) right__->print();
}