Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Parser.php

interface Parser

Same name in this branch
  1. 11.1.x vendor/phpunit/phpunit/src/Metadata/Parser/Parser.php \PHPUnit\Metadata\Parser\Parser

Hierarchy

  • interface \PhpParser\Parser

Expanded class hierarchy of Parser

All classes that implement Parser

1 file declares its use of Parser
ExcludeList.php in vendor/phpunit/phpunit/src/Util/ExcludeList.php

File

vendor/nikic/php-parser/lib/PhpParser/Parser.php, line 5

Namespace

PhpParser
View source
interface Parser {
    
    /**
     * Parses PHP code into a node tree.
     *
     * @param string $code The source code to parse
     * @param ErrorHandler|null $errorHandler Error handler to use for lexer/parser errors, defaults
     *                                        to ErrorHandler\Throwing.
     *
     * @return Node\Stmt[]|null Array of statements (or null non-throwing error handler is used and
     *                          the parser was unable to recover from an error).
     */
    public function parse(string $code, ?ErrorHandler $errorHandler = null) : ?array;
    
    /**
     * Return tokens for the last parse.
     *
     * @return Token[]
     */
    public function getTokens() : array;

}

Members

Title Sort descending Modifiers Object type Summary Overrides
Parser::getTokens public function Return tokens for the last parse. 1
Parser::parse public function Parses PHP code into a node tree. 1
RSS feed
Powered by Drupal