< prev index next >

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

Print this page

 116         /** Variable definitions, of type VarDef.
 117          */
 118         VARDEF,
 119 
 120         /** The no-op statement ";", of type Skip
 121          */
 122         SKIP,
 123 
 124         /** Blocks, of type Block.
 125          */
 126         BLOCK,
 127 
 128         /** Do-while loops, of type DoLoop.
 129          */
 130         DOLOOP,
 131 
 132         /** While-loops, of type WhileLoop.
 133          */
 134         WHILELOOP,
 135 




 136         /** For-loops, of type ForLoop.
 137          */
 138         FORLOOP,
 139 
 140         /** Foreach-loops, of type ForeachLoop.
 141          */
 142         FOREACHLOOP,
 143 
 144         /** Labelled statements, of type Labelled.
 145          */
 146         LABELLED,
 147 
 148         /** Switch statements, of type Switch.
 149          */
 150         SWITCH,
 151 
 152         /** Case parts in switch statements/expressions, of type Case.
 153          */
 154         CASE,
 155 

 235 
 236         /** Type test expressions, of type TypeTest.
 237          */
 238         TYPETEST,
 239 
 240         /** Patterns.
 241          */
 242         BINDINGPATTERN,
 243         DEFAULTCASELABEL,
 244         GUARDPATTERN,
 245         PARENTHESIZEDPATTERN,
 246 
 247         /** Indexed array expressions, of type Indexed.
 248          */
 249         INDEXED,
 250 
 251         /** Selections, of type Select.
 252          */
 253         SELECT,
 254 




 255         /** Member references, of type Reference.
 256          */
 257         REFERENCE,
 258 
 259         /** Simple identifiers, of type Ident.
 260          */
 261         IDENT,
 262 
 263         /** Literals, of type Literal.
 264          */
 265         LITERAL,
 266 
 267         /** Basic type identifiers, of type TypeIdent.
 268          */
 269         TYPEIDENT,
 270 
 271         /** Array types, of type TypeArray.
 272          */
 273         TYPEARRAY,
 274 

 704 
 705     public static abstract class JCCaseLabel extends JCTree implements CaseLabelTree {
 706         public abstract boolean isExpression();
 707         public boolean isNullPattern() {
 708             return isExpression() && TreeInfo.isNull((JCExpression) this);
 709         }
 710         public abstract boolean isPattern();
 711     }
 712 
 713     public static abstract class JCExpression extends JCCaseLabel implements ExpressionTree {
 714         @Override
 715         public JCExpression setType(Type type) {
 716             super.setType(type);
 717             return this;
 718         }
 719         @Override
 720         public JCExpression setPos(int pos) {
 721             super.setPos(pos);
 722             return this;
 723         }
 724 
 725         public boolean isPoly() { return false; }
 726         public boolean isStandalone() { return true; }
 727 
 728         @Override
 729         public boolean isExpression() {
 730             return true;
 731         }
 732 
 733         @Override
 734         public boolean isPattern() {
 735             return false;
 736         }
 737     }
 738 
 739     /**
 740      * Common supertype for all poly expression trees (lambda, method references,
 741      * conditionals, method and constructor calls)
 742      */
 743     public static abstract class JCPolyExpression extends JCExpression {
 744 

 873         /** method modifiers */
 874         public JCModifiers mods;
 875         /** method name */
 876         public Name name;
 877         /** type of method return value */
 878         public JCExpression restype;
 879         /** type parameters */
 880         public List<JCTypeParameter> typarams;
 881         /** receiver parameter */
 882         public JCVariableDecl recvparam;
 883         /** value parameters */
 884         public List<JCVariableDecl> params;
 885         /** exceptions thrown by this method */
 886         public List<JCExpression> thrown;
 887         /** statements in the method */
 888         public JCBlock body;
 889         /** default value, for annotation types */
 890         public JCExpression defaultValue;
 891         /** method symbol */
 892         public MethodSymbol sym;



 893         /** does this method completes normally */
 894         public boolean completesNormally;
 895 
 896         protected JCMethodDecl(JCModifiers mods,
 897                             Name name,
 898                             JCExpression restype,
 899                             List<JCTypeParameter> typarams,
 900                             JCVariableDecl recvparam,
 901                             List<JCVariableDecl> params,
 902                             List<JCExpression> thrown,
 903                             JCBlock body,
 904                             JCExpression defaultValue,
 905                             MethodSymbol sym)
 906         {
 907             this.mods = mods;
 908             this.name = name;
 909             this.restype = restype;
 910             this.typarams = typarams;
 911             this.params = params;
 912             this.recvparam = recvparam;

1152         @Override
1153         public void accept(Visitor v) { v.visitWhileLoop(this); }
1154 
1155         @DefinedBy(Api.COMPILER_TREE)
1156         public Kind getKind() { return Kind.WHILE_LOOP; }
1157         @DefinedBy(Api.COMPILER_TREE)
1158         public JCExpression getCondition() { return cond; }
1159         @DefinedBy(Api.COMPILER_TREE)
1160         public JCStatement getStatement() { return body; }
1161         @Override @DefinedBy(Api.COMPILER_TREE)
1162         public <R,D> R accept(TreeVisitor<R,D> v, D d) {
1163             return v.visitWhileLoop(this, d);
1164         }
1165 
1166         @Override
1167         public Tag getTag() {
1168             return WHILELOOP;
1169         }
1170     }
1171 






























1172     /**
1173      * A for loop.
1174      */
1175     public static class JCForLoop extends JCStatement implements ForLoopTree {
1176         public List<JCStatement> init;
1177         public JCExpression cond;
1178         public List<JCExpressionStatement> step;
1179         public JCStatement body;
1180         protected JCForLoop(List<JCStatement> init,
1181                           JCExpression cond,
1182                           List<JCExpressionStatement> update,
1183                           JCStatement body)
1184         {
1185             this.init = init;
1186             this.cond = cond;
1187             this.step = update;
1188             this.body = body;
1189         }
1190         @Override
1191         public void accept(Visitor v) { v.visitForLoop(this); }

1345         @Override @DefinedBy(Api.COMPILER_TREE)
1346         public List<JCStatement> getStatements() {
1347             return caseKind == CaseKind.STATEMENT ? stats : null;
1348         }
1349         @Override @DefinedBy(Api.COMPILER_TREE)
1350         public JCTree getBody() { return body; }
1351         @Override @DefinedBy(Api.COMPILER_TREE)
1352         public CaseKind getCaseKind() {
1353             return caseKind;
1354         }
1355         @Override @DefinedBy(Api.COMPILER_TREE)
1356         public <R,D> R accept(TreeVisitor<R,D> v, D d) {
1357             return v.visitCase(this, d);
1358         }
1359         @Override
1360         public Tag getTag() {
1361             return CASE;
1362         }
1363     }
1364 


























1365     /**
1366      * A "switch ( ) { }" construction.
1367      */
1368     public static class JCSwitchExpression extends JCPolyExpression implements SwitchExpressionTree {
1369         public JCExpression selector;
1370         public List<JCCase> cases;
1371         /** Position of closing brace, optional. */
1372         public int endpos = Position.NOPOS;
1373         public boolean hasTotalPattern;
1374         public boolean patternSwitch;
1375         protected JCSwitchExpression(JCExpression selector, List<JCCase> cases) {
1376             this.selector = selector;
1377             this.cases = cases;
1378         }
1379         @Override
1380         public void accept(Visitor v) { v.visitSwitchExpression(this); }
1381 
1382         @DefinedBy(Api.COMPILER_TREE)
1383         public Kind getKind() { return Kind.SWITCH_EXPRESSION; }
1384         @DefinedBy(Api.COMPILER_TREE)

3323                             JCBlock body,
3324                             JCExpression defaultValue);
3325         JCVariableDecl VarDef(JCModifiers mods,
3326                       Name name,
3327                       JCExpression vartype,
3328                       JCExpression init);
3329         JCSkip Skip();
3330         JCBlock Block(long flags, List<JCStatement> stats);
3331         JCDoWhileLoop DoLoop(JCStatement body, JCExpression cond);
3332         JCWhileLoop WhileLoop(JCExpression cond, JCStatement body);
3333         JCForLoop ForLoop(List<JCStatement> init,
3334                         JCExpression cond,
3335                         List<JCExpressionStatement> step,
3336                         JCStatement body);
3337         JCEnhancedForLoop ForeachLoop(JCVariableDecl var, JCExpression expr, JCStatement body);
3338         JCLabeledStatement Labelled(Name label, JCStatement body);
3339         JCSwitch Switch(JCExpression selector, List<JCCase> cases);
3340         JCSwitchExpression SwitchExpression(JCExpression selector, List<JCCase> cases);
3341         JCCase Case(CaseTree.CaseKind caseKind, List<JCCaseLabel> labels,
3342                     List<JCStatement> stats, JCTree body);

3343         JCSynchronized Synchronized(JCExpression lock, JCBlock body);
3344         JCTry Try(JCBlock body, List<JCCatch> catchers, JCBlock finalizer);
3345         JCTry Try(List<JCTree> resources,
3346                   JCBlock body,
3347                   List<JCCatch> catchers,
3348                   JCBlock finalizer);
3349         JCCatch Catch(JCVariableDecl param, JCBlock body);
3350         JCConditional Conditional(JCExpression cond,
3351                                 JCExpression thenpart,
3352                                 JCExpression elsepart);
3353         JCIf If(JCExpression cond, JCStatement thenpart, JCStatement elsepart);
3354         JCExpressionStatement Exec(JCExpression expr);
3355         JCBreak Break(Name label);
3356         JCYield Yield(JCExpression value);
3357         JCContinue Continue(Name label);
3358         JCReturn Return(JCExpression expr);
3359         JCThrow Throw(JCExpression expr);
3360         JCAssert Assert(JCExpression cond, JCExpression detail);
3361         JCMethodInvocation Apply(List<JCExpression> typeargs,
3362                     JCExpression fn,

3395         JCOpens Opens(JCExpression qualId, List<JCExpression> moduleNames);
3396         JCProvides Provides(JCExpression serviceName, List<JCExpression> implNames);
3397         JCRequires Requires(boolean isTransitive, boolean isStaticPhase, JCExpression qualId);
3398         JCUses Uses(JCExpression qualId);
3399         LetExpr LetExpr(List<JCStatement> defs, JCExpression expr);
3400     }
3401 
3402     /** A generic visitor class for trees.
3403      */
3404     public static abstract class Visitor {
3405         public void visitTopLevel(JCCompilationUnit that)    { visitTree(that); }
3406         public void visitPackageDef(JCPackageDecl that)      { visitTree(that); }
3407         public void visitImport(JCImport that)               { visitTree(that); }
3408         public void visitClassDef(JCClassDecl that)          { visitTree(that); }
3409         public void visitMethodDef(JCMethodDecl that)        { visitTree(that); }
3410         public void visitVarDef(JCVariableDecl that)         { visitTree(that); }
3411         public void visitSkip(JCSkip that)                   { visitTree(that); }
3412         public void visitBlock(JCBlock that)                 { visitTree(that); }
3413         public void visitDoLoop(JCDoWhileLoop that)          { visitTree(that); }
3414         public void visitWhileLoop(JCWhileLoop that)         { visitTree(that); }

3415         public void visitForLoop(JCForLoop that)             { visitTree(that); }
3416         public void visitForeachLoop(JCEnhancedForLoop that) { visitTree(that); }
3417         public void visitLabelled(JCLabeledStatement that)   { visitTree(that); }
3418         public void visitSwitch(JCSwitch that)               { visitTree(that); }
3419         public void visitCase(JCCase that)                   { visitTree(that); }

3420         public void visitSwitchExpression(JCSwitchExpression that)               { visitTree(that); }
3421         public void visitSynchronized(JCSynchronized that)   { visitTree(that); }
3422         public void visitTry(JCTry that)                     { visitTree(that); }
3423         public void visitCatch(JCCatch that)                 { visitTree(that); }
3424         public void visitConditional(JCConditional that)     { visitTree(that); }
3425         public void visitIf(JCIf that)                       { visitTree(that); }
3426         public void visitExec(JCExpressionStatement that)    { visitTree(that); }
3427         public void visitBreak(JCBreak that)                 { visitTree(that); }
3428         public void visitYield(JCYield that)                 { visitTree(that); }
3429         public void visitContinue(JCContinue that)           { visitTree(that); }
3430         public void visitReturn(JCReturn that)               { visitTree(that); }
3431         public void visitThrow(JCThrow that)                 { visitTree(that); }
3432         public void visitAssert(JCAssert that)               { visitTree(that); }
3433         public void visitApply(JCMethodInvocation that)      { visitTree(that); }
3434         public void visitNewClass(JCNewClass that)           { visitTree(that); }
3435         public void visitNewArray(JCNewArray that)           { visitTree(that); }
3436         public void visitLambda(JCLambda that)               { visitTree(that); }
3437         public void visitParens(JCParens that)               { visitTree(that); }
3438         public void visitAssign(JCAssign that)               { visitTree(that); }
3439         public void visitAssignop(JCAssignOp that)           { visitTree(that); }

 116         /** Variable definitions, of type VarDef.
 117          */
 118         VARDEF,
 119 
 120         /** The no-op statement ";", of type Skip
 121          */
 122         SKIP,
 123 
 124         /** Blocks, of type Block.
 125          */
 126         BLOCK,
 127 
 128         /** Do-while loops, of type DoLoop.
 129          */
 130         DOLOOP,
 131 
 132         /** While-loops, of type WhileLoop.
 133          */
 134         WHILELOOP,
 135 
 136         /** Withfields, of type WithField.
 137          */
 138         WITHFIELD,
 139 
 140         /** For-loops, of type ForLoop.
 141          */
 142         FORLOOP,
 143 
 144         /** Foreach-loops, of type ForeachLoop.
 145          */
 146         FOREACHLOOP,
 147 
 148         /** Labelled statements, of type Labelled.
 149          */
 150         LABELLED,
 151 
 152         /** Switch statements, of type Switch.
 153          */
 154         SWITCH,
 155 
 156         /** Case parts in switch statements/expressions, of type Case.
 157          */
 158         CASE,
 159 

 239 
 240         /** Type test expressions, of type TypeTest.
 241          */
 242         TYPETEST,
 243 
 244         /** Patterns.
 245          */
 246         BINDINGPATTERN,
 247         DEFAULTCASELABEL,
 248         GUARDPATTERN,
 249         PARENTHESIZEDPATTERN,
 250 
 251         /** Indexed array expressions, of type Indexed.
 252          */
 253         INDEXED,
 254 
 255         /** Selections, of type Select.
 256          */
 257         SELECT,
 258 
 259         /** Default values, of type DefaultValueTree.
 260          */
 261         DEFAULT_VALUE,
 262 
 263         /** Member references, of type Reference.
 264          */
 265         REFERENCE,
 266 
 267         /** Simple identifiers, of type Ident.
 268          */
 269         IDENT,
 270 
 271         /** Literals, of type Literal.
 272          */
 273         LITERAL,
 274 
 275         /** Basic type identifiers, of type TypeIdent.
 276          */
 277         TYPEIDENT,
 278 
 279         /** Array types, of type TypeArray.
 280          */
 281         TYPEARRAY,
 282 

 712 
 713     public static abstract class JCCaseLabel extends JCTree implements CaseLabelTree {
 714         public abstract boolean isExpression();
 715         public boolean isNullPattern() {
 716             return isExpression() && TreeInfo.isNull((JCExpression) this);
 717         }
 718         public abstract boolean isPattern();
 719     }
 720 
 721     public static abstract class JCExpression extends JCCaseLabel implements ExpressionTree {
 722         @Override
 723         public JCExpression setType(Type type) {
 724             super.setType(type);
 725             return this;
 726         }
 727         @Override
 728         public JCExpression setPos(int pos) {
 729             super.setPos(pos);
 730             return this;
 731         }

 732         public boolean isPoly() { return false; }
 733         public boolean isStandalone() { return true; }
 734 
 735         @Override
 736         public boolean isExpression() {
 737             return true;
 738         }
 739 
 740         @Override
 741         public boolean isPattern() {
 742             return false;
 743         }
 744     }
 745 
 746     /**
 747      * Common supertype for all poly expression trees (lambda, method references,
 748      * conditionals, method and constructor calls)
 749      */
 750     public static abstract class JCPolyExpression extends JCExpression {
 751 

 880         /** method modifiers */
 881         public JCModifiers mods;
 882         /** method name */
 883         public Name name;
 884         /** type of method return value */
 885         public JCExpression restype;
 886         /** type parameters */
 887         public List<JCTypeParameter> typarams;
 888         /** receiver parameter */
 889         public JCVariableDecl recvparam;
 890         /** value parameters */
 891         public List<JCVariableDecl> params;
 892         /** exceptions thrown by this method */
 893         public List<JCExpression> thrown;
 894         /** statements in the method */
 895         public JCBlock body;
 896         /** default value, for annotation types */
 897         public JCExpression defaultValue;
 898         /** method symbol */
 899         public MethodSymbol sym;
 900         /** nascent value that evolves into the return value for a value factory */
 901         public VarSymbol factoryProduct;
 902 
 903         /** does this method completes normally */
 904         public boolean completesNormally;
 905 
 906         protected JCMethodDecl(JCModifiers mods,
 907                             Name name,
 908                             JCExpression restype,
 909                             List<JCTypeParameter> typarams,
 910                             JCVariableDecl recvparam,
 911                             List<JCVariableDecl> params,
 912                             List<JCExpression> thrown,
 913                             JCBlock body,
 914                             JCExpression defaultValue,
 915                             MethodSymbol sym)
 916         {
 917             this.mods = mods;
 918             this.name = name;
 919             this.restype = restype;
 920             this.typarams = typarams;
 921             this.params = params;
 922             this.recvparam = recvparam;

1162         @Override
1163         public void accept(Visitor v) { v.visitWhileLoop(this); }
1164 
1165         @DefinedBy(Api.COMPILER_TREE)
1166         public Kind getKind() { return Kind.WHILE_LOOP; }
1167         @DefinedBy(Api.COMPILER_TREE)
1168         public JCExpression getCondition() { return cond; }
1169         @DefinedBy(Api.COMPILER_TREE)
1170         public JCStatement getStatement() { return body; }
1171         @Override @DefinedBy(Api.COMPILER_TREE)
1172         public <R,D> R accept(TreeVisitor<R,D> v, D d) {
1173             return v.visitWhileLoop(this, d);
1174         }
1175 
1176         @Override
1177         public Tag getTag() {
1178             return WHILELOOP;
1179         }
1180     }
1181 
1182     /**
1183      * A withfield expression
1184      */
1185     public static class JCWithField extends JCExpression implements WithFieldTree {
1186         public JCExpression field;
1187         public JCExpression value;
1188         protected JCWithField(JCExpression field, JCExpression value) {
1189             this.field = field;
1190             this.value = value;
1191         }
1192         @Override
1193         public void accept(Visitor v) { v.visitWithField(this); }
1194 
1195         @DefinedBy(Api.COMPILER_TREE)
1196         public Kind getKind() { return Kind.WITH_FIELD; }
1197         @DefinedBy(Api.COMPILER_TREE)
1198         public JCExpression getField() { return field; }
1199         @DefinedBy(Api.COMPILER_TREE)
1200         public JCExpression getValue() { return value; }
1201         @Override @DefinedBy(Api.COMPILER_TREE)
1202         public <R,D> R accept(TreeVisitor<R,D> v, D d) {
1203             return v.visitWithField(this, d);
1204         }
1205 
1206         @Override
1207         public Tag getTag() {
1208             return WITHFIELD;
1209         }
1210     }
1211 
1212     /**
1213      * A for loop.
1214      */
1215     public static class JCForLoop extends JCStatement implements ForLoopTree {
1216         public List<JCStatement> init;
1217         public JCExpression cond;
1218         public List<JCExpressionStatement> step;
1219         public JCStatement body;
1220         protected JCForLoop(List<JCStatement> init,
1221                           JCExpression cond,
1222                           List<JCExpressionStatement> update,
1223                           JCStatement body)
1224         {
1225             this.init = init;
1226             this.cond = cond;
1227             this.step = update;
1228             this.body = body;
1229         }
1230         @Override
1231         public void accept(Visitor v) { v.visitForLoop(this); }

1385         @Override @DefinedBy(Api.COMPILER_TREE)
1386         public List<JCStatement> getStatements() {
1387             return caseKind == CaseKind.STATEMENT ? stats : null;
1388         }
1389         @Override @DefinedBy(Api.COMPILER_TREE)
1390         public JCTree getBody() { return body; }
1391         @Override @DefinedBy(Api.COMPILER_TREE)
1392         public CaseKind getCaseKind() {
1393             return caseKind;
1394         }
1395         @Override @DefinedBy(Api.COMPILER_TREE)
1396         public <R,D> R accept(TreeVisitor<R,D> v, D d) {
1397             return v.visitCase(this, d);
1398         }
1399         @Override
1400         public Tag getTag() {
1401             return CASE;
1402         }
1403     }
1404 
1405     /**
1406      * A "Identifier<TA1, TA2>.default" construction.
1407      */
1408     public static class JCDefaultValue extends JCPolyExpression implements DefaultValueTree {
1409         public JCExpression clazz;
1410 
1411         protected JCDefaultValue(JCExpression clazz) {
1412             this.clazz = clazz;
1413         }
1414         @Override
1415         public void accept(Visitor v) { v.visitDefaultValue(this); }
1416 
1417         @DefinedBy(Api.COMPILER_TREE)
1418         public Kind getKind() { return Kind.DEFAULT_VALUE; }
1419         @Override @DefinedBy(Api.COMPILER_TREE)
1420         public JCExpression getType() { return clazz; }
1421         @Override @DefinedBy(Api.COMPILER_TREE)
1422         public <R,D> R accept(TreeVisitor<R,D> v, D d) {
1423             return v.visitDefaultValue(this, d);
1424         }
1425         @Override
1426         public Tag getTag() {
1427             return DEFAULT_VALUE;
1428         }
1429     }
1430 
1431     /**
1432      * A "switch ( ) { }" construction.
1433      */
1434     public static class JCSwitchExpression extends JCPolyExpression implements SwitchExpressionTree {
1435         public JCExpression selector;
1436         public List<JCCase> cases;
1437         /** Position of closing brace, optional. */
1438         public int endpos = Position.NOPOS;
1439         public boolean hasTotalPattern;
1440         public boolean patternSwitch;
1441         protected JCSwitchExpression(JCExpression selector, List<JCCase> cases) {
1442             this.selector = selector;
1443             this.cases = cases;
1444         }
1445         @Override
1446         public void accept(Visitor v) { v.visitSwitchExpression(this); }
1447 
1448         @DefinedBy(Api.COMPILER_TREE)
1449         public Kind getKind() { return Kind.SWITCH_EXPRESSION; }
1450         @DefinedBy(Api.COMPILER_TREE)

3389                             JCBlock body,
3390                             JCExpression defaultValue);
3391         JCVariableDecl VarDef(JCModifiers mods,
3392                       Name name,
3393                       JCExpression vartype,
3394                       JCExpression init);
3395         JCSkip Skip();
3396         JCBlock Block(long flags, List<JCStatement> stats);
3397         JCDoWhileLoop DoLoop(JCStatement body, JCExpression cond);
3398         JCWhileLoop WhileLoop(JCExpression cond, JCStatement body);
3399         JCForLoop ForLoop(List<JCStatement> init,
3400                         JCExpression cond,
3401                         List<JCExpressionStatement> step,
3402                         JCStatement body);
3403         JCEnhancedForLoop ForeachLoop(JCVariableDecl var, JCExpression expr, JCStatement body);
3404         JCLabeledStatement Labelled(Name label, JCStatement body);
3405         JCSwitch Switch(JCExpression selector, List<JCCase> cases);
3406         JCSwitchExpression SwitchExpression(JCExpression selector, List<JCCase> cases);
3407         JCCase Case(CaseTree.CaseKind caseKind, List<JCCaseLabel> labels,
3408                     List<JCStatement> stats, JCTree body);
3409         JCDefaultValue DefaultValue(JCExpression type);
3410         JCSynchronized Synchronized(JCExpression lock, JCBlock body);
3411         JCTry Try(JCBlock body, List<JCCatch> catchers, JCBlock finalizer);
3412         JCTry Try(List<JCTree> resources,
3413                   JCBlock body,
3414                   List<JCCatch> catchers,
3415                   JCBlock finalizer);
3416         JCCatch Catch(JCVariableDecl param, JCBlock body);
3417         JCConditional Conditional(JCExpression cond,
3418                                 JCExpression thenpart,
3419                                 JCExpression elsepart);
3420         JCIf If(JCExpression cond, JCStatement thenpart, JCStatement elsepart);
3421         JCExpressionStatement Exec(JCExpression expr);
3422         JCBreak Break(Name label);
3423         JCYield Yield(JCExpression value);
3424         JCContinue Continue(Name label);
3425         JCReturn Return(JCExpression expr);
3426         JCThrow Throw(JCExpression expr);
3427         JCAssert Assert(JCExpression cond, JCExpression detail);
3428         JCMethodInvocation Apply(List<JCExpression> typeargs,
3429                     JCExpression fn,

3462         JCOpens Opens(JCExpression qualId, List<JCExpression> moduleNames);
3463         JCProvides Provides(JCExpression serviceName, List<JCExpression> implNames);
3464         JCRequires Requires(boolean isTransitive, boolean isStaticPhase, JCExpression qualId);
3465         JCUses Uses(JCExpression qualId);
3466         LetExpr LetExpr(List<JCStatement> defs, JCExpression expr);
3467     }
3468 
3469     /** A generic visitor class for trees.
3470      */
3471     public static abstract class Visitor {
3472         public void visitTopLevel(JCCompilationUnit that)    { visitTree(that); }
3473         public void visitPackageDef(JCPackageDecl that)      { visitTree(that); }
3474         public void visitImport(JCImport that)               { visitTree(that); }
3475         public void visitClassDef(JCClassDecl that)          { visitTree(that); }
3476         public void visitMethodDef(JCMethodDecl that)        { visitTree(that); }
3477         public void visitVarDef(JCVariableDecl that)         { visitTree(that); }
3478         public void visitSkip(JCSkip that)                   { visitTree(that); }
3479         public void visitBlock(JCBlock that)                 { visitTree(that); }
3480         public void visitDoLoop(JCDoWhileLoop that)          { visitTree(that); }
3481         public void visitWhileLoop(JCWhileLoop that)         { visitTree(that); }
3482         public void visitWithField(JCWithField that)         { visitTree(that); }
3483         public void visitForLoop(JCForLoop that)             { visitTree(that); }
3484         public void visitForeachLoop(JCEnhancedForLoop that) { visitTree(that); }
3485         public void visitLabelled(JCLabeledStatement that)   { visitTree(that); }
3486         public void visitSwitch(JCSwitch that)               { visitTree(that); }
3487         public void visitCase(JCCase that)                   { visitTree(that); }
3488         public void visitDefaultValue(JCDefaultValue that) { visitTree(that); }
3489         public void visitSwitchExpression(JCSwitchExpression that)               { visitTree(that); }
3490         public void visitSynchronized(JCSynchronized that)   { visitTree(that); }
3491         public void visitTry(JCTry that)                     { visitTree(that); }
3492         public void visitCatch(JCCatch that)                 { visitTree(that); }
3493         public void visitConditional(JCConditional that)     { visitTree(that); }
3494         public void visitIf(JCIf that)                       { visitTree(that); }
3495         public void visitExec(JCExpressionStatement that)    { visitTree(that); }
3496         public void visitBreak(JCBreak that)                 { visitTree(that); }
3497         public void visitYield(JCYield that)                 { visitTree(that); }
3498         public void visitContinue(JCContinue that)           { visitTree(that); }
3499         public void visitReturn(JCReturn that)               { visitTree(that); }
3500         public void visitThrow(JCThrow that)                 { visitTree(that); }
3501         public void visitAssert(JCAssert that)               { visitTree(that); }
3502         public void visitApply(JCMethodInvocation that)      { visitTree(that); }
3503         public void visitNewClass(JCNewClass that)           { visitTree(that); }
3504         public void visitNewArray(JCNewArray that)           { visitTree(that); }
3505         public void visitLambda(JCLambda that)               { visitTree(that); }
3506         public void visitParens(JCParens that)               { visitTree(that); }
3507         public void visitAssign(JCAssign that)               { visitTree(that); }
3508         public void visitAssignop(JCAssignOp that)           { visitTree(that); }
< prev index next >