Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions doc/creating-a-language-target.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,14 @@ Run the script from `runtime-tests` dir with
```

or whatever your test grammar, start rule, target, test input are.

### Debugging the PHP target

Because the PHP target is hosted in a separate repository, you will need to clone the [antlr/php-antlr-runtime](https://github.com/antlr/antlr-php-runtime)
repository into the `runtime/PHP` and install the dependencies with `composer install` before you can run the tests.

```
git clone -b dev https://github.com/antlr/antlr-php-runtime.git runtime/PHP
cd runtime/PHP
composer install
```
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ use Antlr\Antlr4\Runtime\Tree\TerminalNode;

$runtime = \getenv('RUNTIME');

require_once $runtime . '/vendor/autoload.php';

\spl_autoload_register(function (string $class) use ($runtime) : void {
$file = \str_replace('\\\', \DIRECTORY_SEPARATOR, \str_replace('Antlr\Antlr4\Runtime\\\', $runtime . '\\\src\\\', $class)) . '.php';
$file = \str_replace('\\\', \DIRECTORY_SEPARATOR, $class) . '.php';

if (\file_exists($file)) {
require_once $file;
Expand Down