MCPcopy Index your code
hub / github.com/antlr/codebuff / getAncestor

Method getAncestor

src/org/antlr/codebuff/Trainer.java:502–510  ·  view source on GitHub ↗
(ParserRuleContext node, int delta)

Source from the content-addressed store, hash-verified

500 }
501
502 public static ParserRuleContext getAncestor(ParserRuleContext node, int delta) {
503 int n = 0;
504 ParserRuleContext p = node;
505 while ( p!=null && n!=delta ) {
506 n++;
507 p = p.getParent();
508 }
509 return p;
510 }
511
512 public int[] getFeatures(int i) {
513 CodeBuffTokenStream tokens = doc.tokens;

Callers 2

indentMethod · 0.95
alignMethod · 0.95

Calls 1

getParentMethod · 0.45

Tested by

no test coverage detected