private void setErrorState(int errorAt, int errorIndex, ErrorType errorType) { this.currentErrorIndex = errorIndex; this.currentErrorAt = errorAt; this.currentErrorType = errorType; this.currentErrorNode = trace.getCurrentNode(); this.encountered = null; this.errors.clear(); }
@Override public void setStateAs(ParserTrace that) { current = that.getCurrentNode(); } };
final ParseTree buildParseTree() { TreeNode currentNode = trace.getCurrentNode(); if (currentNode == null) return null; return currentNode.freeze(getIndex()).toParseTree(); }