antlr / grammars-v4

Grammars written for ANTLR v4; expectation that the grammars are free of actions.
MIT License
10.15k stars 3.7k forks source link

[Request] New Grammar for Franca IDL #3622

Open mungyujeong opened 1 year ago

mungyujeong commented 1 year ago

Hello, is there any plan to add new grammar for Franca IDL?

kaby76 commented 1 year ago

The grammar for Franca IDL is here: https://github.com/franca/franca/blob/3ecc4798bef05804580feb228444398686e850a4/plugins/org.franca.core.dsl/src/org/franca/core/dsl/FrancaIDL.xtext. It is in XText. The grammar contains tree construction actions. (Flame: This should never, ever be done. Always separate CFG from the AST specification from the static semantics.) It should be possible to scrape the grammar for the EBNF and turn that into Antlr4.

The good news is that this grammar hasn't changed in five years. But, I don't know if it's versioned. Nor do I know if there's a formal spec.

Note, I do recall converting XText to Antlr4 before, and wrote a little note to myself on the ordeal. The XText grammar can be converted to Antlr3, then converted easily to Antlr4 using Trash. But XText is wrapped up extremely tightly with the Eclipse IDE.