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

Breadcrumb

  1. Drupal Core 11.1.x

Parser.php

Same filename in this branch
  1. 11.1.x vendor/open-telemetry/api/Baggage/Propagation/Parser.php
  2. 11.1.x vendor/phpunit/phpunit/src/Metadata/Parser/Parser.php
  3. 11.1.x vendor/sebastian/cli-parser/src/Parser.php
  4. 11.1.x vendor/sebastian/diff/src/Parser.php
  5. 11.1.x vendor/egulias/email-validator/src/Parser.php
  6. 11.1.x vendor/twig/twig/src/Parser.php
  7. 11.1.x vendor/symfony/css-selector/Parser/Parser.php
  8. 11.1.x vendor/symfony/yaml/Parser.php
  9. 11.1.x vendor/mck89/peast/lib/Peast/Selector/Parser.php
  10. 11.1.x vendor/mck89/peast/lib/Peast/Syntax/Parser.php
  11. 11.1.x vendor/mck89/peast/lib/Peast/Syntax/JSX/Parser.php

Namespace

PhpParser

File

vendor/nikic/php-parser/lib/PhpParser/Parser.php

View source
<?php

declare (strict_types=1);
namespace PhpParser;

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;

}

Interfaces

Title Deprecated Summary
Parser

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal