git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1482
4a8a32a2-be11-0410-ad9d-
d568d2c75423
}
if (tree->opval.op == FUNCTION) {
}
if (tree->opval.op == FUNCTION) {
- fprintf(outfile,"FUNCTION (%p) type (",tree);
+ int arg=0;
+ value *args=FUNC_ARGS(tree->left->opval.val->type);
+ fprintf(outfile,"FUNCTION (%s=%p) type (",
+ tree->left->opval.val->name, tree);
printTypeChain (tree->ftype,outfile);
printTypeChain (tree->ftype,outfile);
+ fprintf(outfile,") args (");
+ do {
+ if (arg) {
+ fprintf (outfile, ", ");
+ }
+ printTypeChain (args->type, outfile);
+ arg++;
+ args=args->next;
+ } while (args);
- ast_print(tree->left,outfile,indent+4);
- ast_print(tree->right,outfile,indent+4);
+ ast_print(tree->left,outfile,indent);
+ ast_print(tree->right,outfile,indent);
return ;
}
if (tree->opval.op == BLOCK) {
symbol *decls = tree->values.sym;
return ;
}
if (tree->opval.op == BLOCK) {
symbol *decls = tree->values.sym;
- INDENT(indent+4,outfile);
+ INDENT(indent,outfile);
fprintf(outfile,"{\n");
while (decls) {
INDENT(indent+4,outfile);
fprintf(outfile,"{\n");
while (decls) {
INDENT(indent+4,outfile);
- fprintf(outfile,"DECLARE SYMBOL %s, type(",decls->name);
+ fprintf(outfile,"DECLARE SYMBOL (%s=%p) type (",
+ decls->name, decls);
printTypeChain(decls->type,outfile);
fprintf(outfile,")\n");
decls = decls->next;
}
ast_print(tree->right,outfile,indent+4);
printTypeChain(decls->type,outfile);
fprintf(outfile,")\n");
decls = decls->next;
}
ast_print(tree->right,outfile,indent+4);
- INDENT(indent+4,outfile);
+ INDENT(indent,outfile);
fprintf(outfile,"}\n");
return;
}
fprintf(outfile,"}\n");
return;
}
} else {
fprintf(outfile,"SYMBOL ");
}
} else {
fprintf(outfile,"SYMBOL ");
}
- fprintf(outfile,"(%p) name= %s ",tree,tree->opval.val->sym->name);
+ fprintf(outfile,"(%s=%p)",
+ tree->opval.val->sym->name,tree);
}
if (tree->ftype) {
fprintf(outfile," type (");
}
if (tree->ftype) {
fprintf(outfile," type (");
/* casting */
/*----------------------------*/
case CAST: /* change the type */
/* casting */
/*----------------------------*/
case CAST: /* change the type */
- fprintf(outfile,"CAST (%p) type (",tree);
+ fprintf(outfile,"CAST (%p) from type (",tree);
+ printTypeChain(tree->right->ftype,outfile);
+ fprintf(outfile,") to type (");
printTypeChain(tree->ftype,outfile);
fprintf(outfile,")\n");
ast_print(tree->right,outfile,indent+4);
printTypeChain(tree->ftype,outfile);
fprintf(outfile,")\n");
ast_print(tree->right,outfile,indent+4);
- fprintf (of, "**err**");