From a939d75b5d458051f56bd8f2f98c1c724295dcd0 Mon Sep 17 00:00:00 2001 From: John Camelon Date: Sat, 12 Mar 2005 21:11:42 +0000 Subject: [PATCH] Add JavaDoc. Formatted public interfaces. --- .../ast/gnu/c/ICASTKnRFunctionDeclarator.java | 54 ++++++++++++++-- .../gnu/c/IGCCASTArrayRangeDesignator.java | 55 ++++++++++++++-- .../ast/gnu/cpp/IGPPASTBinaryExpression.java | 21 ++++-- .../dom/ast/gnu/cpp/IGPPASTDeclSpecifier.java | 18 +++++- .../IGPPASTExplicitTemplateInstantiation.java | 39 +++++++++-- .../core/dom/ast/gnu/cpp/IGPPASTPointer.java | 20 +++++- .../ast/gnu/cpp/IGPPASTPointerToMember.java | 4 +- .../gnu/cpp/IGPPASTSimpleDeclSpecifier.java | 64 ++++++++++++++++--- .../core/dom/ast/gnu/cpp/IGPPBasicType.java | 6 +- .../ast/gnu/cpp/IGPPPointerToMemberType.java | 2 +- .../core/dom/ast/gnu/cpp/IGPPPointerType.java | 11 ++-- .../dom/ast/gnu/cpp/IGPPQualifierType.java | 11 ++-- 12 files changed, 252 insertions(+), 53 deletions(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/c/ICASTKnRFunctionDeclarator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/c/ICASTKnRFunctionDeclarator.java index 0cabef12370..b03a51cb7d9 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/c/ICASTKnRFunctionDeclarator.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/c/ICASTKnRFunctionDeclarator.java @@ -18,17 +18,61 @@ import org.eclipse.cdt.core.dom.ast.IASTName; /** * This is the declarator for a K&R C Function. - * + * * @author dsteffle */ public interface ICASTKnRFunctionDeclarator extends IASTFunctionDeclarator { - - public static final ASTNodeProperty PARAMETER_NAME = new ASTNodeProperty( "Parameter Name"); //$NON-NLS-1$ + + /** + * PARAMETER_NAME refers to the names qualified in a K&R C + * function definition. + */ + public static final ASTNodeProperty PARAMETER_NAME = new ASTNodeProperty( + "Parameter Name"); //$NON-NLS-1$ + + /** + * Overwrite the parameter names. TODO - this should change to add + * + * @param names + * IASTName [] + */ public void setParameterNames(IASTName[] names); + + /** + * Get parameter names. + * + * @return IASTName [] + */ public IASTName[] getParameterNames(); - - public static final ASTNodeProperty FUNCTION_PARAMETER = new ASTNodeProperty( "Parameter"); //$NON-NLS-1$ + + /** + * FUNCTION_PARAMETER represents the relationship between an + * K&R function declarator and the full parameter declarations. + */ + public static final ASTNodeProperty FUNCTION_PARAMETER = new ASTNodeProperty( + "Parameter"); //$NON-NLS-1$ + + /** + * Overrwrite the parameter lists. + * + * @param decls + * TODO - replace w/zadd + */ public void setParameterDeclarations(IASTDeclaration[] decls); + + /** + * Get parameters declarations. + * + * @return IASTDeclaration [] + */ public IASTDeclaration[] getParameterDeclarations(); + + /** + * Map declarator to IASTName. + * + * @param name + * IASTName + * @return + */ public IASTDeclarator getDeclaratorForParameterName(IASTName name); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/c/IGCCASTArrayRangeDesignator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/c/IGCCASTArrayRangeDesignator.java index 71e8973d04f..764d4105fdc 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/c/IGCCASTArrayRangeDesignator.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/c/IGCCASTArrayRangeDesignator.java @@ -14,15 +14,56 @@ import org.eclipse.cdt.core.dom.ast.IASTExpression; import org.eclipse.cdt.core.dom.ast.c.ICASTDesignator; /** + * GCC-specific designator that allows for shorthand array range to be specified + * in a designated initializer. + * + * struct ABC { int def[10]; } abc = { def[4...10] = 3 }; + * * @author jcamelon */ public interface IGCCASTArrayRangeDesignator extends ICASTDesignator { - public static final ASTNodeProperty SUBSCRIPT_FLOOR_EXPRESSION = new ASTNodeProperty( "Subscript Floor Expression"); //$NON-NLS-1$ - public static final ASTNodeProperty SUBSCRIPT_CEILING_EXPRESSION = new ASTNodeProperty( "Subscript Ceiling Expression"); //$NON-NLS-1$ - - public IASTExpression getRangeFloor(); - public void setRangeFloor( IASTExpression expression ); - public IASTExpression getRangeCeiling(); - public void setRangeCeiling( IASTExpression expression ); + /** + * SUSBCRIPT_FLOOR_EXPRESSION represents the lower value in + * the range of expressions. + */ + public static final ASTNodeProperty SUBSCRIPT_FLOOR_EXPRESSION = new ASTNodeProperty( + "Subscript Floor Expression"); //$NON-NLS-1$ + + /** + * SUSBCRIPT_CEILING_EXPRESSION represents the higher value + * in the range of expressions. + */ + public static final ASTNodeProperty SUBSCRIPT_CEILING_EXPRESSION = new ASTNodeProperty( + "Subscript Ceiling Expression"); //$NON-NLS-1$ + + /** + * Get the floor expression of the range. + * + * @return the floor expression IASTExpression + */ + public IASTExpression getRangeFloor(); + + /** + * Set the floor expression of the range. + * + * @param expression + * IASTExpression + */ + public void setRangeFloor(IASTExpression expression); + + /** + * Get the range ceiling expression. + * + * @return IASTExpression + */ + public IASTExpression getRangeCeiling(); + + /** + * Set the ceiling expression of the range. + * + * @param expression + * IASTExpression + */ + public void setRangeCeiling(IASTExpression expression); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPASTBinaryExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPASTBinaryExpression.java index e5e4dd2a304..0330108ae21 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPASTBinaryExpression.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPASTBinaryExpression.java @@ -12,12 +12,25 @@ package org.eclipse.cdt.core.dom.ast.gnu.cpp; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTBinaryExpression; /** + * G++ introduces additional operators. + * * @author jcamelon */ public interface IGPPASTBinaryExpression extends ICPPASTBinaryExpression { - - public static final int op_max = ICPPASTBinaryExpression.op_last + 1; - public static final int op_min = ICPPASTBinaryExpression.op_last + 2; - public static final int op_last = op_min; + + /** + * op_max represents >? + */ + public static final int op_max = ICPPASTBinaryExpression.op_last + 1; + + /** + * op_min represents op_last provided for sub-interfaces to extend. + */ + public static final int op_last = op_min; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPASTDeclSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPASTDeclSpecifier.java index 4736625ca3f..74b99454cea 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPASTDeclSpecifier.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPASTDeclSpecifier.java @@ -13,13 +13,25 @@ package org.eclipse.cdt.core.dom.ast.gnu.cpp; import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier; /** + * G++ allows for restrict to be a modifier for the decl spec. + * * @author jcamelon */ public interface IGPPASTDeclSpecifier extends IASTDeclSpecifier { - // Extra type qualifier in C + /** + * Was restrict keyword encountered? + * + * @return boolean + */ public boolean isRestrict(); - - public void setRestrict( boolean value ); + + /** + * Set restrict-modifier-encountered to value. + * + * @param value + * boolean + */ + public void setRestrict(boolean value); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPASTExplicitTemplateInstantiation.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPASTExplicitTemplateInstantiation.java index 355339b6843..00faaaa210d 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPASTExplicitTemplateInstantiation.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPASTExplicitTemplateInstantiation.java @@ -13,15 +13,40 @@ package org.eclipse.cdt.core.dom.ast.gnu.cpp; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExplicitTemplateInstantiation; /** + * G++ allows for instantiations to be qualified w/modifiers for scoping. + * * @author jcamelon */ public interface IGPPASTExplicitTemplateInstantiation extends - ICPPASTExplicitTemplateInstantiation { + ICPPASTExplicitTemplateInstantiation { - public static final int ti_static = 1; - public static final int ti_inline = 2; - public static final int ti_extern = 3; - - public int getModifier(); - public void setModifier( int value ); + /** + * ti_static implies 'static' keyword is used. + */ + public static final int ti_static = 1; + + /** + * ti_inline implies 'inline' keyword is used. + */ + public static final int ti_inline = 2; + + /** + * ti_extern implies 'extern' keyword is used. + */ + public static final int ti_extern = 3; + + /** + * Get the modifier. + * + * @return int + */ + public int getModifier(); + + /** + * Set the modifier value. + * + * @param value + * (int) + */ + public void setModifier(int value); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPASTPointer.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPASTPointer.java index 21b67c223f9..3f2829e0550 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPASTPointer.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPASTPointer.java @@ -13,10 +13,24 @@ package org.eclipse.cdt.core.dom.ast.gnu.cpp; import org.eclipse.cdt.core.dom.ast.IASTPointer; /** + * g++ allows for restrict pointers. + * * @author jcamelon */ public interface IGPPASTPointer extends IASTPointer { - - public boolean isRestrict(); - public void setRestrict( boolean value ); + + /** + * Is this pointer a restrict pointer? + * + * @return boolean + */ + public boolean isRestrict(); + + /** + * Set restrict-keyword-encountered to true or false. + * + * @param value + * boolean + */ + public void setRestrict(boolean value); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPASTPointerToMember.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPASTPointerToMember.java index d0f15d97636..4ea2eac4860 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPASTPointerToMember.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPASTPointerToMember.java @@ -13,9 +13,11 @@ package org.eclipse.cdt.core.dom.ast.gnu.cpp; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTPointerToMember; /** + * G++ Pointer 2 Members accept the restrict qualified as well. + * * @author jcamelon */ public interface IGPPASTPointerToMember extends IGPPASTPointer, - ICPPASTPointerToMember { + ICPPASTPointerToMember { } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPASTSimpleDeclSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPASTSimpleDeclSpecifier.java index 61a3e3a383c..3838ea8d1e8 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPASTSimpleDeclSpecifier.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPASTSimpleDeclSpecifier.java @@ -15,24 +15,68 @@ import org.eclipse.cdt.core.dom.ast.IASTExpression; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTSimpleDeclSpecifier; /** + * G++ adds its own modifiers and types to the Simple Decl Specifier. + * * @author jcamelon */ public interface IGPPASTSimpleDeclSpecifier extends IGPPASTDeclSpecifier, - ICPPASTSimpleDeclSpecifier { + ICPPASTSimpleDeclSpecifier { + /** + * t_Complex represents a _Complex type. + */ public static final int t_Complex = ICPPASTSimpleDeclSpecifier.t_last + 1; + + /** + * t_Imaginary represents an _Imaginary type. + */ public static final int t_Imaginary = ICPPASTSimpleDeclSpecifier.t_last + 2; + + /** + * t_typeof represents a typeof() expression type. + */ public static final int t_typeof = ICPPASTSimpleDeclSpecifier.t_last + 3; + + /** + * t_last is for subinterfaces to extend these types. + */ public static final int t_last = t_typeof; - - public static final ASTNodeProperty TYPEOF_EXPRESSION = new ASTNodeProperty( "Typeof Expression"); //$NON-NLS-1$ - + + /** + * TYPEOF_EXPRESSION represents the relationship between the + * decl spec & the expression for typeof(). + */ + public static final ASTNodeProperty TYPEOF_EXPRESSION = new ASTNodeProperty( + "Typeof Expression"); //$NON-NLS-1$ + + /** + * Did we encounter "long long" as a modifier? + * + * @return boolean + */ public boolean isLongLong(); - public void setLongLong( boolean value ); - /** - * @param typeofExpression - */ - public void setTypeofExpression(IASTExpression typeofExpression); - public IASTExpression getTypeofExpression(); + + /** + * Encountered "long long" - set true or false. + * + * @param value + * boolean + */ + public void setLongLong(boolean value); + + /** + * Set the typeof() expression. + * + * @param typeofExpression + * IASTExpression + */ + public void setTypeofExpression(IASTExpression typeofExpression); + + /** + * Get the typeof expression. + * + * @return IASTExpression + */ + public IASTExpression getTypeofExpression(); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPBasicType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPBasicType.java index ef2ff24476d..f6e2dacc5cd 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPBasicType.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPBasicType.java @@ -23,10 +23,12 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPBasicType; public interface IGPPBasicType extends ICPPBasicType { public static final int t_Complex = IGPPASTSimpleDeclSpecifier.t_Complex; + public static final int t_Imaginary = IGPPASTSimpleDeclSpecifier.t_Imaginary; + public static final int t_typeof = IGPPASTSimpleDeclSpecifier.t_typeof; - + public boolean isLongLong() throws DOMException; - + public IType getTypeofType() throws DOMException; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPPointerToMemberType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPPointerToMemberType.java index 8f916d80559..8802143f4db 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPPointerToMemberType.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPPointerToMemberType.java @@ -20,6 +20,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPPointerToMemberType; * @author aniefer */ public interface IGPPPointerToMemberType extends ICPPPointerToMemberType, - IGPPPointerType { + IGPPPointerType { } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPPointerType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPPointerType.java index e49fd771649..4ccfd351b6a 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPPointerType.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPPointerType.java @@ -20,9 +20,10 @@ import org.eclipse.cdt.core.dom.ast.IPointerType; * @author aniefer */ public interface IGPPPointerType extends IPointerType { - /** - * is this a restrict pointer - * @return - */ - boolean isRestrict(); + /** + * is this a restrict pointer + * + * @return + */ + boolean isRestrict(); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPQualifierType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPQualifierType.java index 9893470abcd..d492ddbf9e8 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPQualifierType.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPQualifierType.java @@ -20,9 +20,10 @@ import org.eclipse.cdt.core.dom.ast.IQualifierType; * @author aniefer */ public interface IGPPQualifierType extends IQualifierType { - /** - * is this a restrict type - * @return - */ - public boolean isRestrict(); + /** + * is this a restrict type + * + * @return + */ + public boolean isRestrict(); }