1
3 package jminusminus;
4
5
9 class JStatementExpression extends JStatement {
10
13 protected JExpression expr;
14
15
21 public JStatementExpression(int line, JExpression expr) {
22 super(line);
23 this.expr = expr;
24 }
25
26
29 public JStatement analyze(Context context) {
30 if (expr.isStatementExpression) {
31 expr = expr.analyze(context);
32 }
33 return this;
34 }
35
36
39 public void codegen(CLEmitter output) {
40 expr.codegen(output);
41 }
42
43
46 public void toJSON(JSONElement json) {
47 JSONElement e = new JSONElement();
48 json.addChild("JStatementExpression:" + line, e);
49 expr.toJSON(e);
50 }
51 }
52