How do I fetch tokens on demand not all at once up front?
CommonTokenStream sucks in all tokens up front until EOF. This works fine for files, but does not work for interactive programs or programs sucking from a socket. I will add a class to handle this to v3.2 probably. In the meantime, here is one I'm using ... Other labels:
buffering
How can I emit more than a single token per lexer rule?
Here is a rule to match floats: NUMFLOAT : DIGITS '.' (DIGITS)? (EXPONENTPART)? (FLOATTYPESUFFIX)? '.' DIGITS (EXPONENTPART)? (FLOATTYPESUFFIX)? DIGITS EXPONENTPART FLOATTYPESUFFIX DIGITS EXPONENTPART DIGITS FLOATTYPESUFFIX ; Now if you want to add '..' range operator so 1..10 makes sense ...