/**
  * @param IdentifierNode $astNode
  * @return bool
  * @throws \DomainException
  */
 public function visitIdentifierNode(IdentifierNode $astNode)
 {
     $name = $astNode->getIdentifierName();
     $uppercase = strtoupper($name);
     if ($uppercase == $name) {
         $expression = new ExpressionSymbol(Symbol::TYPE_TERMINAL, $name);
         $this->visitContext->pushExpression($expression);
         return true;
     }
     $lowercase = strtolower($name);
     if ($lowercase == $name) {
         $expression = new ExpressionSymbol(Symbol::TYPE_NON_TERMINAL, $name);
         $this->visitContext->pushExpression($expression);
         return true;
     }
     throw new \DomainException('unknown type of identifier name');
 }
 /**
  * @param IdentifierNode $astNode
  * @return string
  */
 protected function buildDOTIdentifier(IdentifierNode $astNode)
 {
     $idNumber = $this->visitContext->getNodeCount();
     $identifierName = $astNode->getIdentifierName();
     return sprintf('"%s[%s]"', $identifierName, $idNumber);
 }