2011-04-18 19:02:30 +02:00
|
|
|
<?php
|
|
|
|
|
2014-02-06 14:44:16 +01:00
|
|
|
namespace PhpParser;
|
|
|
|
|
2015-06-20 11:47:25 +02:00
|
|
|
interface Parser {
|
|
|
|
/**
|
|
|
|
* Parses PHP code into a node tree.
|
|
|
|
*
|
|
|
|
* @param string $code The source code to parse
|
|
|
|
*
|
|
|
|
* @return Node[]|null Array of statements (or null if the 'throwOnError' option is disabled and the parser was
|
|
|
|
* unable to recover from an error).
|
|
|
|
*/
|
|
|
|
public function parse($code);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get array of errors that occurred during the last parse.
|
|
|
|
*
|
|
|
|
* This method may only return multiple errors if the 'throwOnError' option is disabled.
|
|
|
|
*
|
|
|
|
* @return Error[]
|
|
|
|
*/
|
|
|
|
public function getErrors();
|
|
|
|
}
|