1818import java .util .Map ;
1919import java .util .Vector ;
2020
21- import static org .antlr .codebuff .Tool .normalizedLevenshteinDistance ;
22- import static org .antlr .codebuff .Tool .tokenText ;
23- import static org .antlr .codebuff .Tool .tokenize ;
21+ import static org .antlr .codebuff .Dbg .normalizedLevenshteinDistance ;
22+ import static org .antlr .codebuff .Dbg .tokenText ;
23+ import static org .antlr .codebuff .Dbg .tokenize ;
2424import static org .antlr .codebuff .Trainer .CAT_ALIGN ;
2525import static org .antlr .codebuff .Trainer .CAT_ALIGN_WITH_ANCESTOR_CHILD ;
2626import static org .antlr .codebuff .Trainer .CAT_INDENT ;
@@ -147,7 +147,7 @@ public String format(InputDocument doc, boolean collectAnalysis) throws Exceptio
147147
148148 String prefix = originalTokens .getText (Interval .of (0 , firstToken .getTokenIndex ())); // gets any comments in front + first real token
149149 charPosInLine = firstToken .getCharPositionInLine ()+firstToken .getText ().length ()+1 ; // start where first token left off
150- line = Tool .count (prefix , '\n' ) + 1 ;
150+ line = Dbg .count (prefix , '\n' ) + 1 ;
151151 output .append (prefix );
152152
153153 // first identify oversize lists with separators
@@ -210,7 +210,7 @@ else if ( (injectNL_WS&0xFF)==CAT_INJECT_WS ) {
210210 int alignOrIndent = CAT_ALIGN ;
211211
212212 if ( newlines >0 ) {
213- output .append (Tool .newlines (newlines ));
213+ output .append (Dbg .newlines (newlines ));
214214 line +=newlines ;
215215 charPosInLine = 0 ;
216216
@@ -231,7 +231,7 @@ else if ( (alignOrIndent&0xFF)==CAT_ALIGN ) {
231231 Token firstTokenOnPrevLine = tokensOnPreviousLine .get (0 );
232232 int indentCol = firstTokenOnPrevLine .getCharPositionInLine ();
233233 charPosInLine = indentCol ;
234- output .append (Tool .spaces (indentCol ));
234+ output .append (Dbg .spaces (indentCol ));
235235 }
236236 }
237237 else if ( (alignOrIndent &0xFF )==CAT_INDENT ) {
@@ -240,7 +240,7 @@ else if ( (alignOrIndent&0xFF)==CAT_INDENT ) {
240240 }
241241 else {
242242 // inject whitespace instead of \n?
243- output .append (Tool .spaces (ws ));
243+ output .append (Dbg .spaces (ws ));
244244 charPosInLine += ws ;
245245 }
246246
@@ -275,12 +275,12 @@ public void indent(int indentCat, TerminalNode node) {
275275 if ( firstTokenOnPrevLine !=null ) { // if not on first line, we cannot indent
276276 int indentedCol = firstTokenOnPrevLine .getCharPositionInLine ()+indentSize ;
277277 charPosInLine = indentedCol ;
278- output .append (Tool .spaces (indentedCol ));
278+ output .append (Dbg .spaces (indentedCol ));
279279 }
280280 else {
281281 // no prev token? ok, just indent from left edge
282282 charPosInLine = indentSize ;
283- output .append (Tool .spaces (indentSize ));
283+ output .append (Dbg .spaces (indentSize ));
284284 }
285285 return ;
286286 }
@@ -309,7 +309,7 @@ else if ( child instanceof TerminalNode ) {
309309 if ( start !=null ) {
310310 int indentCol = start .getCharPositionInLine ()+indentSize ;
311311 charPosInLine = indentCol ;
312- output .append (Tool .spaces (indentCol ));
312+ output .append (Dbg .spaces (indentCol ));
313313 }
314314 }
315315
@@ -339,7 +339,7 @@ else if (child instanceof TerminalNode) {
339339 if ( start !=null ) {
340340 int indentCol = start .getCharPositionInLine ();
341341 charPosInLine = indentCol ;
342- output .append (Tool .spaces (indentCol ));
342+ output .append (Dbg .spaces (indentCol ));
343343 }
344344 }
345345
@@ -402,7 +402,7 @@ public int emitCommentsToTheLeft(int tokenIndexInStream, int injectNL_WS) {
402402 String hiddenText = hidden .getText ();
403403 output .append (hiddenText );
404404 if ( hiddenText .matches ("\\ n+" ) ) {
405- line += Tool .count (hiddenText , '\n' );
405+ line += Dbg .count (hiddenText , '\n' );
406406 charPosInLine = 0 ;
407407 }
408408 else {
0 commit comments