| JWildExpression.java |
1 // Copyright 2012- Bill Campbell, Swami Iyer and Bahar Akbal-Delibas
2
3 package jminusminus;
4
5 /**
6 * The AST node for a "wild" expression. A wild expression is a placeholder expression, used when
7 * there is a syntax error.
8 */
9 class JWildExpression extends JExpression {
10 /**
11 * Constructs an AST node for a "wild" expression.
12 *
13 * @param line line in which the "wild" expression occurs occurs in the source file.
14 */
15
16 public JWildExpression(int line) {
17 super(line);
18 }
19
20 /**
21 * {@inheritDoc}
22 */
23 public JExpression analyze(Context context) {
24 type = Type.ANY;
25 return this;
26 }
27
28 /**
29 * {@inheritDoc}
30 */
31 public void codegen(CLEmitter output) {
32 // Nothing here.
33 }
34
35 /**
36 * {@inheritDoc}
37 */
38 public void toJSON(JSONElement json) {
39 JSONElement e = new JSONElement();
40 json.addChild("JWildExpression:" + line, e);
41 }
42 }
43