01: /*
02: * xtc - The eXTensible Compiler
03: * Copyright (C) 2006-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: /**
22: * Element to set the semantic value to a binding.
23: *
24: * @author Robert Grimm
25: * @version $Revision: 1.3 $
26: */
27: public class BindingValue extends ValueElement {
28:
29: /** The binding. */
30: public final Binding binding;
31:
32: /**
33: * Create a new binding value.
34: *
35: * @param binding The binding.
36: */
37: public BindingValue(Binding binding) {
38: this .binding = binding;
39: }
40:
41: public Tag tag() {
42: return Tag.BINDING_VALUE;
43: }
44:
45: public int hashCode() {
46: return binding.hashCode();
47: }
48:
49: public boolean equals(Object o) {
50: if (this == o)
51: return true;
52: if (!(o instanceof BindingValue))
53: return false;
54: return binding.equals(((BindingValue) o).binding);
55: }
56:
57: }
|