Converts a name lex token into a name parse node.

@return NameNode
@throws SyntaxErrorException
348366
protected function lexName(): NameNode
    {
        $token = $this->expect(TokenKindEnum::NAME);

        return new NameNode($token->getValue(), $this->createLocation($token));
    }
653718
private function getIdentifier()
    {
        // grab the first bit of the identifier
        if ($this->lexer->isNextTokenAny(self::$classIdentifiers)) {
            $this->lexer->moveNext();

            $name = $this->lexer->token['value'];
        } else {
            throw SyntaxException::expectedToken(
                'namespace separator or identifier',
                null,
                $this->lexer
            );
        }

        // grab the remaining bits
        $position = $this->lexer->token['position']
                  + strlen($this->lexer->token['value']);

        while (($this->lexer->lookahead['position'] === $position)
            && $this->lexer->isNextToken(DocLexer::T_NAMESPACE_SEPARATOR)) {
            $this->match(DocLexer::T_NAMESPACE_SEPARATOR);
            $this->matchAny(self::$classIdentifiers);

            $name .= '\\' . $this->lexer->token['value'];
        }

        return $name;
    }
428588
protected function lexSelectionSet(): SelectionSetNode
    {
        $start = $this->lexer->getToken();

        return new SelectionSetNode(
            $this->many(
                TokenKindEnum::BRACE_L,
                [$this, 'lexSelection'],
                TokenKindEnum::BRACE_R
            ),
            $this->createLocation($start)
        );
    }
1287100
protected function lexFragment(): FragmentNodeInterface
    {
        $start = $this->lexer->getToken();

        $this->expect(TokenKindEnum::SPREAD);

        $token = $this->lexer->getToken();

        if (KeywordEnum::ON !== $token->getValue() && $this->peek(TokenKindEnum::NAME)) {
            return new FragmentSpreadNode(
                $this->lexFragmentName($token),
                $this->lexDirectives(),
                null,
                $this->createLocation($start)
            );
        }

        if (KeywordEnum::ON === $token->getValue()) {
            $this->lexer->advance();
            $typeCondition = $this->lexNamedType();
        }

        return new InlineFragmentNode(
            $typeCondition ?? null,
            $this->lexDirectives(),
            $this->lexSelectionSet(),
            $this->createLocation($start)
        );
    }
283949
function getName()
  	{
  		$name = $this->_name;

  		if (empty($name)) {
  			$r = null;
  			if (! preg_match( '/Com(.*)/i', get_class( $this ), $r)) {
                throw new AnErrorException(
                    "Can't get or parse the class name ",
                    AnHttpResponse::INTERNAL_SERVER_ERROR
                );
  			}
  			$name = strtolower($r[1]);
  		}

  		return $name;
  	}
1256523
public function lexConfig()
    {
        $source = $this->source;
        if ($source->cursor >= $source->bound) {
            $this->addError("The parser did not find the '{$source->leftDelimiter}#' configuration item start tag", $source->cursor);
            return null;
        }
        $tree = new TreeMap();
        if (Sdopx::$debug) {
            $tree->setDebugInfo($source->getDebugInfo());
        }
        Rules::reset($source->leftDelimiter, $source->rightDelimiter);
        $next = ['openConfig' => 1];
        do {
            $data = $this->match($next);
            if ($data == null) {
                $this->addError("The template tag syntax in the configuration item is incorrectly formatted.", $source->cursor);
                return null;
            }
            $tag = $data['tag'];
            $source->cursor = $data['end'];
            $data['node'] = null;
            $tree->push($data);
            if ($tag == 'closeConfig') {
                return $tree;
            }
            $next = Rules::getItem($tag, 'next');
        } while (true);
    }
594496
public function getTokenName()
    {
        $session = \PHPSession::singleton();

        if ($session->hasAttribute(TokenStore::TOKEN_NAME)) {
            $name = $session->getAttribute(TokenStore::TOKEN_NAME);
        } else {
            $name = 'tao_' . substr(md5(microtime()), rand(0, 25), 7);
            $session->setAttribute(TokenStore::TOKEN_NAME, $name);
        }

        return $name;
    }
211234
protected Name parseName( TokenStream tokens ) {
        String value = tokens.consume();
        try {
            return nameFactory.create(removeQuotes(value));
        } catch (ValueFormatException e) {
            if (e.getCause() instanceof NamespaceException) {
                throw (NamespaceException)e.getCause();
            }
            throw new ParsingException(tokens.previousPosition(), CndI18n.expectedValidNameLiteral.text(value));
        }
    }
602371
private Node parseFieldName(JsDocToken token) {
    switch (token) {
      case STRING:
        String s = stream.getString();
        Node n = Node.newString(
            Token.STRING_KEY, s, stream.getLineno(), stream.getCharno())
            .clonePropsFrom(templateNode);
        n.setLength(s.length());
        return n;

      default:
        return null;
    }
  }
49847
public function setName($name) {
    /** @var TokenNode $function_name */
    $function_name = $this->getName()->firstChild();
    $function_name->setText($name);
    return $this;
  }
1233969
public function setName($name) {
    /** @var TokenNode $identifier */
    $identifier = $this->name->firstChild();
    $identifier->setText($name);
    return $this;
  }
714932
public function getName()
    {
        if ($this->_name === null) {
            $endpoint = namespaceSplit(get_class($this));
            $endpoint = substr(end($endpoint), 0, -8);

            $inflectMethod = $this->getInflectionMethod();
            $this->_name = Inflector::$inflectMethod($endpoint);
        }

        return $this->_name;
    }
146852
protected Name parseNodeTypeName( TokenStream tokens ) {
        tokens.consume('[');
        Name name = parseName(tokens);
        tokens.consume(']');
        return name;
    }
237766
public function parseNamespace()
    {
        $name = '';
        while (($token = $this->next()) && ($token[0] === T_STRING || $token[0] === T_NS_SEPARATOR)) {
            $name .= $token[1];
        }

        return $name;
    }
273405
function parse() {
        $name_without_parens = preg_replace('/[{}]/', '', $this->full_name);

        $parts = explode('::', $name_without_parens);
        $name_without_case_keys = trim($parts[0]);
        array_shift($parts);
        $this->case_keys = array_map('trim', $parts);

        $parts = explode(':', $name_without_case_keys);
        $this->short_name = trim($parts[0]);
        array_shift($parts);
        $this->context_keys = array_map('trim', $parts);
    }
789216
private function constDeclaration() {
    $node = new ConstantDeclarationNode();
    $name_node = new NameNode();
    $this->mustMatch(T_STRING, $name_node, NULL, TRUE);
    $node->addChild($name_node, 'name');
    if ($this->mustMatch('=', $node)) {
      $node->addChild($this->staticScalar(), 'value');
    }
    return $node;
  }
797599
function(){
        var node = this.parseAdd();
        while(this.skipValue(lexer.TOKEN_TILDE, '~')) {
            var node2 = this.parseAdd();
            node = new nodes.Concat(node.lineno,
                                 node.colno,
                                 node,
                                 node2);
        }
        return node;
    }