I have not yet entered the field of formal languages ββin the field of computer sciences, so perhaps my question is stupid. I am writing a simple NMEA parser in C ++ and I need to choose:
My first idea was to manually create a simple state machine, but then I thought that maybe I could do it with less work, even more efficiently. I used to use regular expressions, but I think the NMEA regular expression is very long and should match it for a long time.
Then I thought about using a parser generator. I think everyone uses the same method: they generate FSA. But I do not know which is more efficient. When do you usually use parser generators instead of regular expressions (I think you could write a regular expression in a parser generator)?
Please explain the differences; I am interested in both theory and experience.
regex parser-generator
Bence
source share