01: /*
02: * xtc - The eXTensible Compiler
03: * Copyright (C) 2007 Robert Grimm
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public License
07: * version 2.1 as published by the Free Software Foundation.
08: *
09: * This library 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 GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
17: * USA.
18: */
19: package xtc.tree;
20:
21: /**
22: * The interface to objects with a source location.
23: *
24: * @author Robert Grimm
25: * @version $Revision: 1.2 $
26: */
27: public interface Locatable {
28:
29: /**
30: * Determine whether this object has a location.
31: *
32: * @return <code>true</code> if this object has a location.
33: */
34: boolean hasLocation();
35:
36: /**
37: * Get this object's location.
38: *
39: * @return This object's location or <code>null</code> if it does
40: * not have a location.
41: */
42: Location getLocation();
43:
44: /**
45: * Set this object's location.
46: *
47: * @param location This object's location.
48: */
49: void setLocation(Location location);
50:
51: /**
52: * Set this object's location to the specified locatable's location.
53: *
54: * @param locatable The locatable object.
55: */
56: void setLocation(Locatable locatable);
57:
58: }
|