public function getKeys($recursive = TRUE) {
    $keys = new NodeCollection();
    $index = 0;
    foreach ($this->elements->getItems() as $element) {
      if ($element instanceof ArrayPairNode) {
        $keys->add($element->getKey());
        $value = $element->getValue();
      }
      else {
        $keys->add(Token::integer($index++));
        $value = $element;
      }

      if ($recursive && $value instanceof ArrayNode) {
        $keys->add($value->getKeys($recursive));
      }
    }
    return $keys;
  }