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.95k stars 3.26k forks source link

Any plan for upgrade ANTLR4's grammar type from antlr3 to antlr4? #4111

Open cyqw opened 1 year ago

cyqw commented 1 year ago

https://github.com/antlr/antlr4/blob/master/tool/src/org/antlr/v4/parse/ANTLRLexer.g

kaby76 commented 1 year ago

It would be nice, but it's probably not going to happen anytime soon. https://github.com/antlr/antlr4/issues/2327 In the meanwhile, use the grammars-v4 version, which is used in a number of projects. https://github.com/antlr/grammars-v4/tree/master/antlr/antlr4

cyqw commented 1 year ago

I will do the migrate,, maybe need some months.

KvanTTT commented 1 year ago

Why do you need this? I have some developments in this topic.

kaby76 commented 1 year ago

Not only is the Antlr Tool is dependent on the Antlr3 tool and runtime, but also StringTemplate, which is Antlr3 tool and runtime dependent as well.

cyqw commented 1 year ago

I want make some tool about embeded language. VTL in YAML, SQL in XML etc. The grammar is hard because I need copy embeded language's grammar to other container grammar's. I found the improve feature about import that discuss in https://github.com/antlr/antlr4/issues/256. import grammar under some mode.define tokens in few mode one time. When I browse the Antlr tool's code, I think antlr4 type is better than antlr3 type for add new feature to antlr4.

KvanTTT commented 1 year ago

In the future, I plan to develop a new parser generator based on ANTLR. It will be almost compatible with ANTLR grammars and also will have some new features that I consider very useful. Maybe this info is useful for your.

cyqw commented 1 year ago

It is a good news.