I tried looking around for help before posting this but either the question did not match mine or I was not able to understand the answer posted due to my lack of knowledge.
I am working on a lab and it requires us to take the following regex for a float:
$$[0-9].[0-9]+e(-)?[0-9]$$
I have the three following steps:
- Regex into regular definition
- regular definition into grammar
- Grammar into regular grammar
We have some examples in our lectures but I can't seem to understand how to do these steps, I have done some work for step 1 but I doubt it's correct.
Part 1:
$[0-9] \rightarrow Number$
$"." \rightarrow Decimal$
$e \rightarrow Exponent$
$"-" \rightarrow Negative$
Regular Definition: Number Decimal Number+ Exponent Negative? Number+
What I understood from my lecture slides was that we are naming parts of the regex and then rewriting it using the names we choose, although I've probably missed some major step here.
Part 2:
I don't know how to progress past this step, this step depends on the work from my last step so I'm hesitant to even attempt it. I have reviewed some of the material I have for grammar but I couldn't fully understand how it works. If anyone has any material that they found helpful in understanding grammar/regular grammar I'd really appreciate it.