public String visitChildren(RuleNode node) {
int n = node.getChildCount();
if (n > 1) {
StringBuilder result = new StringBuilder();
ParseTree child;
String childResult;
for (int i = 0; i < n; i++) {
child = node.getChild(i);
childResult = child.accept(this);
if (childResult != null) {
if (i > 0) {
result.append(' ');
}
result.append(childResult);
}
}
return result.toString();
} else {
if (n == 1) {
return node.getChild(0).accept(this);
} else {
return node.getText();
}
}
}
StringCreatingVisitor.java 文件源码
java
阅读 22
收藏 0
点赞 0
评论 0
项目:Cetus
作者:
评论列表
文章目录