< 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 

 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;

 931         public JCVariableDecl getReceiverParameter() { return recvparam; }
 932         @DefinedBy(Api.COMPILER_TREE)
 933         public List<JCExpression> getThrows() {
 934             return thrown;
 935         }
 936         @DefinedBy(Api.COMPILER_TREE)
 937         public JCBlock getBody() { return body; }
 938         @DefinedBy(Api.COMPILER_TREE)
 939         public JCTree getDefaultValue() { // for annotation types
 940             return defaultValue;
 941         }
 942         @Override @DefinedBy(Api.COMPILER_TREE)
 943         public <R,D> R accept(TreeVisitor<R,D> v, D d) {
 944             return v.visitMethod(this, d);
 945         }
 946 
 947         @Override
 948         public Tag getTag() {
 949             return METHODDEF;
 950         }




 951   }
 952 
 953     /**
 954      * A variable definition.
 955      */
 956     public static class JCVariableDecl extends JCStatement implements VariableTree {
 957         /** variable modifiers */
 958         public JCModifiers mods;
 959         /** variable name */
 960         public Name name;
 961         /** variable name expression */
 962         public JCExpression nameexpr;
 963         /** type of the variable */
 964         public JCExpression vartype;
 965         /** variable's initial value */
 966         public JCExpression init;
 967         /** symbol */
 968         public VarSymbol sym;
 969         /** explicit start pos */
 970         public int startPos = Position.NOPOS;

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






























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

1363         @Override @DefinedBy(Api.COMPILER_TREE)
1364         public List<JCStatement> getStatements() {
1365             return caseKind == CaseKind.STATEMENT ? stats : null;
1366         }
1367         @Override @DefinedBy(Api.COMPILER_TREE)
1368         public JCTree getBody() { return body; }
1369         @Override @DefinedBy(Api.COMPILER_TREE)
1370         public CaseKind getCaseKind() {
1371             return caseKind;
1372         }
1373         @Override @DefinedBy(Api.COMPILER_TREE)
1374         public <R,D> R accept(TreeVisitor<R,D> v, D d) {
1375             return v.visitCase(this, d);
1376         }
1377         @Override
1378         public Tag getTag() {
1379             return CASE;
1380         }
1381     }
1382 


























1383     /**
1384      * A "switch ( ) { }" construction.
1385      */
1386     public static class JCSwitchExpression extends JCPolyExpression implements SwitchExpressionTree {
1387         public JCExpression selector;
1388         public List<JCCase> cases;
1389         /** Position of closing brace, optional. */
1390         public int endpos = Position.NOPOS;
1391         public boolean hasUnconditionalPattern;
1392         public boolean isExhaustive;
1393         public boolean patternSwitch;
1394         public boolean wasEnumSelector;
1395         protected JCSwitchExpression(JCExpression selector, List<JCCase> cases) {
1396             this.selector = selector;
1397             this.cases = cases;
1398         }
1399         @Override
1400         public void accept(Visitor v) { v.visitSwitchExpression(this); }
1401 
1402         @DefinedBy(Api.COMPILER_TREE)

3420                             JCBlock body,
3421                             JCExpression defaultValue);
3422         JCVariableDecl VarDef(JCModifiers mods,
3423                       Name name,
3424                       JCExpression vartype,
3425                       JCExpression init);
3426         JCSkip Skip();
3427         JCBlock Block(long flags, List<JCStatement> stats);
3428         JCDoWhileLoop DoLoop(JCStatement body, JCExpression cond);
3429         JCWhileLoop WhileLoop(JCExpression cond, JCStatement body);
3430         JCForLoop ForLoop(List<JCStatement> init,
3431                         JCExpression cond,
3432                         List<JCExpressionStatement> step,
3433                         JCStatement body);
3434         JCEnhancedForLoop ForeachLoop(JCTree var, JCExpression expr, JCStatement body);
3435         JCLabeledStatement Labelled(Name label, JCStatement body);
3436         JCSwitch Switch(JCExpression selector, List<JCCase> cases);
3437         JCSwitchExpression SwitchExpression(JCExpression selector, List<JCCase> cases);
3438         JCCase Case(CaseTree.CaseKind caseKind, List<JCCaseLabel> labels,
3439                     List<JCStatement> stats, JCTree body);

3440         JCSynchronized Synchronized(JCExpression lock, JCBlock body);
3441         JCTry Try(JCBlock body, List<JCCatch> catchers, JCBlock finalizer);
3442         JCTry Try(List<JCTree> resources,
3443                   JCBlock body,
3444                   List<JCCatch> catchers,
3445                   JCBlock finalizer);
3446         JCCatch Catch(JCVariableDecl param, JCBlock body);
3447         JCConditional Conditional(JCExpression cond,
3448                                 JCExpression thenpart,
3449                                 JCExpression elsepart);
3450         JCIf If(JCExpression cond, JCStatement thenpart, JCStatement elsepart);
3451         JCExpressionStatement Exec(JCExpression expr);
3452         JCBreak Break(Name label);
3453         JCYield Yield(JCExpression value);
3454         JCContinue Continue(Name label);
3455         JCReturn Return(JCExpression expr);
3456         JCThrow Throw(JCExpression expr);
3457         JCAssert Assert(JCExpression cond, JCExpression detail);
3458         JCMethodInvocation Apply(List<JCExpression> typeargs,
3459                     JCExpression fn,

3492         JCOpens Opens(JCExpression qualId, List<JCExpression> moduleNames);
3493         JCProvides Provides(JCExpression serviceName, List<JCExpression> implNames);
3494         JCRequires Requires(boolean isTransitive, boolean isStaticPhase, JCExpression qualId);
3495         JCUses Uses(JCExpression qualId);
3496         LetExpr LetExpr(List<JCStatement> defs, JCExpression expr);
3497     }
3498 
3499     /** A generic visitor class for trees.
3500      */
3501     public abstract static class Visitor {
3502         public void visitTopLevel(JCCompilationUnit that)    { visitTree(that); }
3503         public void visitPackageDef(JCPackageDecl that)      { visitTree(that); }
3504         public void visitImport(JCImport that)               { visitTree(that); }
3505         public void visitClassDef(JCClassDecl that)          { visitTree(that); }
3506         public void visitMethodDef(JCMethodDecl that)        { visitTree(that); }
3507         public void visitVarDef(JCVariableDecl that)         { visitTree(that); }
3508         public void visitSkip(JCSkip that)                   { visitTree(that); }
3509         public void visitBlock(JCBlock that)                 { visitTree(that); }
3510         public void visitDoLoop(JCDoWhileLoop that)          { visitTree(that); }
3511         public void visitWhileLoop(JCWhileLoop that)         { visitTree(that); }

3512         public void visitForLoop(JCForLoop that)             { visitTree(that); }
3513         public void visitForeachLoop(JCEnhancedForLoop that) { visitTree(that); }
3514         public void visitLabelled(JCLabeledStatement that)   { visitTree(that); }
3515         public void visitSwitch(JCSwitch that)               { visitTree(that); }
3516         public void visitCase(JCCase that)                   { visitTree(that); }

3517         public void visitSwitchExpression(JCSwitchExpression that)               { visitTree(that); }
3518         public void visitSynchronized(JCSynchronized that)   { visitTree(that); }
3519         public void visitTry(JCTry that)                     { visitTree(that); }
3520         public void visitCatch(JCCatch that)                 { visitTree(that); }
3521         public void visitConditional(JCConditional that)     { visitTree(that); }
3522         public void visitIf(JCIf that)                       { visitTree(that); }
3523         public void visitExec(JCExpressionStatement that)    { visitTree(that); }
3524         public void visitBreak(JCBreak that)                 { visitTree(that); }
3525         public void visitYield(JCYield that)                 { visitTree(that); }
3526         public void visitContinue(JCContinue that)           { visitTree(that); }
3527         public void visitReturn(JCReturn that)               { visitTree(that); }
3528         public void visitThrow(JCThrow that)                 { visitTree(that); }
3529         public void visitAssert(JCAssert that)               { visitTree(that); }
3530         public void visitApply(JCMethodInvocation that)      { visitTree(that); }
3531         public void visitNewClass(JCNewClass that)           { visitTree(that); }
3532         public void visitNewArray(JCNewArray that)           { visitTree(that); }
3533         public void visitLambda(JCLambda that)               { visitTree(that); }
3534         public void visitParens(JCParens that)               { visitTree(that); }
3535         public void visitAssign(JCAssign that)               { visitTree(that); }
3536         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 

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

 942         public JCVariableDecl getReceiverParameter() { return recvparam; }
 943         @DefinedBy(Api.COMPILER_TREE)
 944         public List<JCExpression> getThrows() {
 945             return thrown;
 946         }
 947         @DefinedBy(Api.COMPILER_TREE)
 948         public JCBlock getBody() { return body; }
 949         @DefinedBy(Api.COMPILER_TREE)
 950         public JCTree getDefaultValue() { // for annotation types
 951             return defaultValue;
 952         }
 953         @Override @DefinedBy(Api.COMPILER_TREE)
 954         public <R,D> R accept(TreeVisitor<R,D> v, D d) {
 955             return v.visitMethod(this, d);
 956         }
 957 
 958         @Override
 959         public Tag getTag() {
 960             return METHODDEF;
 961         }
 962 
 963         public boolean isInitOrVNew() {
 964             return name.table.names.isInitOrVNew(name);
 965         }
 966   }
 967 
 968     /**
 969      * A variable definition.
 970      */
 971     public static class JCVariableDecl extends JCStatement implements VariableTree {
 972         /** variable modifiers */
 973         public JCModifiers mods;
 974         /** variable name */
 975         public Name name;
 976         /** variable name expression */
 977         public JCExpression nameexpr;
 978         /** type of the variable */
 979         public JCExpression vartype;
 980         /** variable's initial value */
 981         public JCExpression init;
 982         /** symbol */
 983         public VarSymbol sym;
 984         /** explicit start pos */
 985         public int startPos = Position.NOPOS;

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

1408         @Override @DefinedBy(Api.COMPILER_TREE)
1409         public List<JCStatement> getStatements() {
1410             return caseKind == CaseKind.STATEMENT ? stats : null;
1411         }
1412         @Override @DefinedBy(Api.COMPILER_TREE)
1413         public JCTree getBody() { return body; }
1414         @Override @DefinedBy(Api.COMPILER_TREE)
1415         public CaseKind getCaseKind() {
1416             return caseKind;
1417         }
1418         @Override @DefinedBy(Api.COMPILER_TREE)
1419         public <R,D> R accept(TreeVisitor<R,D> v, D d) {
1420             return v.visitCase(this, d);
1421         }
1422         @Override
1423         public Tag getTag() {
1424             return CASE;
1425         }
1426     }
1427 
1428     /**
1429      * A "Identifier<TA1, TA2>.default" construction.
1430      */
1431     public static class JCDefaultValue extends JCPolyExpression implements DefaultValueTree {
1432         public JCExpression clazz;
1433 
1434         protected JCDefaultValue(JCExpression clazz) {
1435             this.clazz = clazz;
1436         }
1437         @Override
1438         public void accept(Visitor v) { v.visitDefaultValue(this); }
1439 
1440         @DefinedBy(Api.COMPILER_TREE)
1441         public Kind getKind() { return Kind.DEFAULT_VALUE; }
1442         @Override @DefinedBy(Api.COMPILER_TREE)
1443         public JCExpression getType() { return clazz; }
1444         @Override @DefinedBy(Api.COMPILER_TREE)
1445         public <R,D> R accept(TreeVisitor<R,D> v, D d) {
1446             return v.visitDefaultValue(this, d);
1447         }
1448         @Override
1449         public Tag getTag() {
1450             return DEFAULT_VALUE;
1451         }
1452     }
1453 
1454     /**
1455      * A "switch ( ) { }" construction.
1456      */
1457     public static class JCSwitchExpression extends JCPolyExpression implements SwitchExpressionTree {
1458         public JCExpression selector;
1459         public List<JCCase> cases;
1460         /** Position of closing brace, optional. */
1461         public int endpos = Position.NOPOS;
1462         public boolean hasUnconditionalPattern;
1463         public boolean isExhaustive;
1464         public boolean patternSwitch;
1465         public boolean wasEnumSelector;
1466         protected JCSwitchExpression(JCExpression selector, List<JCCase> cases) {
1467             this.selector = selector;
1468             this.cases = cases;
1469         }
1470         @Override
1471         public void accept(Visitor v) { v.visitSwitchExpression(this); }
1472 
1473         @DefinedBy(Api.COMPILER_TREE)

3491                             JCBlock body,
3492                             JCExpression defaultValue);
3493         JCVariableDecl VarDef(JCModifiers mods,
3494                       Name name,
3495                       JCExpression vartype,
3496                       JCExpression init);
3497         JCSkip Skip();
3498         JCBlock Block(long flags, List<JCStatement> stats);
3499         JCDoWhileLoop DoLoop(JCStatement body, JCExpression cond);
3500         JCWhileLoop WhileLoop(JCExpression cond, JCStatement body);
3501         JCForLoop ForLoop(List<JCStatement> init,
3502                         JCExpression cond,
3503                         List<JCExpressionStatement> step,
3504                         JCStatement body);
3505         JCEnhancedForLoop ForeachLoop(JCTree var, JCExpression expr, JCStatement body);
3506         JCLabeledStatement Labelled(Name label, JCStatement body);
3507         JCSwitch Switch(JCExpression selector, List<JCCase> cases);
3508         JCSwitchExpression SwitchExpression(JCExpression selector, List<JCCase> cases);
3509         JCCase Case(CaseTree.CaseKind caseKind, List<JCCaseLabel> labels,
3510                     List<JCStatement> stats, JCTree body);
3511         JCDefaultValue DefaultValue(JCExpression type);
3512         JCSynchronized Synchronized(JCExpression lock, JCBlock body);
3513         JCTry Try(JCBlock body, List<JCCatch> catchers, JCBlock finalizer);
3514         JCTry Try(List<JCTree> resources,
3515                   JCBlock body,
3516                   List<JCCatch> catchers,
3517                   JCBlock finalizer);
3518         JCCatch Catch(JCVariableDecl param, JCBlock body);
3519         JCConditional Conditional(JCExpression cond,
3520                                 JCExpression thenpart,
3521                                 JCExpression elsepart);
3522         JCIf If(JCExpression cond, JCStatement thenpart, JCStatement elsepart);
3523         JCExpressionStatement Exec(JCExpression expr);
3524         JCBreak Break(Name label);
3525         JCYield Yield(JCExpression value);
3526         JCContinue Continue(Name label);
3527         JCReturn Return(JCExpression expr);
3528         JCThrow Throw(JCExpression expr);
3529         JCAssert Assert(JCExpression cond, JCExpression detail);
3530         JCMethodInvocation Apply(List<JCExpression> typeargs,
3531                     JCExpression fn,

3564         JCOpens Opens(JCExpression qualId, List<JCExpression> moduleNames);
3565         JCProvides Provides(JCExpression serviceName, List<JCExpression> implNames);
3566         JCRequires Requires(boolean isTransitive, boolean isStaticPhase, JCExpression qualId);
3567         JCUses Uses(JCExpression qualId);
3568         LetExpr LetExpr(List<JCStatement> defs, JCExpression expr);
3569     }
3570 
3571     /** A generic visitor class for trees.
3572      */
3573     public abstract static class Visitor {
3574         public void visitTopLevel(JCCompilationUnit that)    { visitTree(that); }
3575         public void visitPackageDef(JCPackageDecl that)      { visitTree(that); }
3576         public void visitImport(JCImport that)               { visitTree(that); }
3577         public void visitClassDef(JCClassDecl that)          { visitTree(that); }
3578         public void visitMethodDef(JCMethodDecl that)        { visitTree(that); }
3579         public void visitVarDef(JCVariableDecl that)         { visitTree(that); }
3580         public void visitSkip(JCSkip that)                   { visitTree(that); }
3581         public void visitBlock(JCBlock that)                 { visitTree(that); }
3582         public void visitDoLoop(JCDoWhileLoop that)          { visitTree(that); }
3583         public void visitWhileLoop(JCWhileLoop that)         { visitTree(that); }
3584         public void visitWithField(JCWithField that)         { visitTree(that); }
3585         public void visitForLoop(JCForLoop that)             { visitTree(that); }
3586         public void visitForeachLoop(JCEnhancedForLoop that) { visitTree(that); }
3587         public void visitLabelled(JCLabeledStatement that)   { visitTree(that); }
3588         public void visitSwitch(JCSwitch that)               { visitTree(that); }
3589         public void visitCase(JCCase that)                   { visitTree(that); }
3590         public void visitDefaultValue(JCDefaultValue that) { visitTree(that); }
3591         public void visitSwitchExpression(JCSwitchExpression that)               { visitTree(that); }
3592         public void visitSynchronized(JCSynchronized that)   { visitTree(that); }
3593         public void visitTry(JCTry that)                     { visitTree(that); }
3594         public void visitCatch(JCCatch that)                 { visitTree(that); }
3595         public void visitConditional(JCConditional that)     { visitTree(that); }
3596         public void visitIf(JCIf that)                       { visitTree(that); }
3597         public void visitExec(JCExpressionStatement that)    { visitTree(that); }
3598         public void visitBreak(JCBreak that)                 { visitTree(that); }
3599         public void visitYield(JCYield that)                 { visitTree(that); }
3600         public void visitContinue(JCContinue that)           { visitTree(that); }
3601         public void visitReturn(JCReturn that)               { visitTree(that); }
3602         public void visitThrow(JCThrow that)                 { visitTree(that); }
3603         public void visitAssert(JCAssert that)               { visitTree(that); }
3604         public void visitApply(JCMethodInvocation that)      { visitTree(that); }
3605         public void visitNewClass(JCNewClass that)           { visitTree(that); }
3606         public void visitNewArray(JCNewArray that)           { visitTree(that); }
3607         public void visitLambda(JCLambda that)               { visitTree(that); }
3608         public void visitParens(JCParens that)               { visitTree(that); }
3609         public void visitAssign(JCAssign that)               { visitTree(that); }
3610         public void visitAssignop(JCAssignOp that)           { visitTree(that); }
< prev index next >