View Javadoc
1   package de.fhdw.wtf.common.ast;
2   
3   import de.fhdw.wtf.common.ast.visitor.AttributModifierVisitor;
4   import de.fhdw.wtf.common.ast.visitor.AttributeModifierVisitorReturn;
5   import de.fhdw.wtf.common.ast.visitor.AttributeModifierVisitorReturnException;
6   import de.fhdw.wtf.common.token.Token;
7   
8   /**
9    * This class represents a modifier of an {@link Attribute}. A modifier comes to effect at the code generation.
10   * 
11   */
12  public abstract class AttributeModifier extends SyntaxObject {
13  	
14  	/**
15  	 * generated.
16  	 */
17  	private static final long serialVersionUID = 7294206416348396019L;
18  	
19  	/**
20  	 * Protected Constructor of {@link AttributeModifier}.
21  	 * 
22  	 * @param firstToken
23  	 *            firstToken
24  	 * @param lastToken
25  	 *            lastToken
26  	 */
27  	protected AttributeModifier(final Token firstToken, final Token lastToken) {
28  		super(firstToken, lastToken);
29  		
30  	}
31  	
32  	/**
33  	 * Accepts the sub types of {@link AttributeModifier} and implements the required functions.
34  	 * 
35  	 * @param visitor
36  	 *            is visitor that describes what has to be done for the particular {@link AttributeModifier}.
37  	 * @return Boolean
38  	 */
39  	public abstract boolean accept(AttributModifierVisitor visitor);
40  	
41  	/**
42  	 * Accepts a visitor with dynamic return type.
43  	 * 
44  	 * @param visitor
45  	 *            The Visitor to be accepted.
46  	 * @param <X>
47  	 *            ReturnType
48  	 * @return X.
49  	 */
50  	public abstract <X> X accept(AttributeModifierVisitorReturn<X> visitor);
51  	
52  	/**
53  	 * Accepts a visitor with dynamic return type and exception.
54  	 * 
55  	 * @param visitor
56  	 *            The Visitor to be accepted.
57  	 * @param <X>
58  	 *            ReturnType
59  	 * @param <Y>
60  	 *            ExceptionType
61  	 * @return X
62  	 * @throws Y
63  	 *             Exception
64  	 */
65  	public abstract <X, Y extends Exception> X accept(AttributeModifierVisitorReturnException<X, Y> visitor) throws Y;
66  	
67  }