1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | |
|
22 | |
|
23 | |
|
24 | |
|
25 | |
|
26 | |
package com.sun.tools.javafx.tree; |
27 | |
|
28 | |
import com.sun.javafx.api.tree.BlockExpressionTree; |
29 | |
import com.sun.javafx.api.tree.JavaFXTree.JavaFXKind; |
30 | |
import com.sun.javafx.api.tree.JavaFXTreeVisitor; |
31 | |
import com.sun.source.tree.Tree.Kind; |
32 | |
import com.sun.tools.javac.util.List; |
33 | |
import com.sun.tools.javac.util.*; |
34 | |
import com.sun.tools.javac.tree.*; |
35 | |
import com.sun.source.tree.*; |
36 | |
import com.sun.tools.javac.code.*; |
37 | |
import com.sun.source.tree.*; |
38 | |
import com.sun.tools.javac.tree.JCTree.*; |
39 | |
import com.sun.tools.javafx.comp.*; |
40 | |
|
41 | |
|
42 | |
|
43 | |
|
44 | 6 | public class JFXBlockExpression extends JFXExpression implements BlockExpressionTree { |
45 | |
public long flags; |
46 | |
public List<JCStatement> stats; |
47 | |
public JCExpression value; |
48 | |
|
49 | 3131 | public int endpos = Position.NOPOS; |
50 | 3131 | protected JFXBlockExpression(long flags, List<JCStatement> stats, JCExpression value) { |
51 | 3131 | this.stats = stats; |
52 | 3131 | this.flags = flags; |
53 | 3131 | this.value = value; |
54 | 3131 | } |
55 | |
|
56 | 10781 | public void accept(JavafxVisitor v) { v.visitBlockExpression(this);} |
57 | |
|
58 | |
public List<JCStatement> getStatements() { |
59 | 2040 | return stats; |
60 | |
} |
61 | |
|
62 | |
public JCExpression getValue() { |
63 | 3 | return value; |
64 | |
} |
65 | |
|
66 | |
public void accept(Visitor v) { |
67 | |
|
68 | 18594 | if (v instanceof JavafxVisitor) |
69 | 10781 | this.accept((JavafxVisitor)v); |
70 | 7813 | else if (v instanceof Pretty) |
71 | 0 | JavaPretty.visitBlockExpression((Pretty) v, this); |
72 | 7813 | else if (v instanceof BlockExprAttr) |
73 | 1198 | ((BlockExprAttr) v).visitBlockExpression(this); |
74 | 6615 | else if (v instanceof BlockExprEnter) |
75 | 0 | ((BlockExprEnter) v).visitBlockExpression(this); |
76 | 6615 | else if (v instanceof BlockExprMemberEnter) |
77 | 0 | ((BlockExprMemberEnter) v).visitBlockExpression(this); |
78 | 6615 | else if (v instanceof JavafxPrepForBackEnd) |
79 | 1198 | ((JavafxPrepForBackEnd) v).visitBlockExpression(this); |
80 | |
|
81 | 5417 | else if (v instanceof TreeScanner) { |
82 | 1892 | ((TreeScanner)v).scan(stats); |
83 | 1892 | ((TreeScanner)v).scan(value); |
84 | 3525 | } else if (v instanceof TreeTranslator) { |
85 | 2360 | stats = ((TreeTranslator)v).translate(stats); |
86 | 2360 | value = ((TreeTranslator)v).translate(value); |
87 | 2360 | ((TreeTranslator)v).result = this; |
88 | |
} else { |
89 | 1165 | v.visitTree(this); |
90 | |
} |
91 | 18591 | } |
92 | 0 | public boolean isStatic() { return (flags & Flags.STATIC) != 0; } |
93 | |
|
94 | |
@Override |
95 | |
public int getTag() { |
96 | 7530 | return JavafxTag.BLOCK_EXPRESSION; |
97 | |
} |
98 | |
|
99 | |
@Override |
100 | |
public <R, D> R accept(JavaFXTreeVisitor<R, D> v, D d) { |
101 | 3 | return v.visitBlockExpression(this, d); |
102 | |
} |
103 | |
|
104 | |
public JavaFXKind getJavaFXKind() { |
105 | 0 | return JavaFXKind.BLOCK_EXPRESSION; |
106 | |
} |
107 | |
|
108 | |
} |