nikic/PHP-Parser — pull request #154 by llaville (2014-12-02 10:48:46+00:00)
Title: Lexer option

This PR give ability to test the CLI version of the parser, using your own lexer.

For example, if you use a lexer like the one describe in [documentation](https://github.com/nikic/PHP-Parser/blob/master/doc/component/Lexer.markdown#user-content-token-offset-lexer), actually you can't test it with the CLI version without patching it.

Goal is to add a new option `--lexer` to select a new class that may be resolved in `include_path` through the standard PHP-Parser Autoloader

Take an example. With a lexer as defined below
```php
pos;
return $token;
}

public function getTokens()
{
return $this->tokens;
}
}
```
That is resolvable in the include_path (via `stream_resolve_include_path` php function), here are how to dump nodes and show token offsets attributes provided by this lexer version.

$ php php-parse.php --lexer=Bartlett\PhpParser\Lexer\TokenOffsets --var-dump file.php