Package com.sun.source.tree.Tree

Examples of com.sun.source.tree.Tree.Kind


    }

    private boolean equals(WrappedTreeNode other) {
      // LetExpr and TypeBoundKind throw an AssertionError on getKind(). Ignore them for computing
      // equality.
      Kind thisKind;
      Kind otherKind;
      try {
        thisKind = node.getKind();
      } catch (AssertionError e) {
        thisKind = null;
      }
View Full Code Here


    static class MyVisitor extends TreeScanner<Void,Void> {
        @Override
        public Void scan(Tree node, Void ignored) {
            if (node == null)
                return null;
            Kind k = node.getKind();
            long pos = positions.getStartPosition(null,node);
            System.out.format("%s: %s%n", k, pos);
            if (k != Kind.MODIFIERS && pos < 0)
                throw new Error("unexpected position found");
            return super.scan(node, ignored);
View Full Code Here

    public Void visitOther(Tree expected, Tree actual) {
      throw new UnsupportedOperationException("cannot compare unknown trees");
    }

    private <T extends Tree> Optional<T> checkTypeAndCast(T expected, Tree actual) {
      Kind expectedKind = checkNotNull(expected).getKind();
      Kind treeKind = checkNotNull(actual).getKind();
      if (expectedKind == treeKind) {
        @SuppressWarnings("unchecked"// checked by Kind
        T treeAsExpectedType = (T) actual;
        return Optional.of(treeAsExpectedType);
      } else {
View Full Code Here

TOP

Related Classes of com.sun.source.tree.Tree.Kind

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.