Cloneable Instantiable
public __construct ( array $parsers )

Create a parser which will try multiple parsers in an order of preference.

Parsers will be invoked in the order they're provided to the constructor. If one of the
parsers runs without throwing, it's output is returned. Otherwise the exception that the
first parser generated is thrown.

public parse ( string $code , ? PhpParser\ErrorHandler $errorHandler = NULL )
private $parsers
  • var Parser [] List of parsers to try, in order of preference
private tryParse ( PhpParser\Parser $parser , PhpParser\ErrorHandler $errorHandler , $code )
© 2020 Bruce Wells
Search Namespaces \ Classes
Configuration Numbers (0-9.) only