antlr / antlr4

ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files.
http://antlr.org
BSD 3-Clause "New" or "Revised" License
16.99k stars 3.26k forks source link

PHP target runtime crashes with "Undefined offset: 0 in ATNDeserializer.php on line 731" #3509

Open kaby76 opened 2 years ago

kaby76 commented 2 years ago

This was my first pass on the grammars with the PHP target, on Ubuntu 20.04 LTS (GNU/Linux 5.10.60.1-microsoft-standard-WSL2 x86_64). PHP 7.4.3 (cli) (built: Nov 25 2021 23:16:22) ( NTS ), Antlr 4.9.3, composer1, make, bash. This code is generated using trgen. Attached is a complete example, "cd Generated; make; make test". Generated.zip

For the grammars that do work, PHP performance is actually pretty good.

KvanTTT commented 2 years ago

Could you please also provide ATNDeserializer.php?

kaby76 commented 2 years ago

Could you please also provide ATNDeserializer.php?

At some point, we really should set up some shared containers to work off of. That way we have an environment for any target.

Attached in a complete build, including the Antlr PHP runtime. Generated.zip