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

Add JavaDoc.

This commit is contained in:
John Camelon 2005-03-09 02:42:54 +00:00
parent 6c62456688
commit a9e1167971
11 changed files with 314 additions and 4 deletions

View file

@ -30,10 +30,20 @@ public class ASTCompletionNode {
private IToken completionToken;
private List names = new ArrayList();
/**
* Only constructor.
*
* @param completionToken - the completion token
*/
public ASTCompletionNode(IToken completionToken) {
this.completionToken = completionToken;
}
/**
* Add a name to node.
*
* @param name
*/
public void addName(IASTName name) {
names.add(name);
}
@ -48,10 +58,21 @@ public class ASTCompletionNode {
return completionToken.getImage();
}
/**
* Get the length of the completion point.
*
* @return length of completion token
*/
public int getLength() {
return completionToken.getLength();
}
/**
* Get a list of names that fit in this context.
*
* @return array of IASTName's
*/
public IASTName[] getNames() {
return (IASTName[])names.toArray(new IASTName[names.size()]);
}

View file

@ -23,7 +23,7 @@ public class ASTNodeProperty {
private String name;
/**
* @param n
* @param n name
*/
public ASTNodeProperty(String n) {
this.name = n;

View file

@ -18,6 +18,10 @@ import org.eclipse.cdt.core.dom.ast.IASTEnumerationSpecifier.IASTEnumerator;
public abstract class ASTVisitor {
/**
* These values should be overriden in the implementation subclass.
*/
public boolean shouldVisitNames = false;
public boolean shouldVisitDeclarations = false;
public boolean shouldVisitInitializers = false;
@ -37,7 +41,11 @@ public abstract class ASTVisitor {
public final static int PROCESS_ABORT = 2;
public final static int PROCESS_CONTINUE = 3;
/**
*
* visit methods
*
*/
public int visit( IASTTranslationUnit tu ) { return PROCESS_CONTINUE; }
public int visit( IASTName name ) { return PROCESS_CONTINUE; }
public int visit( IASTDeclaration declaration ) { return PROCESS_CONTINUE; }

View file

@ -17,11 +17,17 @@ package org.eclipse.cdt.core.dom.ast;
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPSemantics;
/**
* This is the general purpose exception that is thrown for resolving semantic
* aspects of an illegal binding.
*
* @author aniefer
*/
public class DOMException extends Exception {
IProblemBinding problemBinding;
/**
* @param problem binding for throwing
*
*/
public DOMException( IProblemBinding problem ) {
@ -29,6 +35,11 @@ public class DOMException extends Exception {
problemBinding = problem;
}
/**
* Get the problem associated w/this exception.
*
* @return problem
*/
public IProblemBinding getProblem(){
return problemBinding;
}

View file

@ -11,10 +11,20 @@ package org.eclipse.cdt.core.dom.ast;
/**
* ASM Statement as a Declaration.
*
* @author jcamelon
*/
public interface IASTASMDeclaration extends IASTDeclaration {
/**
* Get the assembly value.
* @return
*/
public String getAssembly();
/**
* Set the assembly value.
* @param assembly
*/
public void setAssembly( String assembly );
}

View file

@ -10,8 +10,6 @@
**********************************************************************/
package org.eclipse.cdt.core.dom.ast;
/**
* This is the declarator for an array.
*
@ -19,9 +17,22 @@ package org.eclipse.cdt.core.dom.ast;
*/
public interface IASTArrayDeclarator extends IASTDeclarator {
/**
* Node property that describes the relationship between an <code>IASTArrayDeclarator</code> and an <code>IASTArrayModifier</code>.
*/
public static final ASTNodeProperty ARRAY_MODIFIER = new ASTNodeProperty( "Array Modifier"); //$NON-NLS-1$
/**
* Get all <code>IASTArrayModifier</code>'s for this declarator.
*
* @return array of <code>IASTArrayModifier</code>
*/
public IASTArrayModifier[] getArrayModifiers();
/**
* Add an <code>IASTArrayModifier</code> to this declarator
* @param arrayModifier <code>IASTArrayModifier</code> to be added
*/
public void addArrayModifier( IASTArrayModifier arrayModifier );
}

View file

@ -10,13 +10,32 @@
package org.eclipse.cdt.core.dom.ast;
/**
* This is the portion of the node that represents the portions when someone declares a
* variable/type which is an array.
*
* @author jcamelon
*/
public interface IASTArrayModifier extends IASTNode {
/**
* Node property that describes the relationship between an <code>IASTArrayModifier</code> and an <code>IASTExpression</code>.
*/
public static final ASTNodeProperty CONSTANT_EXPRESSION = new ASTNodeProperty( "Constant Expression"); //$NON-NLS-1$
/**
* <code>EMPTY_ARRAY</code> is referred to in implementations
*/
public static final IASTArrayModifier[] EMPTY_ARRAY = new IASTArrayModifier[0];
/**
* Get the constant expression that represents the size of the array.
*
* @return <code>IASTExpression</code>
*/
public IASTExpression getConstantExpression();
/**
* Set the constant expression that represents the size of the array.
*
* @param expression <code>IASTExpression</code>
*/
public void setConstantExpression( IASTExpression expression );
}

View file

@ -10,15 +10,41 @@
package org.eclipse.cdt.core.dom.ast;
/**
* This interface represents a postfix array subscript expression.
* x[ 10 ]
* y.z()[ t * t ]
*
* @author jcamelon
*/
public interface IASTArraySubscriptExpression extends IASTExpression {
/**
* Node property that describes the relationship between an <code>IASTArraySubscriptExpression</code> and an <code>IASTExpression</code> representing the subscript.
*/
public static final ASTNodeProperty ARRAY = new ASTNodeProperty( "Array"); //$NON-NLS-1$
/**
* Get the expression that represents the array.
* @return <code>IASTExpression</code> that represents the array.
*/
public IASTExpression getArrayExpression();
/**
* Set the expression that represents the array.
* @param expression <code>IASTExpression</code> to be set.
*/
public void setArrayExpression( IASTExpression expression );
/**
* Node property that describes the relationship between an <code>IASTArraySubscriptExpression</code> and an <code>IASTExpression</code> representing the array.
*/
public static final ASTNodeProperty SUBSCRIPT = new ASTNodeProperty( "Subscript"); //$NON-NLS-1$
/**
* Get the subscript expression.
* @return <code>IASTExpression</code> that represents the subscript.
*/
public IASTExpression getSubscriptExpression();
/**
* Set the subscript expression.
* @param expression <code>IASTExpression</code> to be set.
*/
public void setSubscriptExpression( IASTExpression expression );
}

View file

@ -11,48 +11,203 @@
package org.eclipse.cdt.core.dom.ast;
/**
* This interface represents a binary expression.
*
* @author Doug Schaefer
*/
public interface IASTBinaryExpression extends IASTExpression {
/**
* Node property that describes the relationship between an <code>IASTBinaryExpression</code> and an <code>IASTExpression</code> representing the lhs.
*/
public static final ASTNodeProperty OPERAND_ONE = new ASTNodeProperty( "Operand 1"); //$NON-NLS-1$
/**
* Node property that describes the relationship between an <code>IASTBinaryExpression</code> and an <code>IASTExpression</code> representing the rhs.
*/
public static final ASTNodeProperty OPERAND_TWO = new ASTNodeProperty( "Operand 2"); //$NON-NLS-1$
/**
* Set the operator.
* @param op Value to set.
*/
public void setOperator( int op );
/**
* Get the operator.
* @return int value as operator
*/
public int getOperator();
/**
* multiply *
*/
public static final int op_multiply = 1;
/**
* divide /
*/
public static final int op_divide = 2;
/**
* modulo %
*/
public static final int op_modulo = 3;
/**
* plus +
*/
public static final int op_plus = 4;
/**
* minus -
*/
public static final int op_minus = 5;
/**
* shift left <<
*/
public static final int op_shiftLeft = 6;
/**
* shift right >>
*/
public static final int op_shiftRight = 7;
/**
* less than <
*/
public static final int op_lessThan = 8;
/**
* greater than >
*/
public static final int op_greaterThan = 9;
/**
* less than or equals <=
*/
public static final int op_lessEqual = 10;
/**
* greater than or equals >=
*/
public static final int op_greaterEqual = 11;
/**
* binary and &
*/
public static final int op_binaryAnd = 12;
/**
* binary Xor ^
*/
public static final int op_binaryXor = 13;
/**
* binary Or |
*/
public static final int op_binaryOr = 14;
/**
* logical and &&
*/
public static final int op_logicalAnd = 15;
/**
* logical or ||
*/
public static final int op_logicalOr = 16;
/**
* assignment =
*/
public static final int op_assign = 17;
/**
* multiply assignment *=
*/
public static final int op_multiplyAssign = 18;
/**
* divide assignemnt /=
*/
public static final int op_divideAssign = 19;
/**
* modulo assignment %=
*/
public static final int op_moduloAssign = 20;
/**
* plus assignment +=
*/
public static final int op_plusAssign = 21;
/**
* minus assignment -=
*/
public static final int op_minusAssign = 22;
/**
* shift left assignment <<=
*/
public static final int op_shiftLeftAssign = 23;
/**
* shift right assign >>=
*/
public static final int op_shiftRightAssign = 24;
/**
* binary and assign &=
*/
public static final int op_binaryAndAssign = 25;
/**
* binary Xor assign ^=
*/
public static final int op_binaryXorAssign = 26;
/**
* binary Or assign |=
*/
public static final int op_binaryOrAssign = 27;
/**
* equals ==
*/
public static final int op_equals = 28;
/**
* not equals !=
*/
public static final int op_notequals = 29;
/**
* op_last is the field used in subinterfaces to start their operators at
*/
public static final int op_last = op_notequals;
/**
* Get the first operand.
*
* @return <code>IASTExpression</code> representing operand 1.
*/
public IASTExpression getOperand1();
/**
* Set the first operand.
*
* @param expression <code>IASTExpression</code> value.
*/
public void setOperand1( IASTExpression expression );
/**
* Get the second operand.
*
* @return <code>IASTExpression</code> representing operand 2.
*/
public IASTExpression getOperand2();
/**
* @param expression <code>IASTExpression</code> value
*/
public void setOperand2( IASTExpression expression );
}

View file

@ -20,6 +20,9 @@ package org.eclipse.cdt.core.dom.ast;
*/
public interface IASTCaseStatement extends IASTStatement {
/**
* <code>ASTNodeProperty</code> that represents the relationship between a case statement and the expression it contains.
*/
public static final ASTNodeProperty EXPRESSION = new ASTNodeProperty("expression"); //$NON-NLS-1$
/**
@ -29,6 +32,10 @@ public interface IASTCaseStatement extends IASTStatement {
*/
public IASTExpression getExpression();
/**
* Set the expression.
* @param expression
*/
public void setExpression(IASTExpression expression);
}

View file

@ -10,23 +10,65 @@
package org.eclipse.cdt.core.dom.ast;
/**
* This interface represents a cast expression of the form (TypeId)operand.
*
* @author jcamelon
*/
public interface IASTCastExpression extends IASTExpression {
/**
* <code>op_cast</code> represents a traditional cast.
*/
public static final int op_cast = 0;
/**
* <code>op_last</code> for subinterfaces
*/
public static final int op_last = op_cast;
/**
* Get the type of cast (as an operator).
*
* @return operator
*/
public int getOperator();
/**
* Set the operator (type of cast).
*
* @param value
*/
public void setOperator( int value );
/**
* <code>OPERAND</code> represents the relationship between a cast expression and the expression it is casting (operand).
*/
public static final ASTNodeProperty OPERAND = new ASTNodeProperty( "Operand" ); //$NON-NLS-1$
/**
* Get expression being cast.
* @return <code>IASTExpression</code> the expression being cast
*/
public IASTExpression getOperand();
/**
* Set the expression being cast.
* @param expression <code>IASTExpression</code> the expression to be cast
*/
public void setOperand( IASTExpression expression );
/**
* <code>TYPE_ID</code> represents the relationship between a cast expression and the type cast to.
*/
public static final ASTNodeProperty TYPE_ID = new ASTNodeProperty( "Type Id"); //$NON-NLS-1$
/**
* Set the typeId.
* @param typeId <code>IASTTypeId</code> to be set.
*/
public void setTypeId( IASTTypeId typeId );
/**
* Get the typeId.
* @return <code>IASTTypeId</code> representing type being casted to.
*/
public IASTTypeId getTypeId();
}