< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/tree/JCTree.java

Print this page
@@ -131,10 +131,14 @@
  
          /** While-loops, of type WhileLoop.
           */
          WHILELOOP,
  
+         /** Withfields, of type WithField.
+          */
+         WITHFIELD,
+ 
          /** For-loops, of type ForLoop.
           */
          FORLOOP,
  
          /** Foreach-loops, of type ForeachLoop.

@@ -250,10 +254,14 @@
  
          /** Selections, of type Select.
           */
          SELECT,
  
+         /** Default values, of type DefaultValueTree.
+          */
+         DEFAULT_VALUE,
+ 
          /** Member references, of type Reference.
           */
          REFERENCE,
  
          /** Simple identifiers, of type Ident.

@@ -719,11 +727,10 @@
          @Override
          public JCExpression setPos(int pos) {
              super.setPos(pos);
              return this;
          }
- 
          public boolean isPoly() { return false; }
          public boolean isStandalone() { return true; }
  
          @Override
          public boolean isExpression() {

@@ -888,10 +895,13 @@
          public JCBlock body;
          /** default value, for annotation types */
          public JCExpression defaultValue;
          /** method symbol */
          public MethodSymbol sym;
+         /** nascent value that evolves into the return value for a value factory */
+         public VarSymbol factoryProduct;
+ 
          /** does this method completes normally */
          public boolean completesNormally;
  
          protected JCMethodDecl(JCModifiers mods,
                              Name name,

@@ -1167,10 +1177,40 @@
          public Tag getTag() {
              return WHILELOOP;
          }
      }
  
+     /**
+      * A withfield expression
+      */
+     public static class JCWithField extends JCExpression implements WithFieldTree {
+         public JCExpression field;
+         public JCExpression value;
+         protected JCWithField(JCExpression field, JCExpression value) {
+             this.field = field;
+             this.value = value;
+         }
+         @Override
+         public void accept(Visitor v) { v.visitWithField(this); }
+ 
+         @DefinedBy(Api.COMPILER_TREE)
+         public Kind getKind() { return Kind.WITH_FIELD; }
+         @DefinedBy(Api.COMPILER_TREE)
+         public JCExpression getField() { return field; }
+         @DefinedBy(Api.COMPILER_TREE)
+         public JCExpression getValue() { return value; }
+         @Override @DefinedBy(Api.COMPILER_TREE)
+         public <R,D> R accept(TreeVisitor<R,D> v, D d) {
+             return v.visitWithField(this, d);
+         }
+ 
+         @Override
+         public Tag getTag() {
+             return WITHFIELD;
+         }
+     }
+ 
      /**
       * A for loop.
       */
      public static class JCForLoop extends JCStatement implements ForLoopTree {
          public List<JCStatement> init;

@@ -1360,10 +1400,36 @@
          public Tag getTag() {
              return CASE;
          }
      }
  
+     /**
+      * A "Identifier<TA1, TA2>.default" construction.
+      */
+     public static class JCDefaultValue extends JCPolyExpression implements DefaultValueTree {
+         public JCExpression clazz;
+ 
+         protected JCDefaultValue(JCExpression clazz) {
+             this.clazz = clazz;
+         }
+         @Override
+         public void accept(Visitor v) { v.visitDefaultValue(this); }
+ 
+         @DefinedBy(Api.COMPILER_TREE)
+         public Kind getKind() { return Kind.DEFAULT_VALUE; }
+         @Override @DefinedBy(Api.COMPILER_TREE)
+         public JCExpression getType() { return clazz; }
+         @Override @DefinedBy(Api.COMPILER_TREE)
+         public <R,D> R accept(TreeVisitor<R,D> v, D d) {
+             return v.visitDefaultValue(this, d);
+         }
+         @Override
+         public Tag getTag() {
+             return DEFAULT_VALUE;
+         }
+     }
+ 
      /**
       * A "switch ( ) { }" construction.
       */
      public static class JCSwitchExpression extends JCPolyExpression implements SwitchExpressionTree {
          public JCExpression selector;

@@ -3338,10 +3404,11 @@
          JCLabeledStatement Labelled(Name label, JCStatement body);
          JCSwitch Switch(JCExpression selector, List<JCCase> cases);
          JCSwitchExpression SwitchExpression(JCExpression selector, List<JCCase> cases);
          JCCase Case(CaseTree.CaseKind caseKind, List<JCCaseLabel> labels,
                      List<JCStatement> stats, JCTree body);
+         JCDefaultValue DefaultValue(JCExpression type);
          JCSynchronized Synchronized(JCExpression lock, JCBlock body);
          JCTry Try(JCBlock body, List<JCCatch> catchers, JCBlock finalizer);
          JCTry Try(List<JCTree> resources,
                    JCBlock body,
                    List<JCCatch> catchers,

@@ -3410,15 +3477,17 @@
          public void visitVarDef(JCVariableDecl that)         { visitTree(that); }
          public void visitSkip(JCSkip that)                   { visitTree(that); }
          public void visitBlock(JCBlock that)                 { visitTree(that); }
          public void visitDoLoop(JCDoWhileLoop that)          { visitTree(that); }
          public void visitWhileLoop(JCWhileLoop that)         { visitTree(that); }
+         public void visitWithField(JCWithField that)         { visitTree(that); }
          public void visitForLoop(JCForLoop that)             { visitTree(that); }
          public void visitForeachLoop(JCEnhancedForLoop that) { visitTree(that); }
          public void visitLabelled(JCLabeledStatement that)   { visitTree(that); }
          public void visitSwitch(JCSwitch that)               { visitTree(that); }
          public void visitCase(JCCase that)                   { visitTree(that); }
+         public void visitDefaultValue(JCDefaultValue that) { visitTree(that); }
          public void visitSwitchExpression(JCSwitchExpression that)               { visitTree(that); }
          public void visitSynchronized(JCSynchronized that)   { visitTree(that); }
          public void visitTry(JCTry that)                     { visitTree(that); }
          public void visitCatch(JCCatch that)                 { visitTree(that); }
          public void visitConditional(JCConditional that)     { visitTree(that); }
< prev index next >