diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTCompositeTypeSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTCompositeTypeSpecifier.java
index 59b5eadc9df..5ccdf8604da 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTCompositeTypeSpecifier.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTCompositeTypeSpecifier.java
@@ -12,32 +12,64 @@ package org.eclipse.cdt.core.dom.ast;
/**
+ * A composite type specifier represents a ocmposite structure (contains declarations).
+ *
* @author Doug Schaefer
*/
public interface IASTCompositeTypeSpecifier extends IASTDeclSpecifier {
+ /**
+ * TYPE_NAME
represents the relationship between an IASTCompositeTypeSpecifier
and its IASTName
.
+ */
public static final ASTNodeProperty TYPE_NAME = new ASTNodeProperty( "Type Name"); //$NON-NLS-1$
- public static final ASTNodeProperty MEMBER_DECLARATION = new ASTNodeProperty( "Member Declaration"); //$NON-NLS-1$
+
/**
- * Is this a struct or a union or some other type of composite type.
+ * MEMBER_DECLARATION
represents the relationship between an IASTCompositeTypeSpecifier
and its nestedIASTDeclaration
s.
+ */
+ public static final ASTNodeProperty MEMBER_DECLARATION = new ASTNodeProperty( "Member Declaration"); //$NON-NLS-1$
+
+ /**
+ * Get the type (key) of this composite specifier.
*
* @return key for this type
*/
public int getKey();
+
+
+ /**
+ * k_struct
represents 'struct' in C & C++
+ */
public static final int k_struct = 1;
+ /**
+ * k_union
represents 'union' in C & C++
+ */
public static final int k_union = 2;
+ /**
+ * k_last
allows for subinterfaces to continue enumerating keys
+ */
public static final int k_last = k_union;
+ /**
+ * Set the type (key) of this composite specifier.
+ *
+ * @param key
+ */
public void setKey( int key );
+
/**
* Return the name for this composite type. If this is an anonymous
- * type, this will return null.
+ * type, this will return an empty name.
*
- * @return the name of the type or null
+ * @return the name of the type
*/
public IASTName getName();
+ /**
+ * Set the name for this composite type.
+ *
+ * @param name
+ */
public void setName( IASTName name );
/**
@@ -47,7 +79,17 @@ public interface IASTCompositeTypeSpecifier extends IASTDeclSpecifier {
*/
public IASTDeclaration[] getMembers();
+ /**
+ * Add a member declaration.
+ *
+ * @param declaration
+ */
public void addMemberDeclaration( IASTDeclaration declaration );
+ /**
+ * Get the scope that this interface eludes to in the logical tree.
+ *
+ * @return
+ */
public IScope getScope();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTCompoundStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTCompoundStatement.java
index 36da2cb03ce..ad3f96b8f4e 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTCompoundStatement.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTCompoundStatement.java
@@ -18,16 +18,29 @@ package org.eclipse.cdt.core.dom.ast;
*/
public interface IASTCompoundStatement extends IASTStatement {
- ASTNodeProperty NESTED_STATEMENT = new ASTNodeProperty( "Nested Statement" ); //$NON-NLS-1$
+ /**
+ * NESTED_STATEMENT
represents the relationship between an IASTCompoundStatement
and its nested IASTStatement
+ */
+ public static final ASTNodeProperty NESTED_STATEMENT = new ASTNodeProperty( "Nested Statement" ); //$NON-NLS-1$
/**
* Gets the statements in this block.
*
- * @return List of IASTStatement
+ * @return Array of IASTStatement
*/
public IASTStatement[] getStatements();
+ /**
+ * Add a statement to the compound block.
+ *
+ * @param statement statement to be added
+ */
public void addStatement( IASTStatement statement );
+ /**
+ * Get IScope
node that this node eludes to in the logical tree.
+ *
+ * @return the IScope
+ */
public IScope getScope();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTConditionalExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTConditionalExpression.java
index 1686f9340ba..775d7dbfc4f 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTConditionalExpression.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTConditionalExpression.java
@@ -10,21 +10,63 @@
package org.eclipse.cdt.core.dom.ast;
/**
+ * Conditional Expression of the format X ? Y : Z
+ *
* @author jcamelon
*/
public interface IASTConditionalExpression extends IASTExpression {
+ /**
+ * LOGICAL_CONDITION
represents the relationship between an IASTConditionalExpression
and its condition IASTExpression
.
+ */
public static final ASTNodeProperty LOGICAL_CONDITION = new ASTNodeProperty( "Logical Condition"); //$NON-NLS-1$
+ /**
+ * POSITIVE_RESULT
represents the relationship between an IASTConditionalExpression
and its positive result IASTExpression
.
+ */
public static final ASTNodeProperty POSITIVE_RESULT = new ASTNodeProperty( "Positive Result" ); //$NON-NLS-1$
+ /**
+ * NEGATIVE_RESULT
represents the relationship between an IASTConditionalExpression
and its positive result IASTExpression
.
+ */
public static final ASTNodeProperty NEGATIVE_RESULT = new ASTNodeProperty( "Negative Result" ); //$NON-NLS-1$
+ /**
+ * Get the logical condition expression.
+ *
+ * @return IASTExpression
representing the logical condition.
+ */
+
public IASTExpression getLogicalConditionExpression();
+ /**
+ * Set the logical condition expression.
+ *
+ * @param expression condition to be set
+ */
public void setLogicalConditionExpression( IASTExpression expression );
+ /**
+ * Get the positive result expression.
+ *
+ * @return IASTExpression
+ */
public IASTExpression getPositiveResultExpression();
+ /**
+ * Set positive result expression.
+ *
+ * @param expression
+ */
public void setPositiveResultExpression(IASTExpression expression);
+ /**
+ * Get the negative result expression.
+ * @return IASTExpression
+ */
public IASTExpression getNegativeResultExpression();
+
+ /**
+ * Set negative result expression.
+ *
+ * @param expression IASTExpression
+ */
public void setNegativeResultExpression(IASTExpression expression);
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDeclSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDeclSpecifier.java
index a73bb40f23a..fcecc93b488 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDeclSpecifier.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDeclSpecifier.java
@@ -11,32 +11,96 @@
package org.eclipse.cdt.core.dom.ast;
/**
+ * This is the base interface that represents a declaration specifier sequence.
+ *
* @author Doug Schaefer
*/
public interface IASTDeclSpecifier extends IASTNode {
-
- // Storage class
- public int getStorageClass();
+
+ /**
+ * sc_unspecified
undefined storage class
+ */
public static final int sc_unspecified = 0;
+ /**
+ * sc_typedef
typedef
+ */
public static final int sc_typedef = 1;
+ /**
+ * sc_extern
extern
+ */
+
public static final int sc_extern = 2;
+ /**
+ * sc_static
static
+ */
+
public static final int sc_static = 3;
+ /**
+ * sc_auto
auto
+ */
+
public static final int sc_auto = 4;
+
+ /**
+ * sc_register
register
+ */
public static final int sc_register = 5;
+
+ /**
+ * sc_last
for sub-interfaces to continue on
+ */
public static final int sc_last = sc_register;
+ /**
+ * Set the storage class.
+ * @param storageClass int
+ */
public void setStorageClass( int storageClass );
+ /**
+ * Get the storage class.
+ * @return int
+ */
+ public int getStorageClass();
// Type qualifier
+ /**
+ * Is const modifier used?
+ * @return boolean
+ */
public boolean isConst();
+ /**
+ * Set const modifier used.
+ * @param value boolean
+ */
public void setConst( boolean value );
+
+ /**
+ * Is volatile modifier used?
+ * @return boolean
+ */
public boolean isVolatile();
+ /**
+ * Set volatile modifier used.
+ * @param value boolean
+ */
public void setVolatile( boolean value );
// Function specifier
+ /**
+ * Is inline modifier used?
+ * @return boolean
+ */
public boolean isInline();
+ /**
+ * Set inline modifier used.
+ * @param value boolean
+ */
public void setInline( boolean value );
+ /**
+ * Get the string that represents the decl specifier seq. as represented in the file pre-processing.
+ * @return String
+ */
public String getUnpreprocessedSignature();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDeclarationStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDeclarationStatement.java
index b792797cdda..38c602f29a6 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDeclarationStatement.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDeclarationStatement.java
@@ -17,6 +17,9 @@ package org.eclipse.cdt.core.dom.ast;
*/
public interface IASTDeclarationStatement extends IASTStatement {
+ /**
+ * DECLARATION
represents the relationship between a declaration statement and the declaration it wraps.
+ */
public static final ASTNodeProperty DECLARATION = new ASTNodeProperty( "Declaration"); //$NON-NLS-1$
/**
@@ -26,6 +29,11 @@ public interface IASTDeclarationStatement extends IASTStatement {
*/
public IASTDeclaration getDeclaration();
+ /**
+ * Set the declaration for this statement.
+ *
+ * @param declaration
+ */
public void setDeclaration( IASTDeclaration declaration );
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDeclarator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDeclarator.java
index 20482d53c4d..fb165a3335a 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDeclarator.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDeclarator.java
@@ -12,24 +12,47 @@ package org.eclipse.cdt.core.dom.ast;
/**
+ * Base interface for a declarator.
+ *
* @author Doug Schaefer
*/
public interface IASTDeclarator extends IASTNode {
+
+ /**
+ * Constant - empty declarator array
+ */
public static final IASTDeclarator[] EMPTY_DECLARATOR_ARRAY = new IASTDeclarator[0];
- ASTNodeProperty POINTER_OPERATOR = new ASTNodeProperty( "Pointer Operator"); //$NON-NLS-1$
- ASTNodeProperty INITIALIZER = new ASTNodeProperty( "Initializer"); //$NON-NLS-1$
- ASTNodeProperty NESTED_DECLARATOR = new ASTNodeProperty( "Nested Declarator"); //$NON-NLS-1$
- ASTNodeProperty DECLARATOR_NAME = new ASTNodeProperty( "Declarator Name"); //$NON-NLS-1$
+ /**
+ * POINTER_OPERATOR
represents the relationship between an IASTDeclarator
and an IASTPointerOperator
.
+ */
+ public static final ASTNodeProperty POINTER_OPERATOR = new ASTNodeProperty( "Pointer Operator"); //$NON-NLS-1$
+ /**
+ * INITIALIZER
represents the relationship between an IASTDeclarator
and an IASTInitializer
.
+ */
+ public static final ASTNodeProperty INITIALIZER = new ASTNodeProperty( "Initializer"); //$NON-NLS-1$
+ /**
+ * NESTED_DECLARATOR
represents the relationship between an IASTDeclarator
and a nested IASTDeclarator
.
+ */
+ public static final ASTNodeProperty NESTED_DECLARATOR = new ASTNodeProperty( "Nested Declarator"); //$NON-NLS-1$
+ /**
+ * DECLARATOR_NAME
represents the relationship between an IASTDeclarator
and an IASTName
.
+ */
+ public static final ASTNodeProperty DECLARATOR_NAME = new ASTNodeProperty( "Declarator Name"); //$NON-NLS-1$
/**
* This is the list of pointer operators applied to the type for
* the declarator.
*
- * @return List of IASTPointerOperator
+ * @return array of IASTPointerOperator
*/
public IASTPointerOperator[] getPointerOperators();
+ /**
+ * Adds a pointer operator to the declarator.
+ *
+ * @param operator IASTPointerOperator
to be added.
+ */
public void addPointerOperator( IASTPointerOperator operator );
/**
@@ -44,12 +67,17 @@ public interface IASTDeclarator extends IASTNode {
/**
* This returns the name of the declarator. If this is an abstract
- * declarator, this will return null.
+ * declarator, this will return an empty name.
*
- * @return the name of the declarator or null
+ * @return the name of the declarator
*/
public IASTName getName();
+ /**
+ * Set the name of he declarator.
+ *
+ * @param name IASTName
+ */
public void setName( IASTName name );
/**
@@ -59,6 +87,11 @@ public interface IASTDeclarator extends IASTNode {
*/
public IASTInitializer getInitializer();
+ /**
+ * Set the optional initializer.
+ *
+ * @param initializer IASTInitializer
+ */
public void setInitializer( IASTInitializer initializer );
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDoStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDoStatement.java
index dc1164a1deb..da60a2a7322 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDoStatement.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDoStatement.java
@@ -17,16 +17,26 @@ package org.eclipse.cdt.core.dom.ast;
*/
public interface IASTDoStatement extends IASTStatement {
+ /**
+ * BODY
represents the relationship between a IASTDoStatement
and its nested body IASTStatement
.
+ */
public static final ASTNodeProperty BODY = new ASTNodeProperty("body"); //$NON-NLS-1$
+ /**
+ * CONDITION
represents the relationship between a IASTDoStatement
and its condition IASTExpression
.
+ */
public static final ASTNodeProperty CONDITION = new ASTNodeProperty("condition"); //$NON-NLS-1$
/**
- * The body of the loop.
+ * Get the body of the loop.
*
- * @return
+ * @return IASTStatement
loop code body
*/
public IASTStatement getBody();
+ /**
+ * Set the body of the loop.
+ * @param body an IASTStatement
+ */
public void setBody(IASTStatement body);
/**
@@ -36,6 +46,10 @@ public interface IASTDoStatement extends IASTStatement {
*/
public IASTExpression getCondition();
+ /**
+ * Set the condition for the loop.
+ * @param condition an IASTExpression
+ */
public void setCondition(IASTExpression condition);
}