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

Method indexOf

src/org/antlr/codebuff/misc/BuffUtils.java:15–22  ·  view source on GitHub ↗
(ParserRuleContext parent, ParseTree child)

Source from the content-addressed store, hash-verified

13public class BuffUtils {
14
15 public static int indexOf(ParserRuleContext parent, ParseTree child) {
16 for (int i = 0; i<parent.getChildCount(); i++) {
17 if ( parent.getChild(i)==child ) {
18 return i;
19 }
20 }
21 return -1;
22 }
23
24 // Generic filtering, mapping, joining that should be in the standard library but aren't
25 public static <T> T findFirst(List<T> data, Predicate<T> pred) {

Callers 3

getSeparatorsMethod · 0.95
enterEveryRuleMethod · 0.45

Calls 2

getChildCountMethod · 0.45
getChildMethod · 0.45

Tested by

no test coverage detected