grammars-v4
grammars-v4 copied to clipboard
Grammars written for ANTLR v4; expectation that the grammars are free of actions.
After carefully analyzed `singleExpression` in JavaScript, I found the current model might be improper and would like to propose a redesign. # Problems `singleExpression` is a general concept that is...
In current state parser will not create a proper AST with case like this ````sql CREATE TABLE [Person].[Person]( [BusinessEntityID] [int] NOT NULL, [PersonType] [nchar](2) NOT NULL, [AdditionalContactInfo] xml(CONTENT [Person].[AdditionalContactInfoSchemaCollection]) NULL,...
It makes it simpler to work with the parsed tree.
Fixes: #2826
``` expression : multiplyingExpression ((PLUS | MINUS) multiplyingExpression)* ; ``` The grammars in [Calculator.g4](https://github.com/antlr/grammars-v4/blob/2e2dcd917de910e21e94e893ac1bf1c366cfc9b5/calculator/calculator.g4#L40) can not be easily parsed unless modifying it to this: ``` expression : multiplyingExpression (plusMinus multiplyingExpression)*...
In [ANTLR discussion 3321](https://github.com/antlr/antlr4/discussions/3321#discussioncomment-3642335), @kaby76 wrote: > _But, even before this change, there is an ambiguity for input "binary_good1 = '1'b > " in [single_instruction](https://github.com/antlr/grammars-v4/blob/553522db0536ca80e0535351a19bdd8cbcc14e77/rexx/RexxParser.g4#L29), in choosing between [assignment](https://github.com/antlr/grammars-v4/blob/553522db0536ca80e0535351a19bdd8cbcc14e77/rexx/RexxParser.g4#L33) and...
The SQLite language syntax defines a `sql-stmt-list` that consists of zero, one or more `sql-stmt`s. Each `sql-stmt` should be separated by a semicolon. See [https://www.sqlite.org/lang.html](https://www.sqlite.org/lang.html). Here is a simple example...
With the recent port to Antlr 4.11.1, we discovered a couple of the grammars required some tweaking. But, as noted [here](https://github.com/antlr/antlr4/issues/3875#issuecomment-1242668939), we can simplify the asm8080 grammar further. **We should...
While using the grammars-v4/bnf grammar for creating an ebnf, I noticed several errors: * [LPAREN](https://github.com/antlr/grammars-v4/blob/07314e4615982ba77864d7b8cd804c7b5d803bb0/bnf/bnf.g4#L91), [RPARENT](https://github.com/antlr/grammars-v4/blob/07314e4615982ba77864d7b8cd804c7b5d803bb0/bnf/bnf.g4#L95) and the other symmetrical character symbols are reversed on [how it is usually defined](https://wumbo.net/symbols/right-parenthesis/)....
The current Rexx grammar supports several non-standard syntaxes. These are peculiar to one dialect of Rexx, and should be moved to a separate grammar that makes it clear which dialect...