From the global namespace, is possible to iterate through all namespaces:
foreach (NamespaceSymbol @namespace in globalNamespace.GetNamespaceMembers())
From each namespace, it is possible to iterate through their classes:
foreach (NamedTypeSymbol @class in @namespace.GetTypeMembers())
The same happens with classes and methods or fields:
foreach (Symbol member in @class.GetMembers())
Yet, I could not find any way to iterate through a method’s statements. How can I keep traversing down the semantic tree?
You need to find the SyntaxNode that was used to declare the symbol:
How to find the SyntaxNode for a method Symbol in a CompilationUnit?
Then once you have the SyntaxNode (e.g. MethodDeclarationSyntax) you can walk it e.g. using DescendantNodes() or ChildNodesAndTokens.