I’m implementing a regular expression parser by using algorithms in the dragon book. Now I can generate a DTran table and parse some basic regular expressions like: (a|b)*abb.
But I encountered a problem when implementing the . symbol, which matches any character. There is no text about it in the dragon book, is there some examples or articles about implementing it?
Solve it yourself, that is the fun of it. Below is not much an answer, but nevertheless.
It is really rather similar to other pattern matching, like *, and remember multiple matches could occur on the same text; which is why maybe the left it out (A Dtran or state machine gets hard when the grammar is rich); plus it is really similar, but accepts an char. Heck you might have to switch to an NFA (nondeterministic finite automaton) to keep it simple.
Clearly I have not worked through the dragon book, but covered it in college, “The theory of computation”. I drew many state machines.