01: /*
02: * xtc - The eXTensible Compiler
03: * Copyright (C) 2004-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.util.List;
22:
23: /**
24: * Element to set the semantic value to a {@link xtc.tree.GNode
25: * generic node}. The children of the generic node are the
26: * production's component expressions.
27: *
28: * @author Robert Grimm
29: * @version $Revision: 1.10 $
30: */
31: public class GenericNodeValue extends GenericValue {
32:
33: /**
34: * Create a new generic node value.
35: *
36: * @param name The name.
37: * @param children The list of children.
38: * @param formatting The list of bindings for formatting.
39: */
40: public GenericNodeValue(String name, List<Binding> children,
41: List<Binding> formatting) {
42: super (name, children, formatting);
43: }
44:
45: public Tag tag() {
46: return Tag.GENERIC_NODE_VALUE;
47: }
48:
49: public int hashCode() {
50: return name.hashCode();
51: }
52:
53: public boolean equals(Object o) {
54: if (this == o)
55: return true;
56: if (!(o instanceof GenericNodeValue))
57: return false;
58: GenericNodeValue other = (GenericNodeValue) o;
59: if (!name.equals(other.name))
60: return false;
61: if (!children.equals(other.children))
62: return false;
63: return formatting.equals(other.formatting);
64: }
65:
66: }
|