< 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 

 240         /** Patterns.
 241          */
 242         BINDINGPATTERN,
 243         PARENTHESIZEDPATTERN,
 244         RECORDPATTERN,
 245 
 246         /* Case labels.
 247          */
 248         DEFAULTCASELABEL,
 249         CONSTANTCASELABEL,
 250         PATTERNCASELABEL,
 251 
 252         /** Indexed array expressions, of type Indexed.
 253          */
 254         INDEXED,
 255 
 256         /** Selections, of type Select.
 257          */
 258         SELECT,
 259 




 260         /** Member references, of type Reference.
 261          */
 262         REFERENCE,
 263 
 264         /** Simple identifiers, of type Ident.
 265          */
 266         IDENT,
 267 
 268         /** Literals, of type Literal.
 269          */
 270         LITERAL,
 271 
 272         /** Basic type identifiers, of type TypeIdent.
 273          */
 274         TYPEIDENT,
 275 
 276         /** Array types, of type TypeArray.
 277          */
 278         TYPEARRAY,
 279 

 704         public JCStatement setPos(int pos) {
 705             super.setPos(pos);
 706             return this;
 707         }
 708     }
 709 
 710     public abstract static class JCCaseLabel extends JCTree implements CaseLabelTree {
 711     }
 712 
 713     public abstract static class JCExpression extends JCTree 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     }
 729 
 730     /**
 731      * Common supertype for all poly expression trees (lambda, method references,
 732      * conditionals, method and constructor calls)
 733      */
 734     public abstract static class JCPolyExpression extends JCExpression {
 735 
 736         /**
 737          * A poly expression can only be truly 'poly' in certain contexts
 738          */
 739         public enum PolyKind {
 740             /** poly expression to be treated as a standalone expression */
 741             STANDALONE,
 742             /** true poly expression */
 743             POLY
 744         }

 864         /** method modifiers */
 865         public JCModifiers mods;
 866         /** method name */
 867         public Name name;
 868         /** type of method return value */
 869         public JCExpression restype;
 870         /** type parameters */
 871         public List<JCTypeParameter> typarams;
 872         /** receiver parameter */
 873         public JCVariableDecl recvparam;
 874         /** value parameters */
 875         public List<JCVariableDecl> params;
 876         /** exceptions thrown by this method */
 877         public List<JCExpression> thrown;
 878         /** statements in the method */
 879         public JCBlock body;
 880         /** default value, for annotation types */
 881         public JCExpression defaultValue;
 882         /** method symbol */
 883         public MethodSymbol sym;



 884         /** does this method completes normally */
 885         public boolean completesNormally;
 886 
 887         protected JCMethodDecl(JCModifiers mods,
 888                             Name name,
 889                             JCExpression restype,
 890                             List<JCTypeParameter> typarams,
 891                             JCVariableDecl recvparam,
 892                             List<JCVariableDecl> params,
 893                             List<JCExpression> thrown,
 894                             JCBlock body,
 895                             JCExpression defaultValue,
 896                             MethodSymbol sym)
 897         {
 898             this.mods = mods;
 899             this.name = name;
 900             this.restype = restype;
 901             this.typarams = typarams;
 902             this.params = params;
 903             this.recvparam = recvparam;

1143         @Override
1144         public void accept(Visitor v) { v.visitWhileLoop(this); }
1145 
1146         @DefinedBy(Api.COMPILER_TREE)
1147         public Kind getKind() { return Kind.WHILE_LOOP; }
1148         @DefinedBy(Api.COMPILER_TREE)
1149         public JCExpression getCondition() { return cond; }
1150         @DefinedBy(Api.COMPILER_TREE)
1151         public JCStatement getStatement() { return body; }
1152         @Override @DefinedBy(Api.COMPILER_TREE)
1153         public <R,D> R accept(TreeVisitor<R,D> v, D d) {
1154             return v.visitWhileLoop(this, d);
1155         }
1156 
1157         @Override
1158         public Tag getTag() {
1159             return WHILELOOP;
1160         }
1161     }
1162 






























1163     /**
1164      * A for loop.
1165      */
1166     public static class JCForLoop extends JCStatement implements ForLoopTree {
1167         public List<JCStatement> init;
1168         public JCExpression cond;
1169         public List<JCExpressionStatement> step;
1170         public JCStatement body;
1171         protected JCForLoop(List<JCStatement> init,
1172                           JCExpression cond,
1173                           List<JCExpressionStatement> update,
1174                           JCStatement body)
1175         {
1176             this.init = init;
1177             this.cond = cond;
1178             this.step = update;
1179             this.body = body;
1180         }
1181         @Override
1182         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 hasUnconditionalPattern;
1374         public boolean isExhaustive;
1375         public boolean patternSwitch;
1376         public boolean wasEnumSelector;
1377         protected JCSwitchExpression(JCExpression selector, List<JCCase> cases) {
1378             this.selector = selector;
1379             this.cases = cases;
1380         }
1381         @Override
1382         public void accept(Visitor v) { v.visitSwitchExpression(this); }
1383 
1384         @DefinedBy(Api.COMPILER_TREE)

3403                             JCBlock body,
3404                             JCExpression defaultValue);
3405         JCVariableDecl VarDef(JCModifiers mods,
3406                       Name name,
3407                       JCExpression vartype,
3408                       JCExpression init);
3409         JCSkip Skip();
3410         JCBlock Block(long flags, List<JCStatement> stats);
3411         JCDoWhileLoop DoLoop(JCStatement body, JCExpression cond);
3412         JCWhileLoop WhileLoop(JCExpression cond, JCStatement body);
3413         JCForLoop ForLoop(List<JCStatement> init,
3414                         JCExpression cond,
3415                         List<JCExpressionStatement> step,
3416                         JCStatement body);
3417         JCEnhancedForLoop ForeachLoop(JCVariableDecl var, JCExpression expr, JCStatement body);
3418         JCLabeledStatement Labelled(Name label, JCStatement body);
3419         JCSwitch Switch(JCExpression selector, List<JCCase> cases);
3420         JCSwitchExpression SwitchExpression(JCExpression selector, List<JCCase> cases);
3421         JCCase Case(CaseTree.CaseKind caseKind, List<JCCaseLabel> labels,
3422                     List<JCStatement> stats, JCTree body);

3423         JCSynchronized Synchronized(JCExpression lock, JCBlock body);
3424         JCTry Try(JCBlock body, List<JCCatch> catchers, JCBlock finalizer);
3425         JCTry Try(List<JCTree> resources,
3426                   JCBlock body,
3427                   List<JCCatch> catchers,
3428                   JCBlock finalizer);
3429         JCCatch Catch(JCVariableDecl param, JCBlock body);
3430         JCConditional Conditional(JCExpression cond,
3431                                 JCExpression thenpart,
3432                                 JCExpression elsepart);
3433         JCIf If(JCExpression cond, JCStatement thenpart, JCStatement elsepart);
3434         JCExpressionStatement Exec(JCExpression expr);
3435         JCBreak Break(Name label);
3436         JCYield Yield(JCExpression value);
3437         JCContinue Continue(Name label);
3438         JCReturn Return(JCExpression expr);
3439         JCThrow Throw(JCExpression expr);
3440         JCAssert Assert(JCExpression cond, JCExpression detail);
3441         JCMethodInvocation Apply(List<JCExpression> typeargs,
3442                     JCExpression fn,

3475         JCOpens Opens(JCExpression qualId, List<JCExpression> moduleNames);
3476         JCProvides Provides(JCExpression serviceName, List<JCExpression> implNames);
3477         JCRequires Requires(boolean isTransitive, boolean isStaticPhase, JCExpression qualId);
3478         JCUses Uses(JCExpression qualId);
3479         LetExpr LetExpr(List<JCStatement> defs, JCExpression expr);
3480     }
3481 
3482     /** A generic visitor class for trees.
3483      */
3484     public abstract static class Visitor {
3485         public void visitTopLevel(JCCompilationUnit that)    { visitTree(that); }
3486         public void visitPackageDef(JCPackageDecl that)      { visitTree(that); }
3487         public void visitImport(JCImport that)               { visitTree(that); }
3488         public void visitClassDef(JCClassDecl that)          { visitTree(that); }
3489         public void visitMethodDef(JCMethodDecl that)        { visitTree(that); }
3490         public void visitVarDef(JCVariableDecl that)         { visitTree(that); }
3491         public void visitSkip(JCSkip that)                   { visitTree(that); }
3492         public void visitBlock(JCBlock that)                 { visitTree(that); }
3493         public void visitDoLoop(JCDoWhileLoop that)          { visitTree(that); }
3494         public void visitWhileLoop(JCWhileLoop that)         { visitTree(that); }

3495         public void visitForLoop(JCForLoop that)             { visitTree(that); }
3496         public void visitForeachLoop(JCEnhancedForLoop that) { visitTree(that); }
3497         public void visitLabelled(JCLabeledStatement that)   { visitTree(that); }
3498         public void visitSwitch(JCSwitch that)               { visitTree(that); }
3499         public void visitCase(JCCase that)                   { visitTree(that); }

3500         public void visitSwitchExpression(JCSwitchExpression that)               { visitTree(that); }
3501         public void visitSynchronized(JCSynchronized that)   { visitTree(that); }
3502         public void visitTry(JCTry that)                     { visitTree(that); }
3503         public void visitCatch(JCCatch that)                 { visitTree(that); }
3504         public void visitConditional(JCConditional that)     { visitTree(that); }
3505         public void visitIf(JCIf that)                       { visitTree(that); }
3506         public void visitExec(JCExpressionStatement that)    { visitTree(that); }
3507         public void visitBreak(JCBreak that)                 { visitTree(that); }
3508         public void visitYield(JCYield that)                 { visitTree(that); }
3509         public void visitContinue(JCContinue that)           { visitTree(that); }
3510         public void visitReturn(JCReturn that)               { visitTree(that); }
3511         public void visitThrow(JCThrow that)                 { visitTree(that); }
3512         public void visitAssert(JCAssert that)               { visitTree(that); }
3513         public void visitApply(JCMethodInvocation that)      { visitTree(that); }
3514         public void visitNewClass(JCNewClass that)           { visitTree(that); }
3515         public void visitNewArray(JCNewArray that)           { visitTree(that); }
3516         public void visitLambda(JCLambda that)               { visitTree(that); }
3517         public void visitParens(JCParens that)               { visitTree(that); }
3518         public void visitAssign(JCAssign that)               { visitTree(that); }
3519         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 

 244         /** Patterns.
 245          */
 246         BINDINGPATTERN,
 247         PARENTHESIZEDPATTERN,
 248         RECORDPATTERN,
 249 
 250         /* Case labels.
 251          */
 252         DEFAULTCASELABEL,
 253         CONSTANTCASELABEL,
 254         PATTERNCASELABEL,
 255 
 256         /** Indexed array expressions, of type Indexed.
 257          */
 258         INDEXED,
 259 
 260         /** Selections, of type Select.
 261          */
 262         SELECT,
 263 
 264         /** Default values, of type DefaultValueTree.
 265          */
 266         DEFAULT_VALUE,
 267 
 268         /** Member references, of type Reference.
 269          */
 270         REFERENCE,
 271 
 272         /** Simple identifiers, of type Ident.
 273          */
 274         IDENT,
 275 
 276         /** Literals, of type Literal.
 277          */
 278         LITERAL,
 279 
 280         /** Basic type identifiers, of type TypeIdent.
 281          */
 282         TYPEIDENT,
 283 
 284         /** Array types, of type TypeArray.
 285          */
 286         TYPEARRAY,
 287 

 712         public JCStatement setPos(int pos) {
 713             super.setPos(pos);
 714             return this;
 715         }
 716     }
 717 
 718     public abstract static class JCCaseLabel extends JCTree implements CaseLabelTree {
 719     }
 720 
 721     public abstract static class JCExpression extends JCTree 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     }
 736 
 737     /**
 738      * Common supertype for all poly expression trees (lambda, method references,
 739      * conditionals, method and constructor calls)
 740      */
 741     public abstract static class JCPolyExpression extends JCExpression {
 742 
 743         /**
 744          * A poly expression can only be truly 'poly' in certain contexts
 745          */
 746         public enum PolyKind {
 747             /** poly expression to be treated as a standalone expression */
 748             STANDALONE,
 749             /** true poly expression */
 750             POLY
 751         }

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

1153         @Override
1154         public void accept(Visitor v) { v.visitWhileLoop(this); }
1155 
1156         @DefinedBy(Api.COMPILER_TREE)
1157         public Kind getKind() { return Kind.WHILE_LOOP; }
1158         @DefinedBy(Api.COMPILER_TREE)
1159         public JCExpression getCondition() { return cond; }
1160         @DefinedBy(Api.COMPILER_TREE)
1161         public JCStatement getStatement() { return body; }
1162         @Override @DefinedBy(Api.COMPILER_TREE)
1163         public <R,D> R accept(TreeVisitor<R,D> v, D d) {
1164             return v.visitWhileLoop(this, d);
1165         }
1166 
1167         @Override
1168         public Tag getTag() {
1169             return WHILELOOP;
1170         }
1171     }
1172 
1173     /**
1174      * A withfield expression
1175      */
1176     public static class JCWithField extends JCExpression implements WithFieldTree {
1177         public JCExpression field;
1178         public JCExpression value;
1179         protected JCWithField(JCExpression field, JCExpression value) {
1180             this.field = field;
1181             this.value = value;
1182         }
1183         @Override
1184         public void accept(Visitor v) { v.visitWithField(this); }
1185 
1186         @DefinedBy(Api.COMPILER_TREE)
1187         public Kind getKind() { return Kind.WITH_FIELD; }
1188         @DefinedBy(Api.COMPILER_TREE)
1189         public JCExpression getField() { return field; }
1190         @DefinedBy(Api.COMPILER_TREE)
1191         public JCExpression getValue() { return value; }
1192         @Override @DefinedBy(Api.COMPILER_TREE)
1193         public <R,D> R accept(TreeVisitor<R,D> v, D d) {
1194             return v.visitWithField(this, d);
1195         }
1196 
1197         @Override
1198         public Tag getTag() {
1199             return WITHFIELD;
1200         }
1201     }
1202 
1203     /**
1204      * A for loop.
1205      */
1206     public static class JCForLoop extends JCStatement implements ForLoopTree {
1207         public List<JCStatement> init;
1208         public JCExpression cond;
1209         public List<JCExpressionStatement> step;
1210         public JCStatement body;
1211         protected JCForLoop(List<JCStatement> init,
1212                           JCExpression cond,
1213                           List<JCExpressionStatement> update,
1214                           JCStatement body)
1215         {
1216             this.init = init;
1217             this.cond = cond;
1218             this.step = update;
1219             this.body = body;
1220         }
1221         @Override
1222         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 hasUnconditionalPattern;
1440         public boolean isExhaustive;
1441         public boolean patternSwitch;
1442         public boolean wasEnumSelector;
1443         protected JCSwitchExpression(JCExpression selector, List<JCCase> cases) {
1444             this.selector = selector;
1445             this.cases = cases;
1446         }
1447         @Override
1448         public void accept(Visitor v) { v.visitSwitchExpression(this); }
1449 
1450         @DefinedBy(Api.COMPILER_TREE)

3469                             JCBlock body,
3470                             JCExpression defaultValue);
3471         JCVariableDecl VarDef(JCModifiers mods,
3472                       Name name,
3473                       JCExpression vartype,
3474                       JCExpression init);
3475         JCSkip Skip();
3476         JCBlock Block(long flags, List<JCStatement> stats);
3477         JCDoWhileLoop DoLoop(JCStatement body, JCExpression cond);
3478         JCWhileLoop WhileLoop(JCExpression cond, JCStatement body);
3479         JCForLoop ForLoop(List<JCStatement> init,
3480                         JCExpression cond,
3481                         List<JCExpressionStatement> step,
3482                         JCStatement body);
3483         JCEnhancedForLoop ForeachLoop(JCVariableDecl var, JCExpression expr, JCStatement body);
3484         JCLabeledStatement Labelled(Name label, JCStatement body);
3485         JCSwitch Switch(JCExpression selector, List<JCCase> cases);
3486         JCSwitchExpression SwitchExpression(JCExpression selector, List<JCCase> cases);
3487         JCCase Case(CaseTree.CaseKind caseKind, List<JCCaseLabel> labels,
3488                     List<JCStatement> stats, JCTree body);
3489         JCDefaultValue DefaultValue(JCExpression type);
3490         JCSynchronized Synchronized(JCExpression lock, JCBlock body);
3491         JCTry Try(JCBlock body, List<JCCatch> catchers, JCBlock finalizer);
3492         JCTry Try(List<JCTree> resources,
3493                   JCBlock body,
3494                   List<JCCatch> catchers,
3495                   JCBlock finalizer);
3496         JCCatch Catch(JCVariableDecl param, JCBlock body);
3497         JCConditional Conditional(JCExpression cond,
3498                                 JCExpression thenpart,
3499                                 JCExpression elsepart);
3500         JCIf If(JCExpression cond, JCStatement thenpart, JCStatement elsepart);
3501         JCExpressionStatement Exec(JCExpression expr);
3502         JCBreak Break(Name label);
3503         JCYield Yield(JCExpression value);
3504         JCContinue Continue(Name label);
3505         JCReturn Return(JCExpression expr);
3506         JCThrow Throw(JCExpression expr);
3507         JCAssert Assert(JCExpression cond, JCExpression detail);
3508         JCMethodInvocation Apply(List<JCExpression> typeargs,
3509                     JCExpression fn,

3542         JCOpens Opens(JCExpression qualId, List<JCExpression> moduleNames);
3543         JCProvides Provides(JCExpression serviceName, List<JCExpression> implNames);
3544         JCRequires Requires(boolean isTransitive, boolean isStaticPhase, JCExpression qualId);
3545         JCUses Uses(JCExpression qualId);
3546         LetExpr LetExpr(List<JCStatement> defs, JCExpression expr);
3547     }
3548 
3549     /** A generic visitor class for trees.
3550      */
3551     public abstract static class Visitor {
3552         public void visitTopLevel(JCCompilationUnit that)    { visitTree(that); }
3553         public void visitPackageDef(JCPackageDecl that)      { visitTree(that); }
3554         public void visitImport(JCImport that)               { visitTree(that); }
3555         public void visitClassDef(JCClassDecl that)          { visitTree(that); }
3556         public void visitMethodDef(JCMethodDecl that)        { visitTree(that); }
3557         public void visitVarDef(JCVariableDecl that)         { visitTree(that); }
3558         public void visitSkip(JCSkip that)                   { visitTree(that); }
3559         public void visitBlock(JCBlock that)                 { visitTree(that); }
3560         public void visitDoLoop(JCDoWhileLoop that)          { visitTree(that); }
3561         public void visitWhileLoop(JCWhileLoop that)         { visitTree(that); }
3562         public void visitWithField(JCWithField that)         { visitTree(that); }
3563         public void visitForLoop(JCForLoop that)             { visitTree(that); }
3564         public void visitForeachLoop(JCEnhancedForLoop that) { visitTree(that); }
3565         public void visitLabelled(JCLabeledStatement that)   { visitTree(that); }
3566         public void visitSwitch(JCSwitch that)               { visitTree(that); }
3567         public void visitCase(JCCase that)                   { visitTree(that); }
3568         public void visitDefaultValue(JCDefaultValue that) { visitTree(that); }
3569         public void visitSwitchExpression(JCSwitchExpression that)               { visitTree(that); }
3570         public void visitSynchronized(JCSynchronized that)   { visitTree(that); }
3571         public void visitTry(JCTry that)                     { visitTree(that); }
3572         public void visitCatch(JCCatch that)                 { visitTree(that); }
3573         public void visitConditional(JCConditional that)     { visitTree(that); }
3574         public void visitIf(JCIf that)                       { visitTree(that); }
3575         public void visitExec(JCExpressionStatement that)    { visitTree(that); }
3576         public void visitBreak(JCBreak that)                 { visitTree(that); }
3577         public void visitYield(JCYield that)                 { visitTree(that); }
3578         public void visitContinue(JCContinue that)           { visitTree(that); }
3579         public void visitReturn(JCReturn that)               { visitTree(that); }
3580         public void visitThrow(JCThrow that)                 { visitTree(that); }
3581         public void visitAssert(JCAssert that)               { visitTree(that); }
3582         public void visitApply(JCMethodInvocation that)      { visitTree(that); }
3583         public void visitNewClass(JCNewClass that)           { visitTree(that); }
3584         public void visitNewArray(JCNewArray that)           { visitTree(that); }
3585         public void visitLambda(JCLambda that)               { visitTree(that); }
3586         public void visitParens(JCParens that)               { visitTree(that); }
3587         public void visitAssign(JCAssign that)               { visitTree(that); }
3588         public void visitAssignop(JCAssignOp that)           { visitTree(that); }
< prev index next >