/**
  * @param SyntaxNode $astNode
  * @return bool
  */
 public function visitSyntaxNode(SyntaxNode $astNode)
 {
     $nodeId = $this->buildDOTIdentifier($astNode);
     $this->dotWriter->writeNode($nodeId);
     $this->formatter->whitespace(1, $this->dotWriter);
     //formatting options
     $this->dotWriter->writeStatementTerminator();
     if (0 < $astNode->countChildren()) {
         $this->visitContext->pushParentId($nodeId);
     }
     return true;
 }
 /**
  * @param CommentNode $astNode
  * @return bool
  */
 public function visitCommentNode(CommentNode $astNode)
 {
     $increment = $this->visitContext->countParentIds();
     $this->formatter->indent($increment, $this->dotWriter);
     $nodeId = $this->buildNumberedDOTIdentifier('"comment[%s]"', $this->visitContext);
     $parentId = $this->visitContext->peekParentId();
     $this->dotWriter->writeEdgeStatement($parentId, $nodeId);
     $this->formatter->whitespace(1, $this->dotWriter);
     //formatting options
     $this->dotWriter->writeStatementTerminator();
     return true;
 }
 /**
  * @param GroupNode $astNode
  *
  * @return bool
  */
 public function visitGroupNode(GroupNode $astNode)
 {
     $increment = $this->visitContext->countParentIds();
     $this->formatter->indent($increment, $this->dotWriter);
     $nodeId = $this->buildNumberedDOTIdentifier('"grouped_expression[%s]"', $this->visitContext);
     $parentId = $this->visitContext->peekParentId();
     $this->dotWriter->writeEdgeStatement($parentId, $nodeId);
     $this->formatter->whitespace(1, $this->dotWriter);
     //formatting options
     $this->dotWriter->writeStatementTerminator();
     if (0 < $astNode->countChildren()) {
         $this->visitContext->pushParentId($nodeId);
     }
     return true;
 }