3 ms·
I've always used a state machine whenever I've parsed XML using an event based parser (SAX). Although lately I've been replacing an explicit state variable wit
by kennu 15y ago
I've always used a state machine whenever I've parsed XML using an event based parser (SAX).
Although lately I've been replacing an explicit state variable with a stack containing the current element path, since that's pretty easy to do using modern languages.
- caf 15y agoParsing textual formats in general usually ends up being a state machine - eg. CSV is another one.