protected function parseNode(Node $node)
{
switch (true) {
case $node instanceof Node\Stmt:
return $this->parseStatementNode($node);
case $node instanceof Node\Expr:
return $this->parseExpressionNode($node);
case $node instanceof Node\Param:
return $this->parseParameterNode($node);
case $node instanceof Node\Arg:
return $this->parseArgumentNode($node);
default:
throw new ASTException('Unsupported node type: %s', get_class($node));
}
}