I want to write my own command line library from scratch. What algorithm should I use in order to parse gnu style args like in getopt for example ? I mean what's the best way other than tokenizing and parse them in a naive way? Should I try to look at LR, LL algorithms or this is way too overkill?
An LL(1) parser is a top down left to right parser, that needs only to know one symbol in advance. This is sufficient to parse a command line syntax.
But constructing an LL(1) parser seems to be an overkill for this kind of tasks, where a loop, a couple of
ifs and some flags would completely do the trick.