Class Span

Because it is mutable, it is convenient for keeping track of the
positions of the tokens that go into a non-terminal. It can be passed
into methods, which can add the positions of tokens consumed to it.

Some patterns:

final Span s; declaration of a Span at the top of a production

s = span(); initializes s to a Span that includes the token we
just saw; very often occurs immediately after the first token in the
production

s.end(this); adds the most recent token to span s and evaluates
to a SqlParserPosition that spans from beginning to end; commonly used
when making a call to a function

s.pos() returns a position spanning all tokens in the list

s.add(node); adds a SqlNode's parser position to a span

s.addAll(nodeList); adds several SqlNodes' parser positions to
a span

s = Span.of(); initializes s to an empty Span, not even
including the most recent token; rarely used