ParseTreeMatch.java 文件源码

java
阅读 22 收藏 0 点赞 0 评论 0

项目:Scratch-ApuC 作者:
/**
 * Constructs a new instance of {@link ParseTreeMatch} from the specified
 * parse tree and pattern.
 *
 * @param tree The parse tree to match against the pattern.
 * @param pattern The parse tree pattern.
 * @param labels A mapping from label names to collections of
 * {@link ParseTree} objects located by the tree pattern matching process.
 * @param mismatchedNode The first node which failed to match the tree
 * pattern during the matching process.
 *
 * @exception IllegalArgumentException if {@code tree} is {@code null}
 * @exception IllegalArgumentException if {@code pattern} is {@code null}
 * @exception IllegalArgumentException if {@code labels} is {@code null}
 */
public ParseTreeMatch(@NotNull ParseTree tree, @NotNull ParseTreePattern pattern, @NotNull MultiMap<String, ParseTree> labels, @Nullable ParseTree mismatchedNode) {
    if (tree == null) {
        throw new IllegalArgumentException("tree cannot be null");
    }

    if (pattern == null) {
        throw new IllegalArgumentException("pattern cannot be null");
    }

    if (labels == null) {
        throw new IllegalArgumentException("labels cannot be null");
    }

    this.tree = tree;
    this.pattern = pattern;
    this.labels = labels;
    this.mismatchedNode = mismatchedNode;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号