Parse the code with AST and build up a tree of handlers and messages which can be visualised with a given tool.