antlr / antlr-php-runtime

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

JSON.g4 parser generation leads to symbol conflict (array) #3

Closed prasad83 closed 4 years ago

prasad83 commented 4 years ago

antlr4 -Dlanguage=PHP JSON.g4

error(134): JSON.g4:20:0: symbol array conflicts with generated code in target language or runtime

Replacing (array) to (arr) in JSON.g4 works.

marcospassos commented 4 years ago

Hi @prasad83!

Yeah, that's because array is a reserved word in PHP. What about opening an issue (and a PR) on https://github.com/antlr/grammars-v4 with this change?

prasad83 commented 4 years ago

thank you @marcospassos - I did send a PR

marcospassos commented 4 years ago

Closing as it seems to be addressed by https://github.com/antlr/grammars-v4/pull/1653