antlr / antlr-php-runtime

PHP Runtime for ANTLR4
BSD 3-Clause "New" or "Revised" License
81 stars 19 forks source link

There is no Antlr PHP runtime for 4.13.0 #40

Closed kaby76 closed 1 year ago

kaby76 commented 1 year ago

We need a PHP Antlr 4.13.0 runtime published. See also https://github.com/antlr/antlr-php-runtime/issues/39.

$ make test
bash test.sh
Test failed.
PHP Warning:  ANTLR Tool version 4.13.0 used for code generation does not match the current runtime version 4.12.0 in C:\msys64\home\Kenne\issues\g4-3522\abb\Generated-PHP\vendor\antlr\antlr4-php-runtime\src\RuntimeMetaData.php on line 140
PHP Stack trace:
PHP   1. {main}() C:\msys64\home\Kenne\issues\g4-3522\abb\Generated-PHP\Test.php:0
PHP   2. main($argv = [0 => 'Test.php', 1 => '-q', 2 => '-x', 3 => '-tee', 4 => '-tree']) C:\msys64\home\Kenne\issues\g4-3522\abb\Generated-PHP\Test.php:228
PHP   3. ParseFilename($input = '../examples/robdata.sys', $row_number = 0) C:\msys64\home\Kenne\issues\g4-3522\abb\Generated-PHP\Test.php:125
PHP   4. DoParse($str = class Antlr\Antlr4\Runtime\InputStream { protected int $index = 0; protected int $size = 340; public string $name = '<empty>'; public string $input = 'module robdata(sysmodule)\n\n\tPERS tooldata tMain:=[TRUE,[[0.0,0.0,700.0],[1.0,0.0,0.0,0.0]],[0.0,[5.0,0,95.5],[1,0,0,0],0.228,0.094,0]];\n\tPERS wobjdata wobjMain:= [FALSE, TRUE, "", [[0, 0, 0],[1, 0, 0, 0]],[[0, 0, 0],[1, 0, 0, 0]]];\n\tCONST speeddata v200:=[200,500,5000,1000];\n\t\n\tPROC ConfigOn()\n\t\tConfJ\\On;\n\t\tConfL\\On;\n\tENDPROC\n  \nendmodule'; public array $characters = [0 => 'm', 1 => 'o', 2 => 'd', 3 => 'u', 4 => 'l', 5 => 'e', 6 => ' ', 7 => 'r', 8 => 'o', 9 => 'b', 10 => 'd', 11 => 'a', 12 => 't', 13 => 'a', 14 => '(', 15 => 's', 16 => 'y', 17 => 's', 18 => 'm', 19 => 'o', 20 => 'd', 21 => 'u', 22 => 'l', 23 => 'e', 24 => ')', 25 => '\n', 26 => '\n', 27 => '\t', 28 => 'P', 29 => 'E', 30 => 'R', 31 => 'S', 32 => ' ', 33 => 't', 34 => 'o', 35 => 'o', 36 => 'l', 37 => 'd', 38 => 'a', 39 => 't', 40 => 'a', 41 => ' ', 42 => 't', 43 => 'M', 44 => 'a', 45 => 'i', 46 => 'n', 47 => ':', 48 => '=', 49 => '[', 50 => 'T', 51 => 'R', 52 => 'U', 53 => 'E', 54 => ',', 55 => '[', 56 => '[', 57 => '0', 58 => '.', 59 => '0', 60 => ',', 61 => '0', 62 => '.', 63 => '0', 64 => ',', 65 => '7', 66 => '0', 67 => '0', 68 => '.', 69 => '0', 70 => ']', 71 => ',', 72 => '[', 73 => '1', 74 => '.', 75 => '0', 76 => ',', 77 => '0', 78 => '.', 79 => '0', 80 => ',', 81 => '0', 82 => '.', 83 => '0', 84 => ',', 85 => '0', 86 => '.', 87 => '0', 88 => ']', 89 => ']', 90 => ',', 91 => '[', 92 => '0', 93 => '.', 94 => '0', 95 => ',', 96 => '[', 97 => '5', 98 => '.', 99 => '0', 100 => ',', 101 => '0', 102 => ',', 103 => '9', 104 => '5', 105 => '.', 106 => '5', 107 => ']', 108 => ',', 109 => '[', 110 => '1', 111 => ',', 112 => '0', 113 => ',', 114 => '0', 115 => ',', 116 => '0', 117 => ']', 118 => ',', 119 => '0', 120 => '.', 121 => '2', 122 => '2', 123 => '8', 124 => ',', 125 => '0', 126 => '.', 127 => '0', ...] }, $input_name = '../examples/robdata.sys', $row_number = 0) C:\msys64\home\Kenne\issues\g4-3522\abb\Generated-PHP\Test.php:156
PHP   5. abbLexer->__construct($input = class Antlr\Antlr4\Runtime\InputStream { protected int $index = 0; protected int $size = 340; public string $name = '<empty>'; public string $input = 'module robdata(sysmodule)\n\n\tPERS tooldata tMain:=[TRUE,[[0.0,0.0,700.0],[1.0,0.0,0.0,0.0]],[0.0,[5.0,0,95.5],[1,0,0,0],0.228,0.094,0]];\n\tPERS wobjdata wobjMain:= [FALSE, TRUE, "", [[0, 0, 0],[1, 0, 0, 0]],[[0, 0, 0],[1, 0, 0, 0]]];\n\tCONST speeddata v200:=[200,500,5000,1000];\n\t\n\tPROC ConfigOn()\n\t\tConfJ\\On;\n\t\tConfL\\On;\n\tENDPROC\n  \nendmodule'; public array $characters = [0 => 'm', 1 => 'o', 2 => 'd', 3 => 'u', 4 => 'l', 5 => 'e', 6 => ' ', 7 => 'r', 8 => 'o', 9 => 'b', 10 => 'd', 11 => 'a', 12 => 't', 13 => 'a', 14 => '(', 15 => 's', 16 => 'y', 17 => 's', 18 => 'm', 19 => 'o', 20 => 'd', 21 => 'u', 22 => 'l', 23 => 'e', 24 => ')', 25 => '\n', 26 => '\n', 27 => '\t', 28 => 'P', 29 => 'E', 30 => 'R', 31 => 'S', 32 => ' ', 33 => 't', 34 => 'o', 35 => 'o', 36 => 'l', 37 => 'd', 38 => 'a', 39 => 't', 40 => 'a', 41 => ' ', 42 => 't', 43 => 'M', 44 => 'a', 45 => 'i', 46 => 'n', 47 => ':', 48 => '=', 49 => '[', 50 => 'T', 51 => 'R', 52 => 'U', 53 => 'E', 54 => ',', 55 => '[', 56 => '[', 57 => '0', 58 => '.', 59 => '0', 60 => ',', 61 => '0', 62 => '.', 63 => '0', 64 => ',', 65 => '7', 66 => '0', 67 => '0', 68 => '.', 69 => '0', 70 => ']', 71 => ',', 72 => '[', 73 => '1', 74 => '.', 75 => '0', 76 => ',', 77 => '0', 78 => '.', 79 => '0', 80 => ',', 81 => '0', 82 => '.', 83 => '0', 84 => ',', 85 => '0', 86 => '.', 87 => '0', 88 => ']', 89 => ']', 90 => ',', 91 => '[', 92 => '0', 93 => '.', 94 => '0', 95 => ',', 96 => '[', 97 => '5', 98 => '.', 99 => '0', 100 => ',', 101 => '0', 102 => ',', 103 => '9', 104 => '5', 105 => '.', 106 => '5', 107 => ']', 108 => ',', 109 => '[', 110 => '1', 111 => ',', 112 => '0', 113 => ',', 114 => '0', 115 => ',', 116 => '0', 117 => ']', 118 => ',', 119 => '0', 120 => '.', 121 => '2', 122 => '2', 123 => '8', 124 => ',', 125 => '0', 126 => '.', 127 => '0', ...] }) C:\msys64\home\Kenne\issues\g4-3522\abb\Generated-PHP\Test.php:169
PHP   6. abbLexer::initialize() C:\msys64\home\Kenne\issues\g4-3522\abb\Generated-PHP\abbLexer.php:313
PHP   7. Antlr\Antlr4\Runtime\RuntimeMetaData::checkVersion($generatingToolVersion = '4.13.0', $compileTimeVersion = '4.12.0') C:\msys64\home\Kenne\issues\g4-3522\abb\Generated-PHP\abbLexer.php:324
PHP   8. trigger_error($message = 'ANTLR Tool version 4.13.0 used for code generation does not match the current runtime version 4.12.0', $error_level = 512) C:\msys64\home\Kenne\issues\g4-3522\abb\Generated-PHP\vendor\antlr\antlr4-php-runtime\src\RuntimeMetaData.php:140
PHP Warning:  ANTLR Tool version 4.13.0 used for code generation does not match the current runtime version 4.12.0 in C:\msys64\home\Kenne\issues\g4-3522\abb\Generated-PHP\vendor\antlr\antlr4-php-runtime\src\RuntimeMetaData.php on line 140
PHP Stack trace:
PHP   1. {main}() C:\msys64\home\Kenne\issues\g4-3522\abb\Generated-PHP\Test.php:0
PHP   2. main($argv = [0 => 'Test.php', 1 => '-q', 2 => '-x', 3 => '-tee', 4 => '-tree']) C:\msys64\home\Kenne\issues\g4-3522\abb\Generated-PHP\Test.php:228
PHP   3. ParseFilename($input = '../examples/robdata.sys', $row_number = 0) C:\msys64\home\Kenne\issues\g4-3522\abb\Generated-PHP\Test.php:125
PHP   4. DoParse($str = class Antlr\Antlr4\Runtime\InputStream { protected int $index = 0; protected int $size = 340; public string $name = '<empty>'; public string $input = 'module robdata(sysmodule)\n\n\tPERS tooldata tMain:=[TRUE,[[0.0,0.0,700.0],[1.0,0.0,0.0,0.0]],[0.0,[5.0,0,95.5],[1,0,0,0],0.228,0.094,0]];\n\tPERS wobjdata wobjMain:= [FALSE, TRUE, "", [[0, 0, 0],[1, 0, 0, 0]],[[0, 0, 0],[1, 0, 0, 0]]];\n\tCONST speeddata v200:=[200,500,5000,1000];\n\t\n\tPROC ConfigOn()\n\t\tConfJ\\On;\n\t\tConfL\\On;\n\tENDPROC\n  \nendmodule'; public array $characters = [0 => 'm', 1 => 'o', 2 => 'd', 3 => 'u', 4 => 'l', 5 => 'e', 6 => ' ', 7 => 'r', 8 => 'o', 9 => 'b', 10 => 'd', 11 => 'a', 12 => 't', 13 => 'a', 14 => '(', 15 => 's', 16 => 'y', 17 => 's', 18 => 'm', 19 => 'o', 20 => 'd', 21 => 'u', 22 => 'l', 23 => 'e', 24 => ')', 25 => '\n', 26 => '\n', 27 => '\t', 28 => 'P', 29 => 'E', 30 => 'R', 31 => 'S', 32 => ' ', 33 => 't', 34 => 'o', 35 => 'o', 36 => 'l', 37 => 'd', 38 => 'a', 39 => 't', 40 => 'a', 41 => ' ', 42 => 't', 43 => 'M', 44 => 'a', 45 => 'i', 46 => 'n', 47 => ':', 48 => '=', 49 => '[', 50 => 'T', 51 => 'R', 52 => 'U', 53 => 'E', 54 => ',', 55 => '[', 56 => '[', 57 => '0', 58 => '.', 59 => '0', 60 => ',', 61 => '0', 62 => '.', 63 => '0', 64 => ',', 65 => '7', 66 => '0', 67 => '0', 68 => '.', 69 => '0', 70 => ']', 71 => ',', 72 => '[', 73 => '1', 74 => '.', 75 => '0', 76 => ',', 77 => '0', 78 => '.', 79 => '0', 80 => ',', 81 => '0', 82 => '.', 83 => '0', 84 => ',', 85 => '0', 86 => '.', 87 => '0', 88 => ']', 89 => ']', 90 => ',', 91 => '[', 92 => '0', 93 => '.', 94 => '0', 95 => ',', 96 => '[', 97 => '5', 98 => '.', 99 => '0', 100 => ',', 101 => '0', 102 => ',', 103 => '9', 104 => '5', 105 => '.', 106 => '5', 107 => ']', 108 => ',', 109 => '[', 110 => '1', 111 => ',', 112 => '0', 113 => ',', 114 => '0', 115 => ',', 116 => '0', 117 => ']', 118 => ',', 119 => '0', 120 => '.', 121 => '2', 122 => '2', 123 => '8', 124 => ',', 125 => '0', 126 => '.', 127 => '0', ...] }, $input_name = '../examples/robdata.sys', $row_number = 0) C:\msys64\home\Kenne\issues\g4-3522\abb\Generated-PHP\Test.php:156
PHP   5. abbParser->__construct($input = class Antlr\Antlr4\Runtime\CommonTokenStream { protected Antlr\Antlr4\Runtime\TokenSource $tokenSource = class abbLexer { public array $log = [...]; private array ${Antlr\Antlr4\Runtime\Recognizer}listeners = [...]; protected ?Antlr\Antlr4\Runtime\Atn\ATNSimulator $interp = class Antlr\Antlr4\Runtime\Atn\LexerATNSimulator { ... }; private int ${Antlr\Antlr4\Runtime\Recognizer}stateNumber = -1; public ?Antlr\Antlr4\Runtime\CharStream $input = class Antlr\Antlr4\Runtime\InputStream { ... }; protected Antlr\Antlr4\Runtime\Utils\Pair $tokenFactorySourcePair = class Antlr\Antlr4\Runtime\Utils\Pair { ... }; protected Antlr\Antlr4\Runtime\TokenFactory $factory = class Antlr\Antlr4\Runtime\CommonTokenFactory { ... }; public ?Antlr\Antlr4\Runtime\Token $token = NULL; public int $tokenStartCharIndex = -1; public int $tokenStartLine = -1; public int $tokenStartCharPositionInLine = -1; public bool $hitEOF = FALSE; public int $channel = 0; public int $type = 0; public array $modeStack = [...]; public int $mode = 0; public ?string $text = NULL }; protected array $tokens = []; protected int $index = -1; protected bool $fetchedEOF = FALSE; protected int $channel = 0 }) C:\msys64\home\Kenne\issues\g4-3522\abb\Generated-PHP\Test.php:191
PHP   6. abbParser::initialize() C:\msys64\home\Kenne\issues\g4-3522\abb\Generated-PHP\abbParser.php:160
PHP   7. Antlr\Antlr4\Runtime\RuntimeMetaData::checkVersion($generatingToolVersion = '4.13.0', $compileTimeVersion = '4.12.0') C:\msys64\home\Kenne\issues\g4-3522\abb\Generated-PHP\abbParser.php:171
PHP   8. trigger_error($message = 'ANTLR Tool version 4.13.0 used for code generation does not match the current runtime version 4.12.0', $error_level = 512) C:\msys64\home\Kenne\issues\g4-3522\abb\Generated-PHP\vendor\antlr\antlr4-php-runtime\src\RuntimeMetaData.php:140
mingw32-make: *** [makefile:8: test] Error 1
06/15-14:29:37 ~/issues/g4-3522/abb/Generated-PHP
$
marcospassos commented 1 year ago

Can you open a PR bumping the version, pls?

kaby76 commented 1 year ago

Closing. There is now a 4.13.1 release. The fix involves:

1) making a change in the source code 2) publishing a release here

I am not the right person to make a release in this process (nor did I know what is required to be changed for the release). In the targets umbrellaed within the antlr4 repo, the admin (Parr) bumps the version number in the code (here and here), and publishes the release (also which I have no idea how to do).