Skip to content

Added Cursor::get_children() method

Ole Christian Eidheim requested to merge Windfisch:get_children into master

Created by: Windfisch

While this is not an 1:1 mapping of the original API, it's very helpful for tree-like access to the AST, e.g. like this:

void print_tree(Cursor c, int level=0)
{
  for (int i=0; i<level; i++) cout << "|   ";
  cout << c.get_kind_spelling() << ": " << c.get_spelling() << endl;
  for (auto& child : c.get_children())
    print_tree(child, level+1);
}

Merge request reports