01: // This file is part of KeY - Integrated Deductive Software Design
02: // Copyright (C) 2001-2007 Universitaet Karlsruhe, Germany
03: // Universitaet Koblenz-Landau, Germany
04: // Chalmers University of Technology, Sweden
05: //
06: // The KeY system is protected by the GNU General Public License.
07: // See LICENSE.TXT for details.
08: package de.uka.ilkd.key.java.recoderext;
09:
10: /**
11: * an extended identifier that excepts hash symbols in its name
12: * but not as first character
13: */
14: public class ExtendedIdentifier extends recoder.java.Identifier {
15: /**
16: * generated serialVersionUID
17: */
18: private static final long serialVersionUID = 1L;
19:
20: public ExtendedIdentifier(String arg0) {
21: super (arg0);
22: }
23:
24: public void setText(String text) {
25: if (text.charAt(0) == '#') {
26: throw new IllegalArgumentException(
27: "No hash symbol allowed as first element in variable"
28: + "identifiers");
29: } else if (text.charAt(0) == '<') {
30: throw new IllegalArgumentException(text
31: + " is no valid extended identifier.");
32: }
33: id = text.intern();
34: }
35:
36: public Object deepClone() {
37: return new ExtendedIdentifier(id);
38: }
39: }
|