1
3 package jminusminus;
4
5 import static jminusminus.CLConstants.*;
6
7
10 public class JDoStatement extends JStatement {
11 private JStatement body;
13
14 private JExpression condition;
16
17
24 public JDoStatement(int line, JStatement body, JExpression condition) {
25 super(line);
26 this.body = body;
27 this.condition = condition;
28 }
29
30
33 public JStatement analyze(Context context) {
34 return this;
36 }
37
38
41 public void codegen(CLEmitter output) {
42 }
44
45
48 public void toJSON(JSONElement json) {
49 JSONElement e = new JSONElement();
50 json.addChild("JDoStatement:" + line, e);
51 JSONElement e1 = new JSONElement();
52 e.addChild("Body", e1);
53 body.toJSON(e1);
54 JSONElement e2 = new JSONElement();
55 e.addChild("Condition", e2);
56 condition.toJSON(e2);
57 }
58 }
59