Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: cae27e5e52330813795dfc0627f70bd5cc897c27 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*******************************************************************************
 * Copyright (c) 2004, 2009 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    John Camelon (IBM) - Initial API and implementation
 *******************************************************************************/
package org.eclipse.cdt.core.dom.ast.c;

import org.eclipse.cdt.core.dom.ast.ASTNodeProperty;
import org.eclipse.cdt.core.dom.ast.IASTInitializer;

/**
 * This interface represents a designated initializer. e.g. struct x y = { .z=4,
 * .t[1] = 3 };
 * 
 * @noextend This interface is not intended to be extended by clients.
 * @noimplement This interface is not intended to be implemented by clients.
 */
public interface ICASTDesignatedInitializer extends IASTInitializer {

	/**
	 * Constant.
	 */
	public static final ICASTDesignator[] EMPTY_DESIGNATOR_ARRAY = new ICASTDesignator[0];

	/**
	 * <code>DESIGNATOR</code> represents the relationship between an
	 * <code>ICASTDesignatedInitializer</code> and
	 * <code>ICASTDesignator</code>.
	 */
	public static final ASTNodeProperty DESIGNATOR = new ASTNodeProperty(
			"ICASTDesignatedInitializer.DESIGNATOR - relationship between ICASTDesignatedInitializer and ICASTDesignator"); //$NON-NLS-1$

	/**
	 * Add a designator to this initializer.
	 * 
	 * @param designator
	 *            <code>ICASTDesignator</code>
	 */
	public void addDesignator(ICASTDesignator designator);

	/**
	 * Get all of the designators.
	 * 
	 * @return <code>ICASTDesignator []</code>
	 */
	public ICASTDesignator[] getDesignators();

	/**
	 * <code>OPERAND</code> represents the relationship between
	 * <code>ICASTDesignatedInitializer</code> and its
	 * <code>IASTInitializer</code>.
	 */
	public static final ASTNodeProperty OPERAND = new ASTNodeProperty(
			"ICASTDesignatedInitializer.OPERAND - RHS IASTInitializer for ICASTDesignatedInitializer"); //$NON-NLS-1$

	/**
	 * Get the nested initializer.
	 * 
	 * @return <code>IASTInitializer</code>
	 */
	public IASTInitializer getOperandInitializer();

	/**
	 * Set the nested initializer.
	 * 
	 * @param rhs
	 *            <code>IASTInitializer</code>
	 */
	public void setOperandInitializer(IASTInitializer rhs);
	
	/**
	 * @since 5.1
	 */
	public ICASTDesignatedInitializer copy();
}

Back to the top