public Token consume() {
		Token o = getCurrentToken();
		if (o.getType() != EOF) {
			getInputStream().consume();
		}
		boolean hasListener = _parseListeners != null && !_parseListeners.isEmpty();
		if (_buildParseTrees || hasListener) {
			if ( _errHandler.inErrorRecoveryMode(this) ) {
				ErrorNode node = _ctx.addErrorNode(createErrorNode(_ctx,o));
				if (_parseListeners != null) {
					for (ParseTreeListener listener : _parseListeners) {
						listener.visitErrorNode(node);
					}
				}
			}
			else {
				TerminalNode node = _ctx.addChild(createTerminalNode(_ctx,o));
				if (_parseListeners != null) {
					for (ParseTreeListener listener : _parseListeners) {
						listener.visitTerminal(node);
					}
				}
			}
		}
		return o;
	}
Consume and return the {@linkplain #getCurrentToken current symbol}.

<p>E.g., given the following input with {@code A} being the current
lookahead symbol, this function moves the cursor to {@code B} and returns
{@code A}.</p>

<pre>
 A B
 ^
</pre>

If the parser is not in error recovery mode, the consumed symbol is added
to the parse tree using {@link ParserRuleContext#addChild(TerminalNode)}, and
{@link ParseTreeListener#visitTerminal} is called on any parse listeners.
If the parser <em>is</em> in error recovery mode, the consumed symbol is
added to the parse tree using {@link #createErrorNode(ParserRuleContext, Token)} then
{@link ParserRuleContext#addErrorNode(ErrorNode)} and
{@link ParseTreeListener#visitErrorNode} is called on any parse
listeners.
runtime/Java/src/org/antlr/v4/runtime/Parser.java