Question: Hello, I am having issues translating BNF/EBNF grammar into a Antlr4 Grammar file with proper Parser/Lexer rules. Below are screenshots of the grammar and a
Hello, I am having issues translating BNF/EBNF grammar into a Antlr4 Grammar file with proper Parser/Lexer rules.
Below are screenshots of the grammar and a small guide of Antlr4 syntax. I am hoping to use this grammar file to generate a parser and lexer in java.

Grammar specification for Antlr below:

I am trying to create a correct grammar .g4 file with the corresponding BNF/EBNF I linked. Thanks in advance for any help or tips!
2 Grammar The grammer specifies the syntax of regular expressions. The grammar has three unary operators, *4. and ?' These are all quantifiers of equal precedence. The precedence of all operators, from highest to lowest, is as follows: parentheses, quantifiers, character sequence (or concatenation), and alternation. The BNF given below specifies the precedence hierarchy. The BNF grammar specifies the structure of concrete syntax trees, but with one exception. We allow operators such as "" to take an arbitrary number of arguments. Therefore the arguments will all be at the same level in the hierarchy. BNF 2.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
