As the title says, I have been asked to generate a grammar that defines the language of regular expressions. The symbols are: + . * | ? char

I tried and came up with this but it doesn't work when trying to create a parse tree so it's wrong but I'm so lost on how to even begin to define the different rules. So any help either on the question specifically, on improving/re-writing what I got, or general step-by-step guidance to figuring out how to write a grammar from just being given symbols is appreciated.

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.