This case code of yours doesn't look good... If you want a whitespace as a separator simply change your grammar, you don't have to change the lexer except maybe removing the part that handles commas. You don't need to report a separator, just return numbers.
Here is EBNF for comma separated lines
CommaSeparatedLine ::== Number, { Separator, Number } ;
CommaSeparatedLine ::== Number, { Separator, Number } ;
To copy to clipboard, switch view to plain text mode
And here is one for space separated lines:
SpaceSeparatedLine ::== Number, { Number } ;
SpaceSeparatedLine ::== Number, { Number } ;
To copy to clipboard, switch view to plain text mode
In the second case you simply don't handle commas. As the lexer returns the value of Number and not single digits it should be easy.
Oh, and about your question about printing enum names. It's possible in Qt when you register an enum in a metaobject using Q_ENUMS.
Bookmarks