anchor.diff:  
   blockStatements : LEGIT+ NEWLINE INDENT statement+ DEDENT ;
   
  -LEGIT : ~[ \t\r\n]+ ;   // Replace with your language-specific rules...
  -
  -NEWLINE : ( '\r'? '\n' | '\r' ) { if (pendingDent) { setChannel(HIDDEN); } pendingDent = true; indentCount = 0; } ;
  +NEWLINE : ( '\r'? '\n' | '\r' ) { if (pendingDent) { setChannel(HIDDEN); } pendingDent = true; indentCount = 0; initialIndentToken = null; } ;
   
   WS : [ \t]+ { setChannel(HIDDEN); if (pendingDent) { indentCount += getText().length(); } } ;
   
   BlockComment : '/*' ( BlockComment | . )*? '*/' -> channel(HIDDEN) ;   // allow nesting comments
   LineComment : '//' ~[\r\n]* -> channel(HIDDEN) ;
  +
  +LEGIT : ~[ \t\r\n]+ ~[\r\n]*;   // Replace with your language-specific rules...
  
positive.code: */
  
  /*
  	*	Dent is a simple grammar that illustrates implementing Python-style INDENT and DEDENT tokens. As is typical with such indentation-aware grammars, indeed what could be considered their defining characteristics: (a) NEWLINE tokens can't be ignored as whitespace, they are necessary to terminate statements; and, (b) blocks are defined as statements sandwiched between INDENT and DEDENT tokens.
  	*	Since Dent is only interested in correctly handling indentation, all the lexer and parser rules that would normally define the statements and expressions of a grammar are collapsed into a single LEGIT token, which grabs everything that is not whitespace, comment, or NEWLINE.
  	*	Dent will parse Python scripts and generate INDENT and DEDENT tokens to match the indentation present in the file. It will catch the error of an unmatched INDENT/DEDENT pair (which is a lexical error), but of course it can't determine correct Python syntax (which is the role of the parser). Dent also allows multi-line comments, something Python does not.
  	*
  	*	How Dent works:
  	*		(1) Upon encountering a NEWLINE token, we set a flag and enter a `pendingDent` state where whitespace is counted to determine the indentation of the current line.
  	*		(2) During `pendingDent` state all whitespace, comments and NEWLINE tokens are set to channel HIDDEN. In general practice, this is not an issue for whitespace and comments, which are normally HIDDEN regardless. But if needed, they could adopt the logic for NEWLINEs and switch to channel HIDDEN only in `pendingDent` state. Importantly, a NEWLINE token in `pendingDent` state resets the indentation count to 0. The upshot of all this is: (a) we ignore blank lines, even if they contain arbitrary whitespace that is inconsistent with the indentation of surrounding, non-blank lines; and, (b) for determining the indentation, whitespace is counted even if it is interrupted by a comment (and even if that is a multi-line comment).
  	*		(3) The `pendingDent` state is terminated by a non-HIDDEN token, at which point the indentation count is used to issue the proper combination of INDENT and DEDENT tokens. These are placed in a queue along with the non-HIDDEN token and the queue is emptied during subsequent calls to the lexer's `nextToken()` method.
  	*		(4) An EOF token will terminate `pendingDent` state just like any other non-HIDDEN token. It will also reset the indentation count to 0 and, if not currently in `pendingDent` state, prior to any DEDENTs it will trigger an extra NEWLINE, which is needed to close off a statement.
  	*
  
negative.code: 
  	private java.util.Stack<Integer> indentStack = new java.util.Stack<>();
  
  	private Token initialIndentToken = null;
  
  	private int getSavedIndent() { return indentStack.isEmpty() ? 0 : indentStack.peek(); }
  
  	private CommonToken createToken(int type, String text, Token next) {
  		CommonToken token = new CommonToken(type, text);
  		if (null != initialIndentToken) {
  			token.setStartIndex(initialIndentToken.getStartIndex());
  			token.setLine(initialIndentToken.getLine());
  			token.setCharPositionInLine(initialIndentToken.getCharPositionInLine());
  			token.setStopIndex(next.getStartIndex()-1);
  		}
  		return token;
  	}
  
  	@Override
  	public Token nextToken() {
  