MCPcopy Create free account
hub / github.com/antlr/codebuff / getHPosCategoryStr

Method getHPosCategoryStr

src/org/antlr/codebuff/Formatter.java:485–495  ·  view source on GitHub ↗
(int alignOrIndent)

Source from the content-addressed store, hash-verified

483 }
484
485 public static String getHPosCategoryStr(int alignOrIndent) {
486 int[] elements = Trainer.triple(alignOrIndent);
487 int cat = alignOrIndent&0xFF;
488 String catS = "align";
489 if ( cat==CAT_ALIGN_WITH_ANCESTOR_CHILD ) catS = "align^";
490 else if ( cat==CAT_INDENT_FROM_ANCESTOR_CHILD ) catS = "indent^";
491 else if ( cat==CAT_ALIGN ) catS = "align";
492 else if ( cat==CAT_INDENT ) catS = "indent";
493 else return null;
494 return String.format("%7s|%d|%d", catS, elements[0], elements[1]);
495 }
496
497 /** Do not join two words like "finaldouble" or numbers like "3double",
498 * "double3", "34", (3 and 4 are different tokens) etc...

Callers 4

getPredictionAnalysisMethod · 0.95
getTokenAnalysisMethod · 0.95
getExemplarDisplayMethod · 0.95
toStringMethod · 0.80

Calls 2

tripleMethod · 0.95
formatMethod · 0.45

Tested by

no test coverage detected