antlr / grammars-v4

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

The latest rego grammar is required #3428

Open gitchong opened 1 year ago

gitchong commented 1 year ago

When I use the old grammar, the rego input file cannot be recognized correctly. Since I am a rookie and cannot modify the lexer and parser very well, I need the latest rego grammar. I am going to use java to check whether the rego file is grammatically correct with the help of antlr v4. Please help me if there is an easier way, thanks a lot

kaby76 commented 1 year ago

It took a while to find the "Spec", but the most up-to-date version of the grammar appears to be here: https://www.openpolicyagent.org/docs/latest/policy-reference/#grammar. That's a start.