public static void _getAllLeaves(Tree t, List<? super Tree> leaves,
final int startIndex,
final int stopIndex)
{
int n = t.getChildCount();
if ( n==0 ) { // must be leaf
Token tok = ((TerminalNode)t).getSymbol();
int i = tok.getTokenIndex();
if ( i>=startIndex && i<=stopIndex && tok.getType() != Token.INVALID_TYPE ) {
leaves.add(t);
}
return;
}
for (int i = 0 ; i < n ; i++){
_getAllLeaves(t.getChild(i), leaves, startIndex, stopIndex);
}
}
ParsingUtils.java 文件源码
java
阅读 26
收藏 0
点赞 0
评论 0
项目:intellij-plugin-v4
作者:
评论列表
文章目录