1 package de.fhdw.wtf.common.ast;
2
3 import de.fhdw.wtf.common.ast.visitor.GroupElementExceptionVisitor;
4 import de.fhdw.wtf.common.ast.visitor.GroupElementReturnVisitor;
5 import de.fhdw.wtf.common.ast.visitor.GroupElementVisitor;
6
7 /**
8 * This class represents an element contained by a {@link Group}. It has to be either a {@link Group} by itself or a
9 * <ClassType>.
10 */
11 public interface GroupElement extends SyntaxObjectInterface {
12
13 /**
14 * Returns the {@link Name} of this element.
15 *
16 * @return : Name.
17 */
18 Name getName();
19
20 /**
21 * Accepts the sub types of {@link GroupElement} and implements the required functions.
22 *
23 * @param visitor
24 * is visitor that describes what has to be done for the particular {@link GroupElement}.
25 */
26 void accept(GroupElementVisitor visitor);
27
28 /**
29 * Visitor for subtypes of common.ast.GroupElement. Throws any Exception.
30 *
31 * @param visitor
32 * : Visitor.
33 * @param <X>
34 * ReturnType
35 * @throws X
36 * : Exception.
37 */
38 <X extends Exception> void accept(GroupElementExceptionVisitor<X> visitor) throws X;
39
40 /**
41 * Accepts a return visitor.
42 *
43 * @param visitor
44 * Visitor
45 * @param <X>
46 * ReturnType
47 * @return X
48 */
49 <X> X accept(GroupElementReturnVisitor<X> visitor);
50
51 }