1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

Add JavaDoc.

This commit is contained in:
John Camelon 2005-03-09 20:54:13 +00:00
parent 9b1b4fc340
commit e9c3b52623
7 changed files with 234 additions and 18 deletions

View file

@ -12,32 +12,64 @@ package org.eclipse.cdt.core.dom.ast;
/** /**
* A composite type specifier represents a ocmposite structure (contains declarations).
*
* @author Doug Schaefer * @author Doug Schaefer
*/ */
public interface IASTCompositeTypeSpecifier extends IASTDeclSpecifier { public interface IASTCompositeTypeSpecifier extends IASTDeclSpecifier {
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. * <code>TYPE_NAME</code> represents the relationship between an <code>IASTCompositeTypeSpecifier</code> and its <code>IASTName</code>.
*/
public static final ASTNodeProperty TYPE_NAME = new ASTNodeProperty( "Type Name"); //$NON-NLS-1$
/**
* <code>MEMBER_DECLARATION</code> represents the relationship between an <code>IASTCompositeTypeSpecifier</code> and its nested<code>IASTDeclaration</code>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 * @return key for this type
*/ */
public int getKey(); public int getKey();
/**
* <code>k_struct</code> represents 'struct' in C & C++
*/
public static final int k_struct = 1; public static final int k_struct = 1;
/**
* <code>k_union</code> represents 'union' in C & C++
*/
public static final int k_union = 2; public static final int k_union = 2;
/**
* <code>k_last</code> allows for subinterfaces to continue enumerating keys
*/
public static final int k_last = k_union; public static final int k_last = k_union;
/**
* Set the type (key) of this composite specifier.
*
* @param key
*/
public void setKey( int key ); public void setKey( int key );
/** /**
* Return the name for this composite type. If this is an anonymous * 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(); public IASTName getName();
/**
* Set the name for this composite type.
*
* @param name
*/
public void setName( IASTName name ); public void setName( IASTName name );
/** /**
@ -47,7 +79,17 @@ public interface IASTCompositeTypeSpecifier extends IASTDeclSpecifier {
*/ */
public IASTDeclaration[] getMembers(); public IASTDeclaration[] getMembers();
/**
* Add a member declaration.
*
* @param declaration
*/
public void addMemberDeclaration( IASTDeclaration declaration ); public void addMemberDeclaration( IASTDeclaration declaration );
/**
* Get the scope that this interface eludes to in the logical tree.
*
* @return
*/
public IScope getScope(); public IScope getScope();
} }

View file

@ -18,16 +18,29 @@ package org.eclipse.cdt.core.dom.ast;
*/ */
public interface IASTCompoundStatement extends IASTStatement { public interface IASTCompoundStatement extends IASTStatement {
ASTNodeProperty NESTED_STATEMENT = new ASTNodeProperty( "Nested Statement" ); //$NON-NLS-1$ /**
* <code>NESTED_STATEMENT</code> represents the relationship between an <code>IASTCompoundStatement</code> and its nested <code>IASTStatement</code>
*/
public static final ASTNodeProperty NESTED_STATEMENT = new ASTNodeProperty( "Nested Statement" ); //$NON-NLS-1$
/** /**
* Gets the statements in this block. * Gets the statements in this block.
* *
* @return List of IASTStatement * @return Array of IASTStatement
*/ */
public IASTStatement[] getStatements(); public IASTStatement[] getStatements();
/**
* Add a statement to the compound block.
*
* @param statement statement to be added
*/
public void addStatement( IASTStatement statement ); public void addStatement( IASTStatement statement );
/**
* Get <code>IScope</code> node that this node eludes to in the logical tree.
*
* @return the <code>IScope</code>
*/
public IScope getScope(); public IScope getScope();
} }

View file

@ -10,21 +10,63 @@
package org.eclipse.cdt.core.dom.ast; package org.eclipse.cdt.core.dom.ast;
/** /**
* Conditional Expression of the format X ? Y : Z
*
* @author jcamelon * @author jcamelon
*/ */
public interface IASTConditionalExpression extends IASTExpression { public interface IASTConditionalExpression extends IASTExpression {
/**
* <code>LOGICAL_CONDITION</code> represents the relationship between an <code>IASTConditionalExpression</code> and its condition <code>IASTExpression</code>.
*/
public static final ASTNodeProperty LOGICAL_CONDITION = new ASTNodeProperty( "Logical Condition"); //$NON-NLS-1$ public static final ASTNodeProperty LOGICAL_CONDITION = new ASTNodeProperty( "Logical Condition"); //$NON-NLS-1$
/**
* <code>POSITIVE_RESULT</code> represents the relationship between an <code>IASTConditionalExpression</code> and its positive result <code>IASTExpression</code>.
*/
public static final ASTNodeProperty POSITIVE_RESULT = new ASTNodeProperty( "Positive Result" ); //$NON-NLS-1$ public static final ASTNodeProperty POSITIVE_RESULT = new ASTNodeProperty( "Positive Result" ); //$NON-NLS-1$
/**
* <code>NEGATIVE_RESULT</code> represents the relationship between an <code>IASTConditionalExpression</code> and its positive result <code>IASTExpression</code>.
*/
public static final ASTNodeProperty NEGATIVE_RESULT = new ASTNodeProperty( "Negative Result" ); //$NON-NLS-1$ public static final ASTNodeProperty NEGATIVE_RESULT = new ASTNodeProperty( "Negative Result" ); //$NON-NLS-1$
/**
* Get the logical condition expression.
*
* @return <code>IASTExpression</code> representing the logical condition.
*/
public IASTExpression getLogicalConditionExpression(); public IASTExpression getLogicalConditionExpression();
/**
* Set the logical condition expression.
*
* @param expression condition to be set
*/
public void setLogicalConditionExpression( IASTExpression expression ); public void setLogicalConditionExpression( IASTExpression expression );
/**
* Get the positive result expression.
*
* @return <code>IASTExpression</code>
*/
public IASTExpression getPositiveResultExpression(); public IASTExpression getPositiveResultExpression();
/**
* Set positive result expression.
*
* @param expression
*/
public void setPositiveResultExpression(IASTExpression expression); public void setPositiveResultExpression(IASTExpression expression);
/**
* Get the negative result expression.
* @return <code>IASTExpression</code>
*/
public IASTExpression getNegativeResultExpression(); public IASTExpression getNegativeResultExpression();
/**
* Set negative result expression.
*
* @param expression <code>IASTExpression</code>
*/
public void setNegativeResultExpression(IASTExpression expression); public void setNegativeResultExpression(IASTExpression expression);
} }

View file

@ -11,32 +11,96 @@
package org.eclipse.cdt.core.dom.ast; package org.eclipse.cdt.core.dom.ast;
/** /**
* This is the base interface that represents a declaration specifier sequence.
*
* @author Doug Schaefer * @author Doug Schaefer
*/ */
public interface IASTDeclSpecifier extends IASTNode { public interface IASTDeclSpecifier extends IASTNode {
// Storage class /**
public int getStorageClass(); * <code>sc_unspecified</code> undefined storage class
*/
public static final int sc_unspecified = 0; public static final int sc_unspecified = 0;
/**
* <code>sc_typedef</code> typedef
*/
public static final int sc_typedef = 1; public static final int sc_typedef = 1;
/**
* <code>sc_extern</code>extern
*/
public static final int sc_extern = 2; public static final int sc_extern = 2;
/**
* <code>sc_static</code>static
*/
public static final int sc_static = 3; public static final int sc_static = 3;
/**
* <code>sc_auto</code>auto
*/
public static final int sc_auto = 4; public static final int sc_auto = 4;
/**
* <code>sc_register</code>register
*/
public static final int sc_register = 5; public static final int sc_register = 5;
/**
* <code>sc_last</code> for sub-interfaces to continue on
*/
public static final int sc_last = sc_register; public static final int sc_last = sc_register;
/**
* Set the storage class.
* @param storageClass int
*/
public void setStorageClass( int storageClass ); public void setStorageClass( int storageClass );
/**
* Get the storage class.
* @return int
*/
public int getStorageClass();
// Type qualifier // Type qualifier
/**
* Is const modifier used?
* @return boolean
*/
public boolean isConst(); public boolean isConst();
/**
* Set const modifier used.
* @param value boolean
*/
public void setConst( boolean value ); public void setConst( boolean value );
/**
* Is volatile modifier used?
* @return boolean
*/
public boolean isVolatile(); public boolean isVolatile();
/**
* Set volatile modifier used.
* @param value boolean
*/
public void setVolatile( boolean value ); public void setVolatile( boolean value );
// Function specifier // Function specifier
/**
* Is inline modifier used?
* @return boolean
*/
public boolean isInline(); public boolean isInline();
/**
* Set inline modifier used.
* @param value boolean
*/
public void setInline( boolean value ); 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(); public String getUnpreprocessedSignature();
} }

View file

@ -17,6 +17,9 @@ package org.eclipse.cdt.core.dom.ast;
*/ */
public interface IASTDeclarationStatement extends IASTStatement { public interface IASTDeclarationStatement extends IASTStatement {
/**
* <code>DECLARATION</code> represents the relationship between a declaration statement and the declaration it wraps.
*/
public static final ASTNodeProperty DECLARATION = new ASTNodeProperty( "Declaration"); //$NON-NLS-1$ public static final ASTNodeProperty DECLARATION = new ASTNodeProperty( "Declaration"); //$NON-NLS-1$
/** /**
@ -26,6 +29,11 @@ public interface IASTDeclarationStatement extends IASTStatement {
*/ */
public IASTDeclaration getDeclaration(); public IASTDeclaration getDeclaration();
/**
* Set the declaration for this statement.
*
* @param declaration
*/
public void setDeclaration( IASTDeclaration declaration ); public void setDeclaration( IASTDeclaration declaration );
} }

View file

@ -12,24 +12,47 @@ package org.eclipse.cdt.core.dom.ast;
/** /**
* Base interface for a declarator.
*
* @author Doug Schaefer * @author Doug Schaefer
*/ */
public interface IASTDeclarator extends IASTNode { public interface IASTDeclarator extends IASTNode {
/**
* Constant - empty declarator array
*/
public static final IASTDeclarator[] EMPTY_DECLARATOR_ARRAY = new IASTDeclarator[0]; 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$ * <code>POINTER_OPERATOR</code> represents the relationship between an <code>IASTDeclarator</code> and an <code>IASTPointerOperator</code>.
ASTNodeProperty NESTED_DECLARATOR = new ASTNodeProperty( "Nested Declarator"); //$NON-NLS-1$ */
ASTNodeProperty DECLARATOR_NAME = new ASTNodeProperty( "Declarator Name"); //$NON-NLS-1$ public static final ASTNodeProperty POINTER_OPERATOR = new ASTNodeProperty( "Pointer Operator"); //$NON-NLS-1$
/**
* <code>INITIALIZER</code> represents the relationship between an <code>IASTDeclarator</code> and an <code>IASTInitializer</code>.
*/
public static final ASTNodeProperty INITIALIZER = new ASTNodeProperty( "Initializer"); //$NON-NLS-1$
/**
* <code>NESTED_DECLARATOR</code> represents the relationship between an <code>IASTDeclarator</code> and a nested <code>IASTDeclarator</code>.
*/
public static final ASTNodeProperty NESTED_DECLARATOR = new ASTNodeProperty( "Nested Declarator"); //$NON-NLS-1$
/**
* <code>DECLARATOR_NAME</code> represents the relationship between an <code>IASTDeclarator</code> and an <code>IASTName</code>.
*/
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 * This is the list of pointer operators applied to the type for
* the declarator. * the declarator.
* *
* @return List of IASTPointerOperator * @return array of IASTPointerOperator
*/ */
public IASTPointerOperator[] getPointerOperators(); public IASTPointerOperator[] getPointerOperators();
/**
* Adds a pointer operator to the declarator.
*
* @param operator <code>IASTPointerOperator</code> to be added.
*/
public void addPointerOperator( IASTPointerOperator operator ); 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 * 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(); public IASTName getName();
/**
* Set the name of he declarator.
*
* @param name <code>IASTName</code>
*/
public void setName( IASTName name ); public void setName( IASTName name );
/** /**
@ -59,6 +87,11 @@ public interface IASTDeclarator extends IASTNode {
*/ */
public IASTInitializer getInitializer(); public IASTInitializer getInitializer();
/**
* Set the optional initializer.
*
* @param initializer <code>IASTInitializer</code>
*/
public void setInitializer( IASTInitializer initializer ); public void setInitializer( IASTInitializer initializer );
} }

View file

@ -17,16 +17,26 @@ package org.eclipse.cdt.core.dom.ast;
*/ */
public interface IASTDoStatement extends IASTStatement { public interface IASTDoStatement extends IASTStatement {
/**
* <code>BODY</code> represents the relationship between a <code>IASTDoStatement</code> and its nested body <code>IASTStatement</code>.
*/
public static final ASTNodeProperty BODY = new ASTNodeProperty("body"); //$NON-NLS-1$ public static final ASTNodeProperty BODY = new ASTNodeProperty("body"); //$NON-NLS-1$
/**
* <code>CONDITION</code> represents the relationship between a <code>IASTDoStatement</code> and its condition <code>IASTExpression</code>.
*/
public static final ASTNodeProperty CONDITION = new ASTNodeProperty("condition"); //$NON-NLS-1$ public static final ASTNodeProperty CONDITION = new ASTNodeProperty("condition"); //$NON-NLS-1$
/** /**
* The body of the loop. * Get the body of the loop.
* *
* @return * @return <code>IASTStatement</code> loop code body
*/ */
public IASTStatement getBody(); public IASTStatement getBody();
/**
* Set the body of the loop.
* @param body an <code>IASTStatement</code>
*/
public void setBody(IASTStatement body); public void setBody(IASTStatement body);
/** /**
@ -36,6 +46,10 @@ public interface IASTDoStatement extends IASTStatement {
*/ */
public IASTExpression getCondition(); public IASTExpression getCondition();
/**
* Set the condition for the loop.
* @param condition an IASTExpression
*/
public void setCondition(IASTExpression condition); public void setCondition(IASTExpression condition);
} }