我用flex&bison写了一个compiler,生成了一个syntax tree

输入文件是这样的:
!PRAGMA_DAGSIZE 2000
!PRAGMA_INCPSIZE 20
!PRAGMA_OUTCPSIZE 31
subroutine s1()
!PRAGMA_LOCALDAGSIZE 1000
call s2()
end
!PRAGMA_DAGSIZE 1000
!PRAGMA_INCPSIZE 10
!PRAGMA_OUTCPSIZE 10
subroutine s2()
!PRAGMA_LOCALDAGSIZE 500
call s3()
end
!PRAGMA_DAGSIZE 500
!PRAGMA_INCPSIZE 10
!PRAGMA_OUTCPSIZE 10
subroutine s3()
end
我想生成一个calltree
s1
此处为箭头(call)
s2
此处为箭头(call)
s3
如何实现?