public function pushState($stateKey, Node $node)
{
if ($this->debug) {
printf("Stacking %s %s %s %d\n", $stateKey, $node->getType(), $node->name, count($this->stateStack));
}
$state = $this->getState($stateKey);
array_unshift($this->stateStack, ['node' => $node, 'state' => $state, 'key' => $state->getName(), 'nodeType' => $node->getType()]);
}