(ParseTree t)
| 986 | } |
| 987 | |
| 988 | public static int getChildIndex(ParseTree t) { |
| 989 | if ( t==null ) return -1; |
| 990 | ParseTree parent = t.getParent(); |
| 991 | if ( parent==null ) { |
| 992 | return -1; |
| 993 | } |
| 994 | // Figure out which child index t is of parent |
| 995 | for (int i = 0; i<parent.getChildCount(); i++) { |
| 996 | if ( parent.getChild(i)==t ) { |
| 997 | return i; |
| 998 | } |
| 999 | } |
| 1000 | return -1; |
| 1001 | } |
| 1002 | |
| 1003 | public static int rulealt(ParserRuleContext r) { |
| 1004 | return rulealt(r.getRuleIndex(), r.getAltNumber()); |
no test coverage detected