mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Add JavaDoc.
This commit is contained in:
parent
9b1b4fc340
commit
e9c3b52623
7 changed files with 234 additions and 18 deletions
|
@ -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 {
|
||||
|
||||
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
|
||||
*/
|
||||
public int getKey();
|
||||
|
||||
|
||||
/**
|
||||
* <code>k_struct</code> represents 'struct' in C & C++
|
||||
*/
|
||||
public static final int k_struct = 1;
|
||||
/**
|
||||
* <code>k_union</code> represents 'union' in C & C++
|
||||
*/
|
||||
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;
|
||||
|
||||
|
||||
/**
|
||||
* 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();
|
||||
}
|
||||
|
|
|
@ -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$
|
||||
/**
|
||||
* <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.
|
||||
*
|
||||
* @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 <code>IScope</code> node that this node eludes to in the logical tree.
|
||||
*
|
||||
* @return the <code>IScope</code>
|
||||
*/
|
||||
public IScope getScope();
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
||||
/**
|
||||
* <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$
|
||||
/**
|
||||
* <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$
|
||||
/**
|
||||
* <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$
|
||||
|
||||
/**
|
||||
* Get the logical condition expression.
|
||||
*
|
||||
* @return <code>IASTExpression</code> 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 <code>IASTExpression</code>
|
||||
*/
|
||||
public IASTExpression getPositiveResultExpression();
|
||||
/**
|
||||
* Set positive result expression.
|
||||
*
|
||||
* @param expression
|
||||
*/
|
||||
public void setPositiveResultExpression(IASTExpression expression);
|
||||
|
||||
/**
|
||||
* Get the negative result expression.
|
||||
* @return <code>IASTExpression</code>
|
||||
*/
|
||||
public IASTExpression getNegativeResultExpression();
|
||||
|
||||
/**
|
||||
* Set negative result expression.
|
||||
*
|
||||
* @param expression <code>IASTExpression</code>
|
||||
*/
|
||||
public void setNegativeResultExpression(IASTExpression expression);
|
||||
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
/**
|
||||
* <code>sc_unspecified</code> undefined storage class
|
||||
*/
|
||||
public static final int sc_unspecified = 0;
|
||||
/**
|
||||
* <code>sc_typedef</code> typedef
|
||||
*/
|
||||
public static final int sc_typedef = 1;
|
||||
/**
|
||||
* <code>sc_extern</code>extern
|
||||
*/
|
||||
|
||||
public static final int sc_extern = 2;
|
||||
/**
|
||||
* <code>sc_static</code>static
|
||||
*/
|
||||
|
||||
public static final int sc_static = 3;
|
||||
/**
|
||||
* <code>sc_auto</code>auto
|
||||
*/
|
||||
|
||||
public static final int sc_auto = 4;
|
||||
|
||||
/**
|
||||
* <code>sc_register</code>register
|
||||
*/
|
||||
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;
|
||||
|
||||
/**
|
||||
* 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();
|
||||
|
||||
}
|
||||
|
|
|
@ -17,6 +17,9 @@ package org.eclipse.cdt.core.dom.ast;
|
|||
*/
|
||||
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$
|
||||
|
||||
/**
|
||||
|
@ -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 );
|
||||
|
||||
}
|
||||
|
|
|
@ -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$
|
||||
/**
|
||||
* <code>POINTER_OPERATOR</code> represents the relationship between an <code>IASTDeclarator</code> and an <code>IASTPointerOperator</code>.
|
||||
*/
|
||||
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
|
||||
* the declarator.
|
||||
*
|
||||
* @return List of IASTPointerOperator
|
||||
* @return array of IASTPointerOperator
|
||||
*/
|
||||
public IASTPointerOperator[] getPointerOperators();
|
||||
|
||||
/**
|
||||
* Adds a pointer operator to the declarator.
|
||||
*
|
||||
* @param operator <code>IASTPointerOperator</code> 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 <code>IASTName</code>
|
||||
*/
|
||||
public void setName( IASTName name );
|
||||
|
||||
/**
|
||||
|
@ -59,6 +87,11 @@ public interface IASTDeclarator extends IASTNode {
|
|||
*/
|
||||
public IASTInitializer getInitializer();
|
||||
|
||||
/**
|
||||
* Set the optional initializer.
|
||||
*
|
||||
* @param initializer <code>IASTInitializer</code>
|
||||
*/
|
||||
public void setInitializer( IASTInitializer initializer );
|
||||
|
||||
}
|
||||
|
|
|
@ -17,16 +17,26 @@ package org.eclipse.cdt.core.dom.ast;
|
|||
*/
|
||||
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$
|
||||
/**
|
||||
* <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$
|
||||
|
||||
/**
|
||||
* The body of the loop.
|
||||
* Get the body of the loop.
|
||||
*
|
||||
* @return
|
||||
* @return <code>IASTStatement</code> loop code body
|
||||
*/
|
||||
public IASTStatement getBody();
|
||||
|
||||
/**
|
||||
* Set the body of the loop.
|
||||
* @param body an <code>IASTStatement</code>
|
||||
*/
|
||||
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);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue