01: /*
02: * xtc - The eXTensible Compiler
03: * Copyright (C) 2007 Robert Grimm
04: *
05: * This program is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU General Public License
07: * version 2 as published by the Free Software Foundation.
08: *
09: * This program is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12: * GNU General Public License for more details.
13: *
14: * You should have received a copy of the GNU General Public License
15: * along with this program; if not, write to the Free Software
16: * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
17: * USA.
18: */
19: package xtc.parser;
20:
21: import java.io.IOException;
22:
23: /**
24: * A null literal representing a bindable null value.
25: *
26: * @author Robert Grimm
27: * @version $Revision: 1.1 $
28: */
29: public class NullLiteral extends Element {
30:
31: /** Create a new null literal. */
32: public NullLiteral() { /* Nothing to do. */
33: }
34:
35: public Tag tag() {
36: return Tag.NULL;
37: }
38:
39: public int hashCode() {
40: return 0;
41: }
42:
43: public boolean equals(Object o) {
44: if (this == o)
45: return true;
46: return o instanceof NullLiteral;
47: }
48:
49: public void write(Appendable out) throws IOException {
50: out.append("null");
51: }
52:
53: public String toString() {
54: return "null";
55: }
56:
57: }
|