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

Add JavaDoc.

Formatted public interfaces.
Restructured some public interfaces.
This commit is contained in:
John Camelon 2005-03-11 19:51:49 +00:00
parent 39ca877911
commit 834e06e8fc
87 changed files with 2610 additions and 1704 deletions

View file

@ -124,12 +124,12 @@ public class AST2BaseTest extends TestCase {
if( lang == ParserLanguage.C && expectNoProblems )
{
assertEquals( CVisitor.getProblems(tu).length, 0 );
assertEquals( tu.getPreprocesorProblems().length, 0 );
assertEquals( tu.getPreprocessorProblems().length, 0 );
}
else if ( lang == ParserLanguage.CPP && expectNoProblems )
{
assertEquals( CPPVisitor.getProblems(tu).length, 0 );
assertEquals( tu.getPreprocesorProblems().length, 0 );
assertEquals( tu.getPreprocessorProblems().length, 0 );
}
return tu;

View file

@ -20,27 +20,26 @@ import org.eclipse.cdt.core.parser.CodeReader;
*/
public interface ICodeReaderFactory {
/**
* @return unique identifier as int
*/
public int getUniqueIdentifier();
/**
* @return unique identifier as int
*/
public int getUniqueIdentifier();
/**
* Create CodeReader for translation unit
*
* @param path
* Canonical Path representing path location for file to be
* opened
* @return CodeReader for contents at that path.
*/
public CodeReader createCodeReaderForTranslationUnit(String path);
/**
* Create CodeReader for translation unit
*
* @param path Canonical Path representing path location for file to be opened
* @return CodeReader for contents at that path.
*/
public CodeReader createCodeReaderForTranslationUnit( String path );
/**
* Create CodeReader for inclusion.
*
* @param path
* @return CodeReader for contents at that path.
*/
public CodeReader createCodeReaderForInclusion( String path );
/**
* Create CodeReader for inclusion.
*
* @param path
* @return CodeReader for contents at that path.
*/
public CodeReader createCodeReaderForInclusion(String path);
}

View file

@ -13,22 +13,23 @@ package org.eclipse.cdt.core.dom;
import org.eclipse.cdt.core.parser.IScannerInfo;
/**
* This interface represents a parser configuration as specified by the
* client to the parser service.
* This interface represents a parser configuration as specified by the client
* to the parser service.
*
* @author jcamelon
*/
public interface IParserConfiguration {
/**
* @return IScannerInfo representing the build information required to parse.
*/
public IScannerInfo getScannerInfo();
/**
* @return IScannerInfo representing the build information required to
* parse.
*/
public IScannerInfo getScannerInfo();
//TODO this may change
/**
* @return String representing dialect name for the language
*/
public String getParserDialect();
// TODO this may change
/**
* @return String representing dialect name for the language
*/
public String getParserDialect();
}

View file

@ -13,27 +13,29 @@ import java.util.List;
import org.eclipse.cdt.core.parser.IToken;
/**
* This class represents the node that would occur at the point of
* a context completion.
* This class represents the node that would occur at the point of a context
* completion.
*
* This node may contain the prefix text of an identifer up to the point.
* If there is no prefix, the completion occurred at the point where a
* new token would have begun.
* This node may contain the prefix text of an identifer up to the point. If
* there is no prefix, the completion occurred at the point where a new token
* would have begun.
*
* The node points to the parent node where this node, if replaced by
* a proper node, would reside in the tree.
* The node points to the parent node where this node, if replaced by a proper
* node, would reside in the tree.
*
* @author Doug Schaefer
*/
public class ASTCompletionNode {
private IToken completionToken;
private List names = new ArrayList();
/**
* Only constructor.
*
* @param completionToken - the completion token
* @param completionToken -
* the completion token
*/
public ASTCompletionNode(IToken completionToken) {
this.completionToken = completionToken;
@ -49,8 +51,8 @@ public class ASTCompletionNode {
}
/**
* If the point of completion was at the end of a potential
* identifier, this string contains the text of that identifier.
* If the point of completion was at the end of a potential identifier, this
* string contains the text of that identifier.
*
* @return the prefix text up to the point of completion
*/
@ -67,14 +69,13 @@ public class ASTCompletionNode {
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()]);
return (IASTName[]) names.toArray(new IASTName[names.size()]);
}
}

View file

@ -11,10 +11,10 @@
package org.eclipse.cdt.core.dom.ast;
/**
* This interface represents a structural property in an IASTNode.
* This is used to determine the relationship between a child node and
* it's parent. This is especially important with rewrite since we need
* to understand how to properly replace the child in the source.
* This interface represents a structural property in an IASTNode. This is used
* to determine the relationship between a child node and it's parent. This is
* especially important with rewrite since we need to understand how to properly
* replace the child in the source.
*
* @author Doug Schaefer
*/
@ -22,30 +22,29 @@ public class ASTNodeProperty {
private String name;
/**
* @param n name
*/
public ASTNodeProperty(String n) {
this.name = n;
}
/**
* @param n
* name
*/
public ASTNodeProperty(String n) {
this.name = n;
}
/**
* Each property has a name to help distinguish it from other
* properties of a node.
/**
* Each property has a name to help distinguish it from other properties of
* a node.
*
* @return the name of the property
*/
public String getName()
{
return name;
public String getName() {
return name;
}
/**
* @param name The name to set.
*/
public void setName(String name) {
this.name = name;
}
/**
* @param name
* The name to set.
*/
public void setName(String name) {
this.name = name;
}
}

View file

@ -40,9 +40,13 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPVisitor;
public class ASTUtil {
private static final String COMMA_SPACE = ", "; //$NON-NLS-1$
private static final String EMPTY_STRING = ""; //$NON-NLS-1$
private static final String SPACE = " "; //$NON-NLS-1$
private static final String[] EMPTY_STRING_ARRAY = new String[0];
private static final int DEAULT_ITYPE_SIZE = 2;
public static String getParameterTypeString(IFunctionType type) {
@ -50,10 +54,11 @@ public class ASTUtil {
String[] parms = getParameterTypeStringArray(type);
result.append(Keywords.cpLPAREN);
for(int i=0; i<parms.length; i++) {
for (int i = 0; i < parms.length; i++) {
if (parms[i] != null) {
result.append(parms[i]);
if (i<parms.length-1) result.append(COMMA_SPACE);
if (i < parms.length - 1)
result.append(COMMA_SPACE);
}
}
result.append(Keywords.cpRPAREN);
@ -64,11 +69,13 @@ public class ASTUtil {
IType[] parms = null;
try {
parms = type.getParameterTypes();
} catch (DOMException e) { return EMPTY_STRING_ARRAY; }
} catch (DOMException e) {
return EMPTY_STRING_ARRAY;
}
String[] result = new String[parms.length];
for(int i=0; i<parms.length; i++) {
for (int i = 0; i < parms.length; i++) {
if (parms[i] != null) {
result[i] = getType(parms[i]);
}
@ -85,148 +92,271 @@ public class ASTUtil {
result.append(Keywords.cpLBRACKET);
if (type instanceof ICArrayType) {
try {
if (((ICArrayType)type).isConst()) { result.append(Keywords.CONST); needSpace=true; }
if (((ICArrayType)type).isRestrict()) { if (needSpace) { result.append(SPACE); needSpace=false; } result.append(Keywords.RESTRICT); needSpace=true; }
if (((ICArrayType)type).isStatic()) { if (needSpace) { result.append(SPACE); needSpace=false; } result.append(Keywords.STATIC); needSpace=true; }
if (((ICArrayType)type).isVolatile()) { if (needSpace) { result.append(SPACE); needSpace=false; } result.append(Keywords.VOLATILE); }
} catch (DOMException e) {}
if (((ICArrayType) type).isConst()) {
result.append(Keywords.CONST);
needSpace = true;
}
if (((ICArrayType) type).isRestrict()) {
if (needSpace) {
result.append(SPACE);
needSpace = false;
}
result.append(Keywords.RESTRICT);
needSpace = true;
}
if (((ICArrayType) type).isStatic()) {
if (needSpace) {
result.append(SPACE);
needSpace = false;
}
result.append(Keywords.STATIC);
needSpace = true;
}
if (((ICArrayType) type).isVolatile()) {
if (needSpace) {
result.append(SPACE);
needSpace = false;
}
result.append(Keywords.VOLATILE);
}
} catch (DOMException e) {
}
}
result.append(Keywords.cpRBRACKET);
} else if (type instanceof IBasicType) {
try {
if (((IBasicType)type).isSigned()) { result.append(Keywords.SIGNED); needSpace = true; }
else if (((IBasicType)type).isUnsigned()) { if (needSpace) { result.append(SPACE); needSpace=false; } result.append(Keywords.UNSIGNED); needSpace=true; }
if (((IBasicType)type).isLong()) { if (needSpace) { result.append(SPACE); needSpace=false; } result.append(Keywords.LONG); needSpace = true; }
else if (((IBasicType)type).isShort()) { if (needSpace) { result.append(SPACE); needSpace=false; }result.append(Keywords.SHORT); needSpace = true; }
} catch (DOMException e) {}
if (((IBasicType) type).isSigned()) {
result.append(Keywords.SIGNED);
needSpace = true;
} else if (((IBasicType) type).isUnsigned()) {
if (needSpace) {
result.append(SPACE);
needSpace = false;
}
result.append(Keywords.UNSIGNED);
needSpace = true;
}
if (((IBasicType) type).isLong()) {
if (needSpace) {
result.append(SPACE);
needSpace = false;
}
result.append(Keywords.LONG);
needSpace = true;
} else if (((IBasicType) type).isShort()) {
if (needSpace) {
result.append(SPACE);
needSpace = false;
}
result.append(Keywords.SHORT);
needSpace = true;
}
} catch (DOMException e) {
}
if (type instanceof IGPPBasicType) {
try {
if (((IGPPBasicType)type).isLongLong()) { if (needSpace) { result.append(SPACE); needSpace=false; } result.append(Keywords.LONG_LONG); needSpace=true; }
switch (((IGPPBasicType)type).getType()) {
case IGPPBasicType.t_Complex:
result.append(Keywords.c_COMPLEX);
break;
case IGPPBasicType.t_Imaginary:
result.append(Keywords.c_IMAGINARY);
break;
case IGPPBasicType.t_typeof:
result.append(GCCKeywords.TYPEOF);
break;
if (((IGPPBasicType) type).isLongLong()) {
if (needSpace) {
result.append(SPACE);
needSpace = false;
}
result.append(Keywords.LONG_LONG);
needSpace = true;
}
} catch (DOMException e) {}
switch (((IGPPBasicType) type).getType()) {
case IGPPBasicType.t_Complex:
result.append(Keywords.c_COMPLEX);
break;
case IGPPBasicType.t_Imaginary:
result.append(Keywords.c_IMAGINARY);
break;
case IGPPBasicType.t_typeof:
result.append(GCCKeywords.TYPEOF);
break;
}
} catch (DOMException e) {
}
} else if (type instanceof ICPPBasicType) {
try {
switch (((ICPPBasicType)type).getType()) {
case ICPPBasicType.t_bool:
result.append(Keywords.BOOL);
break;
case ICPPBasicType.t_wchar_t:
result.append(Keywords.WCHAR_T);
break;
switch (((ICPPBasicType) type).getType()) {
case ICPPBasicType.t_bool:
result.append(Keywords.BOOL);
break;
case ICPPBasicType.t_wchar_t:
result.append(Keywords.WCHAR_T);
break;
}
} catch (DOMException e) {}
} catch (DOMException e) {
}
} else if (type instanceof ICBasicType) {
try {
switch (((ICBasicType)type).getType()) {
case ICBasicType.t_Bool:
result.append(Keywords.c_BOOL);
break;
case ICBasicType.t_Complex:
result.append(Keywords.c_COMPLEX);
break;
case ICBasicType.t_Imaginary:
result.append(Keywords.c_IMAGINARY);
break;
switch (((ICBasicType) type).getType()) {
case ICBasicType.t_Bool:
result.append(Keywords.c_BOOL);
break;
case ICBasicType.t_Complex:
result.append(Keywords.c_COMPLEX);
break;
case ICBasicType.t_Imaginary:
result.append(Keywords.c_IMAGINARY);
break;
}
} catch (DOMException e) {}
} catch (DOMException e) {
}
}
try {
switch (((IBasicType)type).getType()) {
case IBasicType.t_char:
result.append(Keywords.CHAR);
break;
case IBasicType.t_double:
result.append(Keywords.DOUBLE);
break;
case IBasicType.t_float:
result.append(Keywords.FLOAT);
break;
case IBasicType.t_int:
result.append(Keywords.INT);
break;
case IBasicType.t_void:
result.append(Keywords.VOID);
break;
switch (((IBasicType) type).getType()) {
case IBasicType.t_char:
result.append(Keywords.CHAR);
break;
case IBasicType.t_double:
result.append(Keywords.DOUBLE);
break;
case IBasicType.t_float:
result.append(Keywords.FLOAT);
break;
case IBasicType.t_int:
result.append(Keywords.INT);
break;
case IBasicType.t_void:
result.append(Keywords.VOID);
break;
}
} catch (DOMException e) {}
} catch (DOMException e) {
}
} else if (type instanceof ICompositeType) {
if (type instanceof ICPPClassType) {
try {
switch(((ICPPClassType)type).getKey()) {
case ICPPClassType.k_class:
result.append(Keywords.CLASS);
break;
switch (((ICPPClassType) type).getKey()) {
case ICPPClassType.k_class:
result.append(Keywords.CLASS);
break;
}
} catch (DOMException e) {}
} catch (DOMException e) {
}
}
try {
switch(((ICompositeType)type).getKey()) {
case ICompositeType.k_struct:
result.append(Keywords.STRUCT);
break;
case ICompositeType.k_union:
result.append(Keywords.UNION);
break;
switch (((ICompositeType) type).getKey()) {
case ICompositeType.k_struct:
result.append(Keywords.STRUCT);
break;
case ICompositeType.k_union:
result.append(Keywords.UNION);
break;
}
} catch (DOMException e) {}
} catch (DOMException e) {
}
} else if (type instanceof ICPPReferenceType) {
result.append(Keywords.cpAMPER);
} else if (type instanceof ICPPTemplateTypeParameter) {
try {
result.append(getType(((ICPPTemplateTypeParameter)type).getDefault()));
} catch (DOMException e) {}
result.append(getType(((ICPPTemplateTypeParameter) type)
.getDefault()));
} catch (DOMException e) {
}
} else if (type instanceof IEnumeration) {
result.append(Keywords.ENUM);
} else if (type instanceof IFunctionType) {
try {
String temp = getType(((IFunctionType)type).getReturnType());
if (temp != null && !temp.equals(EMPTY_STRING)) { result.append(temp); needSpace=true; }
if (needSpace) { result.append(SPACE); needSpace=false; }
temp = getParameterTypeString((IFunctionType)type);
if (temp != null && !temp.equals(EMPTY_STRING)) { result.append(temp); needSpace=false; }
} catch (DOMException e) {}
String temp = getType(((IFunctionType) type).getReturnType());
if (temp != null && !temp.equals(EMPTY_STRING)) {
result.append(temp);
needSpace = true;
}
if (needSpace) {
result.append(SPACE);
needSpace = false;
}
temp = getParameterTypeString((IFunctionType) type);
if (temp != null && !temp.equals(EMPTY_STRING)) {
result.append(temp);
needSpace = false;
}
} catch (DOMException e) {
}
} else if (type instanceof IPointerType) {
result.append(Keywords.cpSTAR); needSpace=true;
result.append(Keywords.cpSTAR);
needSpace = true;
if (type instanceof IGPPPointerType) {
if (((IGPPPointerType)type).isRestrict()) { if (needSpace) { result.append(SPACE); needSpace=false; } result.append(Keywords.RESTRICT); needSpace=true; }
if (((IGPPPointerType) type).isRestrict()) {
if (needSpace) {
result.append(SPACE);
needSpace = false;
}
result.append(Keywords.RESTRICT);
needSpace = true;
}
} else if (type instanceof ICPointerType) {
if (((ICPointerType)type).isRestrict()) { if (needSpace) { result.append(SPACE); needSpace=false; } result.append(Keywords.RESTRICT); needSpace=true; }
if (((ICPointerType) type).isRestrict()) {
if (needSpace) {
result.append(SPACE);
needSpace = false;
}
result.append(Keywords.RESTRICT);
needSpace = true;
}
}
try {
if (((IPointerType)type).isConst()) { if (needSpace) { result.append(SPACE); needSpace=false; } result.append(Keywords.CONST); needSpace=true; }
if (((IPointerType)type).isVolatile()) { if (needSpace) { result.append(SPACE); needSpace=false; } result.append(Keywords.VOLATILE); needSpace=true; }
} catch (DOMException e) {}
if (((IPointerType) type).isConst()) {
if (needSpace) {
result.append(SPACE);
needSpace = false;
}
result.append(Keywords.CONST);
needSpace = true;
}
if (((IPointerType) type).isVolatile()) {
if (needSpace) {
result.append(SPACE);
needSpace = false;
}
result.append(Keywords.VOLATILE);
needSpace = true;
}
} catch (DOMException e) {
}
} else if (type instanceof IQualifierType) {
if (type instanceof ICQualifierType) {
if (((ICQualifierType)type).isRestrict()) { result.append(Keywords.RESTRICT); needSpace=true; }
if (((ICQualifierType) type).isRestrict()) {
result.append(Keywords.RESTRICT);
needSpace = true;
}
} else if (type instanceof IGPPQualifierType) {
if (((IGPPQualifierType)type).isRestrict()) { result.append(Keywords.RESTRICT); needSpace=true; }
if (((IGPPQualifierType) type).isRestrict()) {
result.append(Keywords.RESTRICT);
needSpace = true;
}
}
try {
if (((IQualifierType)type).isConst()) { if (needSpace) { result.append(SPACE); needSpace=false; } result.append(Keywords.CONST); needSpace=true; }
if (((IQualifierType)type).isVolatile()) { if (needSpace) { result.append(SPACE); needSpace=false; } result.append(Keywords.VOLATILE); needSpace=true; }
} catch (DOMException e) {}
if (((IQualifierType) type).isConst()) {
if (needSpace) {
result.append(SPACE);
needSpace = false;
}
result.append(Keywords.CONST);
needSpace = true;
}
if (((IQualifierType) type).isVolatile()) {
if (needSpace) {
result.append(SPACE);
needSpace = false;
}
result.append(Keywords.VOLATILE);
needSpace = true;
}
} catch (DOMException e) {
}
}
@ -238,24 +368,27 @@ public class ASTUtil {
IType[] types = new IType[DEAULT_ITYPE_SIZE];
// push all of the types onto the stack
while(type != null && type instanceof ITypeContainer) {
types = (IType[]) ArrayUtil.append( IType.class, types, type );
while (type != null && type instanceof ITypeContainer) {
types = (IType[]) ArrayUtil.append(IType.class, types, type);
try {
type = ((ITypeContainer)type).getType();
} catch (DOMException e) {}
type = ((ITypeContainer) type).getType();
} catch (DOMException e) {
}
}
if (type != null && !(type instanceof ITypeContainer)) {
types = (IType[]) ArrayUtil.append( IType.class, types, type );
types = (IType[]) ArrayUtil.append(IType.class, types, type);
}
// pop all of the types off of the stack, and build the string representation while doing so
for(int j=types.length-1; j>=0; j--) {
// pop all of the types off of the stack, and build the string
// representation while doing so
for (int j = types.length - 1; j >= 0; j--) {
if (types[j] != null)
result.append(getTypeString(types[j]));
if (types[j] != null && j>0) result.append(SPACE);
if (types[j] != null && j > 0)
result.append(SPACE);
}
return result.toString();
@ -263,7 +396,7 @@ public class ASTUtil {
public static String getDeclaratorType(IASTDeclarator decltor) {
// get the most nested declarator
while(decltor.getNestedDeclarator() != null)
while (decltor.getNestedDeclarator() != null)
decltor = decltor.getNestedDeclarator();
IBinding binding = decltor.getName().resolveBinding();
@ -271,17 +404,17 @@ public class ASTUtil {
try {
if (binding instanceof CExternalFunction) {
type = ((CExternalFunction)binding).getType();
type = ((CExternalFunction) binding).getType();
} else if (binding instanceof CExternalVariable) {
type = ((CExternalVariable)binding).getType();
type = ((CExternalVariable) binding).getType();
} else if (binding instanceof IEnumerator) {
type = ((IEnumerator)binding).getType();
type = ((IEnumerator) binding).getType();
} else if (binding instanceof IFunction) {
type = ((IFunction)binding).getType();
type = ((IFunction) binding).getType();
} else if (binding instanceof ITypedef) {
type = ((ITypedef)binding).getType();
type = ((ITypedef) binding).getType();
} else if (binding instanceof IVariable) {
type = ((IVariable)binding).getType();
type = ((IVariable) binding).getType();
}
} catch (DOMException e) {
return EMPTY_STRING;
@ -295,8 +428,8 @@ public class ASTUtil {
}
/**
* Return's the String representation of a node's type (if available). This is
* currently only being used for testing.
* Return's the String representation of a node's type (if available). This
* is currently only being used for testing.
*
* TODO Remove this function when done testing if it is no longer needed
*
@ -306,16 +439,23 @@ public class ASTUtil {
public static String getNodeType(IASTNode node) {
try {
if (node instanceof IASTDeclarator)
return getDeclaratorType((IASTDeclarator)node);
if (node instanceof IASTName && ((IASTName)node).resolveBinding() instanceof IVariable)
return getType(((IVariable)((IASTName)node).resolveBinding()).getType());
if (node instanceof IASTName && ((IASTName)node).resolveBinding() instanceof IFunction)
return getType(((IFunction)((IASTName)node).resolveBinding()).getType());
if (node instanceof IASTName && ((IASTName)node).resolveBinding() instanceof IType)
return getType((IType)((IASTName)node).resolveBinding());
return getDeclaratorType((IASTDeclarator) node);
if (node instanceof IASTName
&& ((IASTName) node).resolveBinding() instanceof IVariable)
return getType(((IVariable) ((IASTName) node).resolveBinding())
.getType());
if (node instanceof IASTName
&& ((IASTName) node).resolveBinding() instanceof IFunction)
return getType(((IFunction) ((IASTName) node).resolveBinding())
.getType());
if (node instanceof IASTName
&& ((IASTName) node).resolveBinding() instanceof IType)
return getType((IType) ((IASTName) node).resolveBinding());
if (node instanceof IASTTypeId)
return getType((IASTTypeId)node);
} catch (DOMException e) { return EMPTY_STRING; }
return getType((IASTTypeId) node);
} catch (DOMException e) {
return EMPTY_STRING;
}
return EMPTY_STRING;
}

View file

@ -16,45 +16,89 @@ package org.eclipse.cdt.core.dom.ast;
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;
public boolean shouldVisitNames = false;
public boolean shouldVisitDeclarations = false;
public boolean shouldVisitInitializers = false;
public boolean shouldVisitParameterDeclarations = false;
public boolean shouldVisitDeclarators = false;
public boolean shouldVisitDeclarators = false;
public boolean shouldVisitDeclSpecifiers = false;
public boolean shouldVisitExpressions = false;
public boolean shouldVisitStatements = false;
public boolean shouldVisitTypeIds = false;
public boolean shouldVisitEnumerators = false;
public boolean shouldVisitExpressions = false;
public boolean shouldVisitStatements = false;
public boolean shouldVisitTypeIds = false;
public boolean shouldVisitEnumerators = false;
public boolean shouldVisitTranslationUnit = false;
/**
* @return continue to continue visiting, abort to stop, skip to not descend into this node.
* @return continue to continue visiting, abort to stop, skip to not descend
* into this node.
*/
public final static int PROCESS_SKIP = 1;
public final static int PROCESS_ABORT = 2;
public final static int PROCESS_SKIP = 1;
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; }
public int visit( IASTInitializer initializer ) { return PROCESS_CONTINUE; }
public int visit( IASTParameterDeclaration parameterDeclaration ) { return PROCESS_CONTINUE; }
public int visit( IASTDeclarator declarator ) { return PROCESS_CONTINUE; }
public int visit( IASTDeclSpecifier declSpec ) {return PROCESS_CONTINUE; }
public int visit( IASTExpression expression ) { return PROCESS_CONTINUE; }
public int visit( IASTStatement statement ) { return PROCESS_CONTINUE; }
public int visit( IASTTypeId typeId ) { return PROCESS_CONTINUE; }
public int visit( IASTEnumerator enumerator ) { return PROCESS_CONTINUE; }
/**
*
* 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;
}
public int visit(IASTInitializer initializer) {
return PROCESS_CONTINUE;
}
public int visit(IASTParameterDeclaration parameterDeclaration) {
return PROCESS_CONTINUE;
}
public int visit(IASTDeclarator declarator) {
return PROCESS_CONTINUE;
}
public int visit(IASTDeclSpecifier declSpec) {
return PROCESS_CONTINUE;
}
public int visit(IASTExpression expression) {
return PROCESS_CONTINUE;
}
public int visit(IASTStatement statement) {
return PROCESS_CONTINUE;
}
public int visit(IASTTypeId typeId) {
return PROCESS_CONTINUE;
}
public int visit(IASTEnumerator enumerator) {
return PROCESS_CONTINUE;
}
}

View file

@ -23,28 +23,24 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPSemantics;
* @author aniefer
*/
public class DOMException extends Exception {
IProblemBinding problemBinding;
IProblemBinding problemBinding;
/**
* @param problem
* binding for throwing
*
*/
public DOMException(IProblemBinding problem) {
super(CPPSemantics.EMPTY_NAME);
problemBinding = problem;
}
/**
* @param problem binding for throwing
*
*/
public DOMException( IProblemBinding problem ) {
super( CPPSemantics.EMPTY_NAME );
problemBinding = problem;
}
/**
* Get the problem associated w/this exception.
*
* @return problem
*/
public IProblemBinding getProblem(){
return problemBinding;
}
public String getMessage() {
return problemBinding.getMessage();
}
/**
* Get the problem associated w/this exception.
*
* @return problem
*/
public IProblemBinding getProblem() {
return problemBinding;
}
}

View file

@ -9,7 +9,6 @@
* IBM Rational Software - Initial API and implementation */
package org.eclipse.cdt.core.dom.ast;
/**
* ASM Statement as a Declaration.
*
@ -17,14 +16,17 @@ package org.eclipse.cdt.core.dom.ast;
*/
public interface IASTASMDeclaration extends IASTDeclaration {
/**
* Get the assembly value.
* @return
*/
public String getAssembly();
/**
* Set the assembly value.
* @param assembly
*/
public void setAssembly( String assembly );
/**
* Get the assembly value.
*
* @return
*/
public String getAssembly();
/**
* Set the assembly value.
*
* @param assembly
*/
public void setAssembly(String assembly);
}

View file

@ -17,10 +17,12 @@ 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$
/**
* 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.
@ -31,8 +33,10 @@ public interface IASTArrayDeclarator extends IASTDeclarator {
/**
* Add an <code>IASTArrayModifier</code> to this declarator
* @param arrayModifier <code>IASTArrayModifier</code> to be added
*
* @param arrayModifier
* <code>IASTArrayModifier</code> to be added
*/
public void addArrayModifier( IASTArrayModifier arrayModifier );
public void addArrayModifier(IASTArrayModifier arrayModifier);
}

View file

@ -10,32 +10,38 @@
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.
* 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 );
/**
* 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,41 +10,56 @@
package org.eclipse.cdt.core.dom.ast;
/**
* This interface represents a postfix array subscript expression.
* x[ 10 ]
* 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 );
/**
* 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

@ -17,31 +17,42 @@ package org.eclipse.cdt.core.dom.ast;
*/
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$
/**
* 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);
/**
* 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 /
*/
@ -193,21 +204,26 @@ public interface IASTBinaryExpression extends IASTExpression {
* @return <code>IASTExpression</code> representing operand 1.
*/
public IASTExpression getOperand1();
/**
* Set the first operand.
*
* @param expression <code>IASTExpression</code> value.
* @param expression
* <code>IASTExpression</code> value.
*/
public void setOperand1( IASTExpression expression );
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
* @param expression
* <code>IASTExpression</code> value
*/
public void setOperand2( IASTExpression expression );
public void setOperand2(IASTExpression expression);
}

View file

@ -11,29 +11,32 @@
package org.eclipse.cdt.core.dom.ast;
/**
* This is a case in a switch statement. Note that in the grammar,
* a statement is part of the clause. For the AST, just go on to the
* next statement to find it. It's really only there to ensure that there
* is at least one statement following this clause.
* This is a case in a switch statement. Note that in the grammar, a statement
* is part of the clause. For the AST, just go on to the next statement to find
* it. It's really only there to ensure that there is at least one statement
* following this clause.
*
* @author Doug Schaefer
*/
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$
/**
* <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$
/**
* The expression that determines whether this case should be
* taken.
* The expression that determines whether this case should be taken.
*
* @return
*/
public IASTExpression getExpression();
/**
* Set the expression.
*
* @param expression
*/
public void setExpression(IASTExpression expression);

View file

@ -19,56 +19,67 @@ public interface IASTCastExpression extends IASTExpression {
/**
* <code>op_cast</code> represents a traditional cast.
*/
public static final int op_cast = 0;
public static final int op_cast = 0;
/**
* <code>op_last</code> for subinterfaces
*/
public static final int op_last = op_cast;
public static final int op_last = op_cast;
/**
* Get the type of cast (as an operator).
*
* @return operator
*/
public int getOperator();
public int getOperator();
/**
* Set the operator (type of cast).
*
* @param value
*/
public void setOperator( int value );
public void setOperator(int value);
/**
* <code>OPERAND</code> represents the relationship between a cast expression and the expression it is casting (operand).
* <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$
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();
public IASTExpression getOperand();
/**
* Set the expression being cast.
* @param expression <code>IASTExpression</code> the expression to be cast
*
* @param expression
* <code>IASTExpression</code> the expression to be cast
*/
public void setOperand( IASTExpression expression );
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$
/**
* <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();
/**
* 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();
}

View file

@ -10,23 +10,27 @@
**********************************************************************/
package org.eclipse.cdt.core.dom.ast;
/**
* A composite type specifier represents a ocmposite structure (contains declarations).
* A composite type specifier represents a ocmposite structure (contains
* declarations).
*
* @author Doug Schaefer
*/
public interface IASTCompositeTypeSpecifier extends IASTDeclSpecifier {
/**
* <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>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$
* <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.
@ -35,31 +39,32 @@ public interface IASTCompositeTypeSpecifier extends IASTDeclSpecifier {
*/
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
* <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 );
public void setKey(int key);
/**
* Return the name for this composite type. If this is an anonymous
* type, this will return an empty name.
* Return the name for this composite type. If this is an anonymous type,
* this will return an empty name.
*
* @return the name of the type
*/
@ -70,7 +75,7 @@ public interface IASTCompositeTypeSpecifier extends IASTDeclSpecifier {
*
* @param name
*/
public void setName( IASTName name );
public void setName(IASTName name);
/**
* Returns a list of member declarations.
@ -84,7 +89,7 @@ public interface IASTCompositeTypeSpecifier extends IASTDeclSpecifier {
*
* @param declaration
*/
public void addMemberDeclaration( IASTDeclaration declaration );
public void addMemberDeclaration(IASTDeclaration declaration);
/**
* Get the scope that this interface eludes to in the logical tree.

View file

@ -10,7 +10,6 @@
**********************************************************************/
package org.eclipse.cdt.core.dom.ast;
/**
* This represents a block of statements.
*
@ -19,11 +18,14 @@ package org.eclipse.cdt.core.dom.ast;
public interface IASTCompoundStatement extends IASTStatement {
/**
* <code>NESTED_STATEMENT</code> represents the relationship between an <code>IASTCompoundStatement</code> and its nested <code>IASTStatement</code>
* <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$
public static final ASTNodeProperty NESTED_STATEMENT = new ASTNodeProperty(
"Nested Statement"); //$NON-NLS-1$
/**
/**
* Gets the statements in this block.
*
* @return Array of IASTStatement
@ -33,12 +35,14 @@ public interface IASTCompoundStatement extends IASTStatement {
/**
* Add a statement to the compound block.
*
* @param statement statement to be added
* @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.
* Get <code>IScope</code> node that this node eludes to in the logical
* tree.
*
* @return the <code>IScope</code>
*/

View file

@ -16,57 +16,73 @@ package org.eclipse.cdt.core.dom.ast;
*/
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$
/**
* <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$
/**
* Get the logical condition expression.
*
* @return <code>IASTExpression</code> representing the logical condition.
*/
/**
* <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 IASTExpression getLogicalConditionExpression();
/**
* Set the logical condition expression.
*
* @param expression condition to be set
*/
public void setLogicalConditionExpression( IASTExpression expression );
/**
* <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 positive result expression.
*
* @return <code>IASTExpression</code>
*/
public IASTExpression getPositiveResultExpression();
/**
* Set positive result expression.
*
* @param expression
*/
public void setPositiveResultExpression(IASTExpression expression);
/**
* Get the logical condition expression.
*
* @return <code>IASTExpression</code> representing the logical condition.
*/
/**
* Get the negative result expression.
* @return <code>IASTExpression</code>
*/
public IASTExpression getNegativeResultExpression();
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);
*
* @param expression
* <code>IASTExpression</code>
*/
public void setNegativeResultExpression(IASTExpression expression);
}

View file

@ -21,20 +21,24 @@ public interface IASTDeclSpecifier extends IASTNode {
* <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
*/
@ -53,11 +57,15 @@ public interface IASTDeclSpecifier extends IASTNode {
/**
* Set the storage class.
* @param storageClass int
*
* @param storageClass
* int
*/
public void setStorageClass( int storageClass );
public void setStorageClass(int storageClass);
/**
* Get the storage class.
*
* @return int
*/
public int getStorageClass();
@ -65,40 +73,54 @@ public interface IASTDeclSpecifier extends IASTNode {
// Type qualifier
/**
* Is const modifier used?
*
* @return boolean
*/
public boolean isConst();
/**
* Set const modifier used.
* @param value boolean
*
* @param value
* boolean
*/
public void setConst( boolean value );
public void setConst(boolean value);
/**
* Is volatile modifier used?
*
* @return boolean
*/
public boolean isVolatile();
/**
* Set volatile modifier used.
* @param value boolean
*
* @param value
* boolean
*/
public void setVolatile( boolean value );
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.
* 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();

View file

@ -16,6 +16,6 @@ package org.eclipse.cdt.core.dom.ast;
* @author Doug Schaefer
*/
public interface IASTDeclaration extends IASTNode {
public static final IASTDeclaration [] EMPTY_DECLARATION_ARRAY = new IASTDeclaration[0];
public static final IASTDeclaration[] EMPTY_DECLARATION_ARRAY = new IASTDeclaration[0];
}

View file

@ -18,11 +18,13 @@ 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.
* <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$
/**
/**
* Gets the declaration introduced by this statement.
*
* @return the declaration
@ -34,6 +36,6 @@ public interface IASTDeclarationStatement extends IASTStatement {
*
* @param declaration
*/
public void setDeclaration( IASTDeclaration declaration );
public void setDeclaration(IASTDeclaration declaration);
}

View file

@ -10,7 +10,6 @@
**********************************************************************/
package org.eclipse.cdt.core.dom.ast;
/**
* Base interface for a declarator.
*
@ -18,31 +17,42 @@ package org.eclipse.cdt.core.dom.ast;
*/
public interface IASTDeclarator extends IASTNode {
/**
* Constant - empty declarator array
*/
public static final IASTDeclarator[] EMPTY_DECLARATOR_ARRAY = new IASTDeclarator[0];
/**
* Constant - empty declarator array
*/
public static final IASTDeclarator[] EMPTY_DECLARATOR_ARRAY = new IASTDeclarator[0];
/**
* <code>POINTER_OPERATOR</code> represents the relationship between an <code>IASTDeclarator</code> and an <code>IASTPointerOperator</code>.
* <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$
public static final ASTNodeProperty POINTER_OPERATOR = new ASTNodeProperty(
"Pointer Operator"); //$NON-NLS-1$
/**
* This is the list of pointer operators applied to the type for
* the declarator.
/**
* <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 array of IASTPointerOperator
*/
@ -51,19 +61,20 @@ public interface IASTDeclarator extends IASTNode {
/**
* Adds a pointer operator to the declarator.
*
* @param operator <code>IASTPointerOperator</code> to be added.
* @param operator
* <code>IASTPointerOperator</code> to be added.
*/
public void addPointerOperator( IASTPointerOperator operator );
public void addPointerOperator(IASTPointerOperator operator);
/**
* If the declarator is nested in parenthesis, this returns the
* declarator as found in those parenethesis.
* If the declarator is nested in parenthesis, this returns the declarator
* as found in those parenethesis.
*
* @return the nested declarator or null
*/
public IASTDeclarator getNestedDeclarator();
public void setNestedDeclarator( IASTDeclarator nested );
public void setNestedDeclarator(IASTDeclarator nested);
/**
* This returns the name of the declarator. If this is an abstract
@ -76,9 +87,10 @@ public interface IASTDeclarator extends IASTNode {
/**
* Set the name of he declarator.
*
* @param name <code>IASTName</code>
* @param name
* <code>IASTName</code>
*/
public void setName( IASTName name );
public void setName(IASTName name);
/**
* This is the optional initializer for this declarator.
@ -90,8 +102,9 @@ public interface IASTDeclarator extends IASTNode {
/**
* Set the optional initializer.
*
* @param initializer <code>IASTInitializer</code>
* @param initializer
* <code>IASTInitializer</code>
*/
public void setInitializer( IASTInitializer initializer );
public void setInitializer(IASTInitializer initializer);
}

View file

@ -12,9 +12,9 @@ package org.eclipse.cdt.core.dom.ast;
/**
* This is the default clause in the switch statement. Note that in the grammar,
* a statement is part of the clause. For the AST, just go on to the
* next statement to find it. It's really only there to ensure that there
* is at least one statement following this clause.
* a statement is part of the clause. For the AST, just go on to the next
* statement to find it. It's really only there to ensure that there is at least
* one statement following this clause.
*
* @author Doug Schaefer
*/

View file

@ -17,14 +17,20 @@ 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$
/**
* <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$
/**
* Get the body of the loop.
@ -35,7 +41,9 @@ public interface IASTDoStatement extends IASTStatement {
/**
* Set the body of the loop.
* @param body an <code>IASTStatement</code>
*
* @param body
* an <code>IASTStatement</code>
*/
public void setBody(IASTStatement body);
@ -48,7 +56,9 @@ public interface IASTDoStatement extends IASTStatement {
/**
* Set the condition for the loop.
* @param condition an IASTExpression
*
* @param condition
* an IASTExpression
*/
public void setCondition(IASTExpression condition);

View file

@ -16,51 +16,61 @@ package org.eclipse.cdt.core.dom.ast;
*/
public interface IASTElaboratedTypeSpecifier extends IASTDeclSpecifier {
/**
* Enumeration.
*/
public static final int k_enum = 0;
/**
* Structure.
*/
public static final int k_struct = 1;
/**
* Union.
*/
public static final int k_union = 2;
/**
* Constant for extensibility in sub-interfaces.
*/
public static final int k_last = k_union;
public static final int k_enum = 0;
/**
* Get the kind.
*
* @return int (kind).
*/
public int getKind();
/**
* Set the kind.
* @param value int (kind)
*/
public void setKind( int value );
/**
* Structure.
*/
public static final int k_struct = 1;
/**
* <code>TYPE_NAME</code> describes the relationship between <code>IASTElaboratedTypeSpecifier</code> and <code>IASTName</code>.
*/
public static final ASTNodeProperty TYPE_NAME = new ASTNodeProperty( "Type Name"); //$NON-NLS-1$
/**
* Get the name.
*
* @return <code>IASTName</code>
*/
public IASTName getName();
/**
* Set the name.
*
* @param name <code>IASTName</code>
*/
public void setName( IASTName name );
/**
* Union.
*/
public static final int k_union = 2;
/**
* Constant for extensibility in sub-interfaces.
*/
public static final int k_last = k_union;
/**
* Get the kind.
*
* @return int (kind).
*/
public int getKind();
/**
* Set the kind.
*
* @param value
* int (kind)
*/
public void setKind(int value);
/**
* <code>TYPE_NAME</code> describes the relationship between
* <code>IASTElaboratedTypeSpecifier</code> and <code>IASTName</code>.
*/
public static final ASTNodeProperty TYPE_NAME = new ASTNodeProperty(
"Type Name"); //$NON-NLS-1$
/**
* Get the name.
*
* @return <code>IASTName</code>
*/
public IASTName getName();
/**
* Set the name.
*
* @param name
* <code>IASTName</code>
*/
public void setName(IASTName name);
}

View file

@ -9,7 +9,6 @@
* IBM Rational Software - Initial API and implementation */
package org.eclipse.cdt.core.dom.ast;
/**
* This interface represents enumerations in C and C++.
*
@ -17,84 +16,103 @@ package org.eclipse.cdt.core.dom.ast;
*/
public interface IASTEnumerationSpecifier extends IASTDeclSpecifier {
/**
* This interface represents an enumerator member of an enum specifier.
* @author jcamelon
*/
public interface IASTEnumerator extends IASTNode {
/**
* Empty array (constant).
*/
public static final IASTEnumerator[] EMPTY_ENUMERATOR_ARRAY = new IASTEnumerator[0];
/**
* This interface represents an enumerator member of an enum specifier.
*
* @author jcamelon
*/
public interface IASTEnumerator extends IASTNode {
/**
* Empty array (constant).
*/
public static final IASTEnumerator[] EMPTY_ENUMERATOR_ARRAY = new IASTEnumerator[0];
/**
* <code>ENUMERATOR_NAME</code> describes the relationship between <code>IASTEnumerator</code> and <code>IASTName</code>.
*/
public static final ASTNodeProperty ENUMERATOR_NAME = new ASTNodeProperty( "Enumerator Name"); //$NON-NLS-1$
/**
* Set the enumerator's name.
*
* @param name
*/
public void setName( IASTName name );
/**
* Get the enumerator's name.
*
* @return <code>IASTName</code>
*/
public IASTName getName();
/**
* <code>ENUMERATOR_NAME</code> describes the relationship between
* <code>IASTEnumerator</code> and <code>IASTName</code>.
*/
public static final ASTNodeProperty ENUMERATOR_NAME = new ASTNodeProperty(
"Enumerator Name"); //$NON-NLS-1$
/**
* <code>ENUMERATOR_VALUE</code> describes the relationship between <code>IASTEnumerator</code> and <code>IASTExpression</code>.
*/
public static final ASTNodeProperty ENUMERATOR_VALUE = new ASTNodeProperty( "Enumerator Value"); //$NON-NLS-1$
/**
* Set enumerator value.
*
* @param expression
*/
public void setValue( IASTExpression expression );
/**
* Get enumerator value.
*
* @return <code>IASTExpression</code> value
*/
public IASTExpression getValue();
/**
* Set the enumerator's name.
*
* @param name
*/
public void setName(IASTName name);
}
/**
* Get the enumerator's name.
*
* @return <code>IASTName</code>
*/
public IASTName getName();
/**
* <code>ENUMERATOR_VALUE</code> describes the relationship between
* <code>IASTEnumerator</code> and <code>IASTExpression</code>.
*/
public static final ASTNodeProperty ENUMERATOR_VALUE = new ASTNodeProperty(
"Enumerator Value"); //$NON-NLS-1$
/**
* <code>ENUMERATOR</code> describes the relationship between <code>IASTEnumerationSpecifier</code> and the nested <code>IASTEnumerator</code>s.
*/
public static final ASTNodeProperty ENUMERATOR = new ASTNodeProperty( "Enumerator" ); //$NON-NLS-1$
/**
* Add an enumerator.
*
* @param enumerator <code>IASTEnumerator</code>
*/
public void addEnumerator( IASTEnumerator enumerator );
/**
* Get enumerators.
* @return <code>IASTEnumerator []</code> array
*/
public IASTEnumerator[] getEnumerators();
/**
* Set enumerator value.
*
* @param expression
*/
public void setValue(IASTExpression expression);
/**
* <code>ENUMERATION_NAME</code> describes the relationship between <code>IASTEnumerationSpecifier</code> and its <code>IASTName</code>.
*/
public static final ASTNodeProperty ENUMERATION_NAME = new ASTNodeProperty( "Enum Name"); //$NON-NLS-1$
/**
* Set the enum's name.
*
* @param name
*/
public void setName( IASTName name );
/**
* Get the enum's name.
*
* @return
*/
public IASTName getName();
/**
* Get enumerator value.
*
* @return <code>IASTExpression</code> value
*/
public IASTExpression getValue();
}
/**
* <code>ENUMERATOR</code> describes the relationship between
* <code>IASTEnumerationSpecifier</code> and the nested
* <code>IASTEnumerator</code>s.
*/
public static final ASTNodeProperty ENUMERATOR = new ASTNodeProperty(
"Enumerator"); //$NON-NLS-1$
/**
* Add an enumerator.
*
* @param enumerator
* <code>IASTEnumerator</code>
*/
public void addEnumerator(IASTEnumerator enumerator);
/**
* Get enumerators.
*
* @return <code>IASTEnumerator []</code> array
*/
public IASTEnumerator[] getEnumerators();
/**
* <code>ENUMERATION_NAME</code> describes the relationship between
* <code>IASTEnumerationSpecifier</code> and its <code>IASTName</code>.
*/
public static final ASTNodeProperty ENUMERATION_NAME = new ASTNodeProperty(
"Enum Name"); //$NON-NLS-1$
/**
* Set the enum's name.
*
* @param name
*/
public void setName(IASTName name);
/**
* Get the enum's name.
*
* @return
*/
public IASTName getName();
}

View file

@ -16,8 +16,8 @@ package org.eclipse.cdt.core.dom.ast;
* @author Doug Schaefer
*/
public interface IASTExpression extends IASTNode {
/**
* Empty expression array.
*/
public static final IASTExpression [] EMPTY_EXPRESSION_ARRAY = new IASTExpression[0];
/**
* Empty expression array.
*/
public static final IASTExpression[] EMPTY_EXPRESSION_ARRAY = new IASTExpression[0];
}

View file

@ -9,7 +9,6 @@
* IBM Rational Software - Initial API and implementation */
package org.eclipse.cdt.core.dom.ast;
/**
* Expression List (Comma separated list of expressions).
*
@ -17,22 +16,26 @@ package org.eclipse.cdt.core.dom.ast;
*/
public interface IASTExpressionList extends IASTExpression {
/**
* <code>NESTED_EXPRESSION</code> describes the relationship between <code>IASTExpressionList</code> and the nested <code>IASTExpression</code>s.
*/
public static final ASTNodeProperty NESTED_EXPRESSION = new ASTNodeProperty( "Nested Expression"); //$NON-NLS-1$
/**
* <code>NESTED_EXPRESSION</code> describes the relationship between
* <code>IASTExpressionList</code> and the nested
* <code>IASTExpression</code>s.
*/
public static final ASTNodeProperty NESTED_EXPRESSION = new ASTNodeProperty(
"Nested Expression"); //$NON-NLS-1$
/**
* Get nested expressions.
*
* @return <code>IASTExpression [] </code> nested expressions
*/
public IASTExpression [] getExpressions();
/**
* Get nested expressions.
*
* @return <code>IASTExpression [] </code> nested expressions
*/
public IASTExpression[] getExpressions();
/**
* Add nested expression.
*
* @param expression <code>IASTExpression</code> value to be added.
*/
public void addExpression( IASTExpression expression );
/**
* Add nested expression.
*
* @param expression
* <code>IASTExpression</code> value to be added.
*/
public void addExpression(IASTExpression expression);
}

View file

@ -10,7 +10,6 @@
**********************************************************************/
package org.eclipse.cdt.core.dom.ast;
/**
* Expression statement.
*
@ -18,10 +17,13 @@ package org.eclipse.cdt.core.dom.ast;
*/
public interface IASTExpressionStatement extends IASTStatement {
/**
* <code>EXPRESSION</code> is the relationship between an <code>IASTExpressionStatement</code> and an <code>IASTExpression</code>.
*/
public static final ASTNodeProperty EXPFRESSION = new ASTNodeProperty( "Expression"); //$NON-NLS-1$
/**
* <code>EXPRESSION</code> is the relationship between an
* <code>IASTExpressionStatement</code> and an <code>IASTExpression</code>.
*/
public static final ASTNodeProperty EXPFRESSION = new ASTNodeProperty(
"Expression"); //$NON-NLS-1$
/**
* Get the expression in this statement.
*
@ -34,5 +36,5 @@ public interface IASTExpressionStatement extends IASTStatement {
*
* @param expression
*/
public void setExpression( IASTExpression expression );
public void setExpression(IASTExpression expression);
}

View file

@ -18,14 +18,16 @@ package org.eclipse.cdt.core.dom.ast;
*/
public interface IASTFieldDeclarator extends IASTDeclarator {
/**
* <code>FIELD_SIZE</code> represents the relationship between a <code>IASTFieldDeclarator</code> and its <code>IASTExpression</code>.
*/
public static final ASTNodeProperty FIELD_SIZE = new ASTNodeProperty( "BitField Size"); //$NON-NLS-1$
/**
* <code>FIELD_SIZE</code> represents the relationship between a
* <code>IASTFieldDeclarator</code> and its <code>IASTExpression</code>.
*/
public static final ASTNodeProperty FIELD_SIZE = new ASTNodeProperty(
"BitField Size"); //$NON-NLS-1$
/**
* This returns the number of bits if this is a bit field.
* If it is not a bit field, it returns null.
* This returns the number of bits if this is a bit field. If it is not a
* bit field, it returns null.
*
* @return size of bit field or null.
*/
@ -33,8 +35,10 @@ public interface IASTFieldDeclarator extends IASTDeclarator {
/**
* Set the bitfield size.
* @param size <code>IASTExpression</code>
*
* @param size
* <code>IASTExpression</code>
*/
public void setBitFieldSize( IASTExpression size );
public void setBitFieldSize(IASTExpression size);
}

View file

@ -11,22 +11,29 @@
package org.eclipse.cdt.core.dom.ast;
/**
* This interface represents expressions that access a field reference.
* e.g. a.b => a is the expression, b is the field name.
* e.g. a()->def => a() is the expression, def is the field name.
* This interface represents expressions that access a field reference. e.g. a.b =>
* a is the expression, b is the field name. e.g. a()->def => a() is the
* expression, def is the field name.
*
* @author Doug Schaefer
*/
public interface IASTFieldReference extends IASTExpression {
/**
* <code>FIELD_OWNER</code> represents the relationship between a <code>IASTFieldReference</code> and its <code>IASTExpression</code> field owner.
*/
public static final ASTNodeProperty FIELD_OWNER = new ASTNodeProperty( "Field Owner"); //$NON-NLS-1$
/**
* <code>FIELD_NAME</code> represents the relationship between a <code>IASTFieldReference</code> and its <code>IASTName</code> field name.
*/
public static final ASTNodeProperty FIELD_NAME = new ASTNodeProperty( "Field Name"); //$NON-NLS-1$
/**
* <code>FIELD_OWNER</code> represents the relationship between a
* <code>IASTFieldReference</code> and its <code>IASTExpression</code>
* field owner.
*/
public static final ASTNodeProperty FIELD_OWNER = new ASTNodeProperty(
"Field Owner"); //$NON-NLS-1$
/**
* <code>FIELD_NAME</code> represents the relationship between a
* <code>IASTFieldReference</code> and its <code>IASTName</code> field
* name.
*/
public static final ASTNodeProperty FIELD_NAME = new ASTNodeProperty(
"Field Name"); //$NON-NLS-1$
/**
* This returns an expression for the object containing the field.
@ -40,7 +47,7 @@ public interface IASTFieldReference extends IASTExpression {
*
* @param expression
*/
public void setFieldOwner( IASTExpression expression );
public void setFieldOwner(IASTExpression expression);
/**
* This returns the name of the field being dereferenced.
@ -52,13 +59,13 @@ public interface IASTFieldReference extends IASTExpression {
/**
* Set the name of the field.
*
* @param name <code>IASTName</code>
* @param name
* <code>IASTName</code>
*/
public void setFieldName( IASTName name );
public void setFieldName(IASTName name);
/**
* This returns true of this is the arrow operator and not the
* dot operator.
* This returns true of this is the arrow operator and not the dot operator.
*
* @return is this a pointer dereference
*/
@ -66,8 +73,10 @@ public interface IASTFieldReference extends IASTExpression {
/**
* Set whether or not this is a pointer dereference (default == no).
* @param value boolean
*
* @param value
* boolean
*/
public void setIsPointerDereference( boolean value );
public void setIsPointerDereference(boolean value);
}

View file

@ -11,38 +11,55 @@
package org.eclipse.cdt.core.dom.ast;
/**
* The for statement. The initialization clause can be an expression or
* a declaration but not both.
* The for statement. The initialization clause can be an expression or a
* declaration but not both.
*
* @author Doug Schaefer
*/
public interface IASTForStatement extends IASTStatement {
/**
* <code>INITEXPRESSION</code> represents the relationship between a <code>IASTForStatement</code> and its <code>IASTExpression</code> initializer.
*/
public static final ASTNodeProperty INITEXPRESSION = new ASTNodeProperty("initExpression"); //$NON-NLS-1$
/**
* <code>INITDECLARATION</code> represents the relationship between a <code>IASTForStatement</code> and its <code>IASTDeclaration</code> initializer.
*/
public static final ASTNodeProperty INITDECLARATION = new ASTNodeProperty("initDeclaration"); //$NON-NLS-1$
/**
* <code>CONDITION</code> represents the relationship between a <code>IASTForStatement</code> and its <code>IASTExpression</code> condition.
*/
public static final ASTNodeProperty CONDITION = new ASTNodeProperty("condition"); //$NON-NLS-1$
/**
* <code>ITERATION</code> represents the relationship between a <code>IASTForStatement</code> and its <code>IASTExpression</code> iteration expression.
*/
public static final ASTNodeProperty ITERATION = new ASTNodeProperty("iteration"); //$NON-NLS-1$
/**
* <code>BODY</code> represents the relationship between a <code>IASTForStatement</code> and its <code>IASTStatement</code> body.
*/
public static final ASTNodeProperty BODY = new ASTNodeProperty("body"); //$NON-NLS-1$
/**
* <code>INITEXPRESSION</code> represents the relationship between a
* <code>IASTForStatement</code> and its <code>IASTExpression</code>
* initializer.
*/
public static final ASTNodeProperty INITEXPRESSION = new ASTNodeProperty(
"initExpression"); //$NON-NLS-1$
/**
* Get the initial expression for the loop. Returns null if there is
* none. You can not have both an initial expression and an initial
* declaration.
* <code>INITDECLARATION</code> represents the relationship between a
* <code>IASTForStatement</code> and its <code>IASTDeclaration</code>
* initializer.
*/
public static final ASTNodeProperty INITDECLARATION = new ASTNodeProperty(
"initDeclaration"); //$NON-NLS-1$
/**
* <code>CONDITION</code> represents the relationship between a
* <code>IASTForStatement</code> and its <code>IASTExpression</code>
* condition.
*/
public static final ASTNodeProperty CONDITION = new ASTNodeProperty(
"condition"); //$NON-NLS-1$
/**
* <code>ITERATION</code> represents the relationship between a
* <code>IASTForStatement</code> and its <code>IASTExpression</code>
* iteration expression.
*/
public static final ASTNodeProperty ITERATION = new ASTNodeProperty(
"iteration"); //$NON-NLS-1$
/**
* <code>BODY</code> represents the relationship between a
* <code>IASTForStatement</code> and its <code>IASTStatement</code>
* body.
*/
public static final ASTNodeProperty BODY = new ASTNodeProperty("body"); //$NON-NLS-1$
/**
* Get the initial expression for the loop. Returns null if there is none.
* You can not have both an initial expression and an initial declaration.
*
* @return <code>IASTExpression</code>
*/
@ -51,22 +68,24 @@ public interface IASTForStatement extends IASTStatement {
/**
* Set the initial expression for the loop.
*
* @param expression <code>IASTExpression</code>
* @param expression
* <code>IASTExpression</code>
*/
public void setInit(IASTExpression expression);
/**
* Get the initial declaration for the loop. Returns null if there is
* none. You can not have both an initial declaration and an initial
* declaration.
* Get the initial declaration for the loop. Returns null if there is none.
* You can not have both an initial declaration and an initial declaration.
*
* @return <code>IASTDeclaration</code>
*/
public IASTDeclaration getInitDeclaration();
/**
* Set the intiial declaration for the loop.
*
* @param declaration <code>IASTDeclaration</code>
* @param declaration
* <code>IASTDeclaration</code>
*/
public void setInit(IASTDeclaration declaration);
@ -80,7 +99,8 @@ public interface IASTForStatement extends IASTStatement {
/**
* Set the condition expression for the loop.
*
* @param condition <code>IASTExpression</code>
* @param condition
* <code>IASTExpression</code>
*/
public void setCondition(IASTExpression condition);
@ -93,9 +113,11 @@ public interface IASTForStatement extends IASTStatement {
public IASTExpression getIterationExpression();
/**
* Set the expression that is evaluated after the completion of an iteration of the loop.
* Set the expression that is evaluated after the completion of an iteration
* of the loop.
*
* @param iterator <code>IASTExpression</code>
* @param iterator
* <code>IASTExpression</code>
*/
public void setIterationExpression(IASTExpression iterator);
@ -105,15 +127,18 @@ public interface IASTForStatement extends IASTStatement {
* @return <code>IASTStatement</code>
*/
public IASTStatement getBody();
/**
* Set the body of the for loop.
*
* @param statement <code>IASTStatement</code>
* @param statement
* <code>IASTStatement</code>
*/
public void setBody( IASTStatement statement );
public void setBody(IASTStatement statement);
/**
* Get the <code>IScope</code> represented by this for loop.
*
* @return <code>IScope</code>
*/
public IScope getScope();

View file

@ -10,42 +10,57 @@
package org.eclipse.cdt.core.dom.ast;
/**
* This interface represents a function call expression.
* f( x ) : f is the function name expression, x is the parameter expression.
* This interface represents a function call expression. f( x ) : f is the
* function name expression, x is the parameter expression.
*
* @author jcamelon
*/
public interface IASTFunctionCallExpression extends IASTExpression {
public interface IASTFunctionCallExpression extends IASTExpression {
/**
* <code>FUNCTION_NAME</code> represents the relationship between a
* <code>IASTFunctionCallExpression</code> and its
* <code>IASTExpression</code> (function name).
*/
public static final ASTNodeProperty FUNCTION_NAME = new ASTNodeProperty(
"Function Name"); //$NON-NLS-1$
/**
* <code>FUNCTION_NAME</code> represents the relationship between a <code>IASTFunctionCallExpression</code> and its <code>IASTExpression</code> (function name).
*/
public static final ASTNodeProperty FUNCTION_NAME = new ASTNodeProperty( "Function Name"); //$NON-NLS-1$
/**
* Set the function name expression.
* @param expression <code>IASTExpression</code> representing the function name
*/
public void setFunctionNameExpression( IASTExpression expression );
/**
* Get the function name expression.
* @return <code>IASTExpression</code> representing the function name
*/
public IASTExpression getFunctionNameExpression();
/**
* Set the function name expression.
*
* @param expression
* <code>IASTExpression</code> representing the function name
*/
public void setFunctionNameExpression(IASTExpression expression);
/**
* <code>PARAMETERS</code> represents the relationship between a <code>IASTFunctionCallExpression</code> and its <code>IASTExpression</code> (parameters).
*/
public static final ASTNodeProperty PARAMETERS = new ASTNodeProperty( "Parameters"); //$NON-NLS-1$
/**
* Set the parameters expression.
* @param expression <code>IASTExpression</code> representing the parameters
*/
public void setParameterExpression( IASTExpression expression );
/**
* Get the parameter expression.
* @return <code>IASTExpression</code> representing the parameters
*/
public IASTExpression getParameterExpression();
/**
* Get the function name expression.
*
* @return <code>IASTExpression</code> representing the function name
*/
public IASTExpression getFunctionNameExpression();
/**
* <code>PARAMETERS</code> represents the relationship between a
* <code>IASTFunctionCallExpression</code> and its
* <code>IASTExpression</code> (parameters).
*/
public static final ASTNodeProperty PARAMETERS = new ASTNodeProperty(
"Parameters"); //$NON-NLS-1$
/**
* Set the parameters expression.
*
* @param expression
* <code>IASTExpression</code> representing the parameters
*/
public void setParameterExpression(IASTExpression expression);
/**
* Get the parameter expression.
*
* @return <code>IASTExpression</code> representing the parameters
*/
public IASTExpression getParameterExpression();
}

View file

@ -10,7 +10,6 @@
**********************************************************************/
package org.eclipse.cdt.core.dom.ast;
/**
* This is a declarator for a function.
*

View file

@ -18,19 +18,29 @@ package org.eclipse.cdt.core.dom.ast;
public interface IASTFunctionDefinition extends IASTDeclaration {
/**
* <code>DECL_SPECIFIER</code> represents the relationship between a <code>IASTFunctionDefinition</code> and its <code>IASTDeclSpecifier</code>.
* <code>DECL_SPECIFIER</code> represents the relationship between a
* <code>IASTFunctionDefinition</code> and its
* <code>IASTDeclSpecifier</code>.
*/
public static final ASTNodeProperty DECL_SPECIFIER = new ASTNodeProperty( "Decl Specifier"); //$NON-NLS-1$
/**
* <code>DECLARATOR</code> represents the relationship between a <code>IASTFunctionDefinition</code> and its <code>IASTFunctionDeclarator</code>.
*/
public static final ASTNodeProperty DECLARATOR = new ASTNodeProperty( "Declarator"); //$NON-NLS-1$
/**
* <code>FUNCTION_BODY</code> represents the relationship between a <code>IASTFunctionDefinition</code> and its <code>IASTStatement</code>.
*/
public static final ASTNodeProperty FUNCTION_BODY = new ASTNodeProperty( "Function Body"); //$NON-NLS-1$
public static final ASTNodeProperty DECL_SPECIFIER = new ASTNodeProperty(
"Decl Specifier"); //$NON-NLS-1$
/**
/**
* <code>DECLARATOR</code> represents the relationship between a
* <code>IASTFunctionDefinition</code> and its
* <code>IASTFunctionDeclarator</code>.
*/
public static final ASTNodeProperty DECLARATOR = new ASTNodeProperty(
"Declarator"); //$NON-NLS-1$
/**
* <code>FUNCTION_BODY</code> represents the relationship between a
* <code>IASTFunctionDefinition</code> and its <code>IASTStatement</code>.
*/
public static final ASTNodeProperty FUNCTION_BODY = new ASTNodeProperty(
"Function Body"); //$NON-NLS-1$
/**
* Get the decl specifier for the function.
*
* @return
@ -42,7 +52,7 @@ public interface IASTFunctionDefinition extends IASTDeclaration {
*
* @param declSpec
*/
public void setDeclSpecifier( IASTDeclSpecifier declSpec );
public void setDeclSpecifier(IASTDeclSpecifier declSpec);
/**
* Get the declarator for the function.
@ -56,11 +66,11 @@ public interface IASTFunctionDefinition extends IASTDeclaration {
*
* @param declarator
*/
public void setDeclarator( IASTFunctionDeclarator declarator );
public void setDeclarator(IASTFunctionDeclarator declarator);
/**
* Get the body of the function. This is usually a compound statement
* but C++ also has a function try block.
* Get the body of the function. This is usually a compound statement but
* C++ also has a function try block.
*
* @return
*/
@ -68,12 +78,14 @@ public interface IASTFunctionDefinition extends IASTDeclaration {
/**
* Set the body of the function.
*
* @param statement
*/
public void setBody( IASTStatement statement );
public void setBody(IASTStatement statement);
/**
* Get the logical IScope that the function definition body represents.
*
* @return <code>IScope</code> representing function body.
*/
public IScope getScope();

View file

@ -11,15 +11,16 @@
package org.eclipse.cdt.core.dom.ast;
/**
* This interface represents the name of a function style macro parameter.
* This is not an IASTName, as there are not any bindings for
* This interface represents the name of a function style macro parameter. This
* is not an IASTName, as there are not any bindings for
*
* @author jcamelon
*/
public interface IASTFunctionStyleMacroParameter extends IASTNode {
/**
* Constant <code>EMPTY_PARAMETER_ARRAY</code> is used to return anempty array.
* Constant <code>EMPTY_PARAMETER_ARRAY</code> is used to return anempty
* array.
*/
public static final IASTFunctionStyleMacroParameter[] EMPTY_PARAMETER_ARRAY = new IASTFunctionStyleMacroParameter[0];
@ -33,7 +34,8 @@ public interface IASTFunctionStyleMacroParameter extends IASTNode {
/**
* Set the parameter name.
*
* @param value String
* @param value
* String
*/
public void setParameter(String value);

View file

@ -17,7 +17,7 @@ package org.eclipse.cdt.core.dom.ast;
*/
public interface IASTGotoStatement extends IASTStatement {
public static final ASTNodeProperty NAME = new ASTNodeProperty("name"); //$NON-NLS-1$
public static final ASTNodeProperty NAME = new ASTNodeProperty("name"); //$NON-NLS-1$
/**
* Returns the name of the label. The name resolves to a ILabel binding.
@ -29,7 +29,8 @@ public interface IASTGotoStatement extends IASTStatement {
/**
* Set the name for a goto statement label.
*
* @param name <code>IASTName</code>
* @param name
* <code>IASTName</code>
*/
public void setName(IASTName name);

View file

@ -17,10 +17,13 @@ package org.eclipse.cdt.core.dom.ast;
*/
public interface IASTIdExpression extends IASTExpression {
/**
* <code>ID_NAME</code> represents the relationship between an <code>IASTIdExpression</code> and a <code>IASTName</code>.
*/
public static final ASTNodeProperty ID_NAME = new ASTNodeProperty( "IdExpression Name"); //$NON-NLS-1$
/**
* <code>ID_NAME</code> represents the relationship between an
* <code>IASTIdExpression</code> and a <code>IASTName</code>.
*/
public static final ASTNodeProperty ID_NAME = new ASTNodeProperty(
"IdExpression Name"); //$NON-NLS-1$
/**
* Returns the name used in the expression.
*
@ -33,5 +36,5 @@ public interface IASTIdExpression extends IASTExpression {
*
* @param name
*/
public void setName( IASTName name );
public void setName(IASTName name);
}

View file

@ -17,18 +17,26 @@ package org.eclipse.cdt.core.dom.ast;
*/
public interface IASTIfStatement extends IASTStatement {
/**
* <code>CONDITION</code> represents the relationship between an <code>IASTIfStatement</code> and its nested <code>IASTExpression</code>.
*/
public static final ASTNodeProperty CONDITION = new ASTNodeProperty("condition"); //$NON-NLS-1$
/**
* <code>THEN</code> represents the relationship between an <code>IASTIfStatement</code> and its nested <code>IASTStatement</code> (then).
*/
public static final ASTNodeProperty THEN = new ASTNodeProperty("then"); //$NON-NLS-1$
/**
* <code>ELSE</code> represents the relationship between an <code>IASTIfStatement</code> and its nested <code>IASTStatement</code> (else).
*/
public static final ASTNodeProperty ELSE = new ASTNodeProperty("else"); //$NON-NLS-1$
/**
* <code>CONDITION</code> represents the relationship between an
* <code>IASTIfStatement</code> and its nested <code>IASTExpression</code>.
*/
public static final ASTNodeProperty CONDITION = new ASTNodeProperty(
"condition"); //$NON-NLS-1$
/**
* <code>THEN</code> represents the relationship between an
* <code>IASTIfStatement</code> and its nested <code>IASTStatement</code>
* (then).
*/
public static final ASTNodeProperty THEN = new ASTNodeProperty("then"); //$NON-NLS-1$
/**
* <code>ELSE</code> represents the relationship between an
* <code>IASTIfStatement</code> and its nested <code>IASTStatement</code>
* (else).
*/
public static final ASTNodeProperty ELSE = new ASTNodeProperty("else"); //$NON-NLS-1$
/**
* Get the condition in the if statement.
@ -39,7 +47,9 @@ public interface IASTIfStatement extends IASTStatement {
/**
* Set the condition in the if statement.
* @param condition <code>IASTExpression</code>
*
* @param condition
* <code>IASTExpression</code>
*/
public void setCondition(IASTExpression condition);
@ -53,13 +63,14 @@ public interface IASTIfStatement extends IASTStatement {
/**
* Set the statement that is executed if the condition is true.
*
* @param thenClause <code>IASTStatement</code>
* @param thenClause
* <code>IASTStatement</code>
*/
public void setThenClause(IASTStatement thenClause);
/**
* Get the statement that is executed if the condition is false. This
* clause is optional and returns null if there is none.
* Get the statement that is executed if the condition is false. This clause
* is optional and returns null if there is none.
*
* @return the else clause or null <code>IASTStatement</code>
*/
@ -68,7 +79,8 @@ public interface IASTIfStatement extends IASTStatement {
/**
* Set the else clause.
*
* @param elseClause <code>IASTStatement</code>
* @param elseClause
* <code>IASTStatement</code>
*/
public void setElseClause(IASTStatement elseClause);

View file

@ -20,6 +20,6 @@ public interface IASTInitializer extends IASTNode {
/**
* Constant.
*/
public final static IASTInitializer[] EMPTY_INITIALIZER_ARRAY = new IASTInitializer[0];
public final static IASTInitializer[] EMPTY_INITIALIZER_ARRAY = new IASTInitializer[0];
}

View file

@ -17,10 +17,13 @@ package org.eclipse.cdt.core.dom.ast;
*/
public interface IASTInitializerExpression extends IASTInitializer {
/**
* <code>INITIALIZER_EXPRESSION</code> represents the relationship between an <code>IASTInitializerExpression</code>. and its <code></code>IASTExpression</code>.
*/
public static final ASTNodeProperty INITIALIZER_EXPRESSION = new ASTNodeProperty( "Initializer Expression"); //$NON-NLS-1$
/**
* <code>INITIALIZER_EXPRESSION</code> represents the relationship between
* an <code>IASTInitializerExpression</code>. and its <code></code>IASTExpression</code>.
*/
public static final ASTNodeProperty INITIALIZER_EXPRESSION = new ASTNodeProperty(
"Initializer Expression"); //$NON-NLS-1$
/**
* Get the expression for the initializer.
*
@ -31,7 +34,8 @@ public interface IASTInitializerExpression extends IASTInitializer {
/**
* Set the initializer's expression.
*
* @param expression <code>IASTExpression</code>
* @param expression
* <code>IASTExpression</code>
*/
public void setExpression( IASTExpression expression );
public void setExpression(IASTExpression expression);
}

View file

@ -10,7 +10,6 @@
**********************************************************************/
package org.eclipse.cdt.core.dom.ast;
/**
* This is an an initializer that is a list of initializers.
*
@ -18,10 +17,12 @@ package org.eclipse.cdt.core.dom.ast;
*/
public interface IASTInitializerList extends IASTInitializer {
/**
* <code>NESTED_INITIALIZER</code> describes the relationship between an <code>IASTInitializerList</code> and its sub-<code>IASTInitializer</code>s.
*/
public static final ASTNodeProperty NESTED_INITIALIZER = new ASTNodeProperty( "Nested Initializer" ); //$NON-NLS-1$
/**
* <code>NESTED_INITIALIZER</code> describes the relationship between an
* <code>IASTInitializerList</code> and its sub-<code>IASTInitializer</code>s.
*/
public static final ASTNodeProperty NESTED_INITIALIZER = new ASTNodeProperty(
"Nested Initializer"); //$NON-NLS-1$
/**
* Get the list of initializers.
@ -33,7 +34,8 @@ public interface IASTInitializerList extends IASTInitializer {
/**
* Add an initializer to the initializer list.
*
* @param initializer <code>IASTInitializer</code>
* @param initializer
* <code>IASTInitializer</code>
*/
public void addInitializer( IASTInitializer initializer );
public void addInitializer(IASTInitializer initializer);
}

View file

@ -17,7 +17,7 @@ package org.eclipse.cdt.core.dom.ast;
*/
public interface IASTLabelStatement extends IASTStatement {
public static final ASTNodeProperty NAME = new ASTNodeProperty("name"); //$NON-NLS-1$
public static final ASTNodeProperty NAME = new ASTNodeProperty("name"); //$NON-NLS-1$
/**
* The name for the label. The name resolves to an ILabel binding.

View file

@ -17,45 +17,51 @@ package org.eclipse.cdt.core.dom.ast;
*/
public interface IASTLiteralExpression extends IASTExpression {
/**
* An integer literal e.g. 5
*/
public static final int lk_integer_constant = 0;
/**
* A floating point literal e.g. 6.0
*/
public static final int lk_float_constant = 1;
/**
* A char literal e.g. 'abc'
*/
public static final int lk_char_constant = 2;
/**
* A string literal e.g. "abcdefg"
*/
public static final int lk_string_literal = 3;
/**
* A constant defined for subclasses to extend from.
*/
public static final int lk_last = lk_string_literal;
/**
* An integer literal e.g. 5
*/
public static final int lk_integer_constant = 0;
/**
* Get the literal expression kind.
*
* @return int
*/
public int getKind();
/**
* Set the literal expression kind.
*
* @param value int
*/
public void setKind( int value );
/**
* A floating point literal e.g. 6.0
*/
public static final int lk_float_constant = 1;
/**
* Set the value of the literal expression.
*
* @param value
*/
public void setValue( String value );
/**
* A char literal e.g. 'abc'
*/
public static final int lk_char_constant = 2;
/**
* A string literal e.g. "abcdefg"
*/
public static final int lk_string_literal = 3;
/**
* A constant defined for subclasses to extend from.
*/
public static final int lk_last = lk_string_literal;
/**
* Get the literal expression kind.
*
* @return int
*/
public int getKind();
/**
* Set the literal expression kind.
*
* @param value
* int
*/
public void setKind(int value);
/**
* Set the value of the literal expression.
*
* @param value
*/
public void setValue(String value);
}

View file

@ -11,9 +11,9 @@
package org.eclipse.cdt.core.dom.ast;
/**
* A Macro expansion is a node location.
* Nodes that have locations that arrive through the expansion of preprocessor macros
* will refer to these type of objects.
* A Macro expansion is a node location. Nodes that have locations that arrive
* through the expansion of preprocessor macros will refer to these type of
* objects.
*
* @author Doug Schaefer
*/

View file

@ -11,8 +11,8 @@
package org.eclipse.cdt.core.dom.ast;
/**
* This class represents a name in the program that represents a semantic
* object in the program.
* This class represents a name in the program that represents a semantic object
* in the program.
*
* The toString method produces a string representation of the name as
* appropriate for the language.
@ -34,8 +34,8 @@ public interface IASTName extends IASTNode {
public IBinding resolveBinding();
/**
* Return a list of bindings in the scope of the name that have the
* name as a prefix.
* Return a list of bindings in the scope of the name that have the name as
* a prefix.
*
* @return <code>IBinding []</code> bindings that start with this name
*/

View file

@ -11,21 +11,23 @@
package org.eclipse.cdt.core.dom.ast;
/**
* Represents the use of a typedef name in an decl specifier in C.
* Also used for class/struct/union names in C.
* Represents the use of a typedef name in an decl specifier in C. Also used for
* class/struct/union names in C.
*
* @author Doug Schaefer
*/
public interface IASTNamedTypeSpecifier extends IASTDeclSpecifier {
/**
* <code>NAME</code> describes the relationship between an <code>IASTNamedTypeSpecifier</code> and its nested <code>IASTName</code>.
* <code>NAME</code> describes the relationship between an
* <code>IASTNamedTypeSpecifier</code> and its nested
* <code>IASTName</code>.
*/
public static final ASTNodeProperty NAME = new ASTNodeProperty( "Name"); //$NON-NLS-1$
public static final ASTNodeProperty NAME = new ASTNodeProperty("Name"); //$NON-NLS-1$
/**
* Get the name.
*
/**
* Get the name.
*
* @return the typedef name.
*/
public IASTName getName();
@ -35,6 +37,6 @@ public interface IASTNamedTypeSpecifier extends IASTDeclSpecifier {
*
* @param name
*/
public void setName( IASTName name );
public void setName(IASTName name);
}

View file

@ -54,7 +54,8 @@ public interface IASTNode {
/**
* Set the parent node of this node in the tree.
*
* @param node <code>IASTNode</code>
* @param node
* <code>IASTNode</code>
*/
public void setParent(IASTNode node);
@ -74,8 +75,8 @@ public interface IASTNode {
public void setPropertyInParent(ASTNodeProperty property);
/**
* Abstract method to be overriden by all subclasses.
* Necessary for visitation of the tree using an <code>ASTVisitor</code>.
* Abstract method to be overriden by all subclasses. Necessary for
* visitation of the tree using an <code>ASTVisitor</code>.
*
* @param visitor
* @return continue on (true) or quit( false )

View file

@ -11,17 +11,16 @@
package org.eclipse.cdt.core.dom.ast;
/**
* A NodeLocation represents the source location of a given node. Most
* often this is a file it may be other fancy things like macro
* expansions.
* A NodeLocation represents the source location of a given node. Most often
* this is a file it may be other fancy things like macro expansions.
*
* @author Doug Schaefer
*/
public interface IASTNodeLocation {
/**
* This is the offset into the actual source location that this node
* starts at.
* This is the offset into the actual source location that this node starts
* at.
*
* @return
*/

View file

@ -9,10 +9,8 @@
* IBM Rational Software - Initial API and implementation */
package org.eclipse.cdt.core.dom.ast;
/**
* This node represents a null statement.
* ';'
* This node represents a null statement. ';'
*
* @author jcamelon
*/

View file

@ -16,26 +16,33 @@ package org.eclipse.cdt.core.dom.ast;
* @author Doug Schaefer
*/
public interface IASTParameterDeclaration extends IASTNode {
/**
* Constant/sentinel.
*/
public static final IASTParameterDeclaration [] EMPTY_PARAMETERDECLARATION_ARRAY = new IASTParameterDeclaration[0];
/**
* Constant/sentinel.
*/
public static final IASTParameterDeclaration[] EMPTY_PARAMETERDECLARATION_ARRAY = new IASTParameterDeclaration[0];
/**
* <code>DECL_SPECIFIER</code> represents the relationship between an <code>IASTParameterDeclaration</code> and its nested <code>IASTDeclSpecifier</code>.
* <code>DECL_SPECIFIER</code> represents the relationship between an
* <code>IASTParameterDeclaration</code> and its nested
* <code>IASTDeclSpecifier</code>.
*/
public static final ASTNodeProperty DECL_SPECIFIER = new ASTNodeProperty( "Decl Specifier"); //$NON-NLS-1$
/**
* <code>DECLARATOR</code> represents the relationship between an <code>IASTParameterDeclaration</code> and its nested <code>IASTDeclarator</code>.
*/
public static final ASTNodeProperty DECLARATOR = new ASTNodeProperty( "Declarator"); //$NON-NLS-1$
public static final ASTNodeProperty DECL_SPECIFIER = new ASTNodeProperty(
"Decl Specifier"); //$NON-NLS-1$
/**
* Get the decl specifier.
*
* @return <code>IASTDeclSpecifier</code>
*/
public IASTDeclSpecifier getDeclSpecifier();
/**
* <code>DECLARATOR</code> represents the relationship between an
* <code>IASTParameterDeclaration</code> and its nested
* <code>IASTDeclarator</code>.
*/
public static final ASTNodeProperty DECLARATOR = new ASTNodeProperty(
"Declarator"); //$NON-NLS-1$
/**
* Get the decl specifier.
*
* @return <code>IASTDeclSpecifier</code>
*/
public IASTDeclSpecifier getDeclSpecifier();
/**
* Get the declarator.
@ -44,18 +51,20 @@ public interface IASTParameterDeclaration extends IASTNode {
*/
public IASTDeclarator getDeclarator();
/**
* Set the decl specifier.
*
* @param declSpec <code>IASTDeclSpecifier</code>.
*/
public void setDeclSpecifier(IASTDeclSpecifier declSpec);
/**
* Set the decl specifier.
*
* @param declSpec
* <code>IASTDeclSpecifier</code>.
*/
public void setDeclSpecifier(IASTDeclSpecifier declSpec);
/**
* Set the declarator.
*
* @param declarator <code>IASTDeclarator</code>
*/
public void setDeclarator(IASTDeclarator declarator);
/**
* Set the declarator.
*
* @param declarator
* <code>IASTDeclarator</code>
*/
public void setDeclarator(IASTDeclarator declarator);
}

View file

@ -24,6 +24,7 @@ public interface IASTPointer extends IASTPointerOperator {
* @return boolean
*/
public boolean isConst();
/**
* Is this a volatile pointer?
*
@ -34,14 +35,17 @@ public interface IASTPointer extends IASTPointerOperator {
/**
* Set this to be a const pointer (true/false).
*
* @param value - the value
* @param value -
* the value
*/
public void setConst( boolean value );
public void setConst(boolean value);
/**
* Set this to be a volatile pointer (true/false).
*
* @param value - the value
* @param value -
* the value
*/
public void setVolatile( boolean value );
public void setVolatile(boolean value);
}

View file

@ -15,9 +15,9 @@ package org.eclipse.cdt.core.dom.ast;
*/
public interface IASTPointerOperator extends IASTNode {
/**
* Constant/sentinel.
*/
public static final IASTPointerOperator[] EMPTY_ARRAY = new IASTPointerOperator[0];
/**
* Constant/sentinel.
*/
public static final IASTPointerOperator[] EMPTY_ARRAY = new IASTPointerOperator[0];
}

View file

@ -15,13 +15,14 @@ package org.eclipse.cdt.core.dom.ast;
*
* @author jcamelon
*/
public interface IASTPreprocessorElifStatement extends IASTPreprocessorStatement {
public interface IASTPreprocessorElifStatement extends
IASTPreprocessorStatement {
/**
* Was this #elif branch taken?
*
* @return boolean
*/
public boolean taken();
/**
* Was this #elif branch taken?
*
* @return boolean
*/
public boolean taken();
}

View file

@ -15,11 +15,13 @@ package org.eclipse.cdt.core.dom.ast;
*
* @author jcamelon
*/
public interface IASTPreprocessorElseStatement extends IASTPreprocessorStatement {
public interface IASTPreprocessorElseStatement extends
IASTPreprocessorStatement {
/**
* Was this #else branch taken?
* @return boolean
*/
public boolean taken();
/**
* Was this #else branch taken?
*
* @return boolean
*/
public boolean taken();
}

View file

@ -12,8 +12,10 @@ package org.eclipse.cdt.core.dom.ast;
/**
* This interface represent a preprocessor #endif statement.
*
* @author jcamelon
*/
public interface IASTPreprocessorEndifStatement extends IASTPreprocessorStatement{
public interface IASTPreprocessorEndifStatement extends
IASTPreprocessorStatement {
}

View file

@ -16,6 +16,6 @@ package org.eclipse.cdt.core.dom.ast;
* @author jcamelon
*/
public interface IASTPreprocessorErrorStatement extends
IASTPreprocessorStatement {
IASTPreprocessorStatement {
}

View file

@ -20,7 +20,8 @@ public interface IASTPreprocessorFunctionStyleMacroDefinition extends
IASTPreprocessorMacroDefinition {
/**
* This property represents the relationship between a function style macro definition and one of its parameters.
* This property represents the relationship between a function style macro
* definition and one of its parameters.
*/
public static final ASTNodeProperty PARAMETER = new ASTNodeProperty(
"Function Macro Parameter"); //$NON-NLS-1$
@ -35,7 +36,8 @@ public interface IASTPreprocessorFunctionStyleMacroDefinition extends
/**
* Add a function-style macro parameter.
*
* @param parm <code>IASTFunctionStyleMacroParameter</code>
* @param parm
* <code>IASTFunctionStyleMacroParameter</code>
*/
public void addParameter(IASTFunctionStyleMacroParameter parm);

View file

@ -12,14 +12,15 @@ package org.eclipse.cdt.core.dom.ast;
/**
* This interface represent a preprocessor #if statement.
*
* @author jcamelon
*/
public interface IASTPreprocessorIfStatement extends IASTPreprocessorStatement {
/**
* Was this branch taken?
*
* @return boolean
*/
public boolean taken();
/**
* Was this branch taken?
*
* @return boolean
*/
public boolean taken();
}

View file

@ -12,13 +12,16 @@ package org.eclipse.cdt.core.dom.ast;
/**
* This interface represent a preprocessor #ifdef statement.
*
* @author jcamelon
*/
public interface IASTPreprocessorIfdefStatement extends IASTPreprocessorStatement {
public interface IASTPreprocessorIfdefStatement extends
IASTPreprocessorStatement {
/**
* Was this #ifdef branch taken?
* @return
*/
public boolean taken();
/**
* Was this #ifdef branch taken?
*
* @return
*/
public boolean taken();
}

View file

@ -16,11 +16,12 @@ package org.eclipse.cdt.core.dom.ast;
* @author jcamelon
*/
public interface IASTPreprocessorIfndefStatement extends
IASTPreprocessorStatement {
IASTPreprocessorStatement {
/**
* Was this branch taken?
* @return
*/
public boolean taken();
/**
* Was this branch taken?
*
* @return
*/
public boolean taken();
}

View file

@ -12,6 +12,7 @@ package org.eclipse.cdt.core.dom.ast;
/**
* This interface represent a preprocessor #include statement.
*
* @author jcamelon
*/
public interface IASTPreprocessorIncludeStatement extends
@ -19,6 +20,7 @@ public interface IASTPreprocessorIncludeStatement extends
/**
* Get the full path filename of the file found through #include.
*
* @return
*/
public String getPath();

View file

@ -15,35 +15,42 @@ package org.eclipse.cdt.core.dom.ast;
*
* @author Doug Schaefer
*/
public interface IASTPreprocessorMacroDefinition extends IASTPreprocessorStatement {
public interface IASTPreprocessorMacroDefinition extends
IASTPreprocessorStatement {
/**
* <code>MACRO_NAME</code> describes the relationship between a macro definition and it's name.
*/
public static final ASTNodeProperty MACRO_NAME = new ASTNodeProperty( "Macro Name"); //$NON-NLS-1$
/**
* Get the macro name.
*
* @return <code>IASTName</code>
*/
public IASTName getName();
/**
* Set the macro name.
*
* @param name
*/
public void setName( IASTName name );
/**
* <code>MACRO_NAME</code> describes the relationship between a macro
* definition and it's name.
*/
public static final ASTNodeProperty MACRO_NAME = new ASTNodeProperty(
"Macro Name"); //$NON-NLS-1$
/**
* Get the macro expansion.
*
* @return String
*/
public String getExpansion();
/**
* Set the macro expansion.
*
* @param exp String
*/
public void setExpansion( String exp );
/**
* Get the macro name.
*
* @return <code>IASTName</code>
*/
public IASTName getName();
/**
* Set the macro name.
*
* @param name
*/
public void setName(IASTName name);
/**
* Get the macro expansion.
*
* @return String
*/
public String getExpansion();
/**
* Set the macro expansion.
*
* @param exp
* String
*/
public void setExpansion(String exp);
}

View file

@ -11,11 +11,12 @@
package org.eclipse.cdt.core.dom.ast;
/**
* This interface represents an object-style macro definition.
* e.g. #define ONE_TWO_THREE 123
* This interface represents an object-style macro definition. e.g. #define
* ONE_TWO_THREE 123
*
* @author jcamelon
*/
public interface IASTPreprocessorObjectStyleMacroDefinition extends IASTPreprocessorMacroDefinition {
public interface IASTPreprocessorObjectStyleMacroDefinition extends
IASTPreprocessorMacroDefinition {
}

View file

@ -16,6 +16,6 @@ package org.eclipse.cdt.core.dom.ast;
* @author jcamelon
*/
public interface IASTPreprocessorPragmaStatement extends
IASTPreprocessorStatement {
IASTPreprocessorStatement {
}

View file

@ -15,6 +15,7 @@ package org.eclipse.cdt.core.dom.ast;
*
* @author jcamelon
*/
public interface IASTPreprocessorUndefStatement extends IASTPreprocessorStatement {
public interface IASTPreprocessorUndefStatement extends
IASTPreprocessorStatement {
}

View file

@ -15,377 +15,394 @@ import org.eclipse.cdt.internal.core.parser.ParserMessages;
/**
* @author jcamelon
*
* Description of a C/C++ parse/compilation problem, as detected by the parser or some of the underlying
* clients of the parser.
* Description of a C/C++ parse/compilation problem, as detected by the parser
* or some of the underlying clients of the parser.
*
* A problem provides access to:
* <ul>
* <li> its location (originating source file name, source position, line number), </li>
* <li> its message description and a predicate to check its severity (warning or error). </li>
* <li> its ID : an number identifying the very nature of this problem. All possible IDs are listed
* as constants on this interface. </li>
* <li> its location (originating source file name, source position, line
* number), </li>
* <li> its message description and a predicate to check its severity (warning
* or error). </li>
* <li> its ID : an number identifying the very nature of this problem. All
* possible IDs are listed as constants on this interface. </li>
* </ul>
*/
public interface IASTProblem extends IASTNode {
/**
* Returns the problem id
*
* @return the problem id
*/
int getID();
/**
* Returns the problem id
*
* @return the problem id
*/
int getID();
/**
* Answer a localized, human-readable message string which describes the problem.
*
* @return a localized, human-readable message string which describes the problem
*/
String getMessage();
/**
* Answer a localized, human-readable message string which describes the
* problem.
*
* @return a localized, human-readable message string which describes the
* problem
*/
String getMessage();
/**
* Return to the client a map between parameter names and values.
*
* The keys and values are all Strings.
*
*
* @return a map between parameter names and values.
*/
String getArguments();
/**
* Return to the client a map between parameter names and values.
*
* The keys and values are all Strings.
*
*
* @return a map between parameter names and values.
*/
String getArguments();
/**
* Checks the severity to see if the Error bit is set.
*
* @return true if the Error bit is set for the severity, false otherwise
*/
boolean isError();
/**
* Checks the severity to see if the Error bit is set.
*
* @return true if the Error bit is set for the severity, false otherwise
*/
boolean isError();
/**
* Checks the severity to see if the Warning bit is not set.
*
* @return true if the Warning bit is not set for the severity, false otherwise
*/
boolean isWarning();
/**
* Checks the severity to see if the Warning bit is not set.
*
* @return true if the Warning bit is not set for the severity, false
* otherwise
*/
boolean isWarning();
/**
* Unknown Numeric Value for line numbers and offsets; use this constant
*/
public final static int INT_VALUE_NOT_PROVIDED = -1;
/**
* Unknown Numeric Value for line numbers and offsets; use this constant
*/
public final static int INT_VALUE_NOT_PROVIDED = -1;
/**
* Unknown filename sentinel value
*/
public final static String FILENAME_NOT_PROVIDED = ParserMessages.getString("IProblem.unknownFileName"); //$NON-NLS-1$
/**
* Unknown filename sentinel value
*/
public final static String FILENAME_NOT_PROVIDED = ParserMessages
.getString("IProblem.unknownFileName"); //$NON-NLS-1$
/**
* Problem Categories
* The high bits of a problem ID contains information about the category of a problem.
* For example, (problemID & TypeRelated) != 0, indicates that this problem is type related.
*
* A problem category can help to implement custom problem filters. Indeed, when numerous problems
* are listed, focusing on import related problems first might be relevant.
*
* When a problem is tagged as Internal, it means that no change other than a local source code change
* can fix the corresponding problem.
*/
/**
* Problem Categories The high bits of a problem ID contains information
* about the category of a problem. For example, (problemID & TypeRelated) !=
* 0, indicates that this problem is type related.
*
* A problem category can help to implement custom problem filters. Indeed,
* when numerous problems are listed, focusing on import related problems
* first might be relevant.
*
* When a problem is tagged as Internal, it means that no change other than
* a local source code change can fix the corresponding problem.
*/
/**
* IProblem relates to a valid error on the Scanner
*/
public final static int SCANNER_RELATED = 0x01000000;
/**
* IProblem relates to a valid error on the Scanner
*/
public final static int SCANNER_RELATED = 0x01000000;
/**
* IProblem relates to a valid error on the preprocessor
*/
public final static int PREPROCESSOR_RELATED = 0x02000000;
/**
* IProblem relates to a valid error on the preprocessor
*/
public final static int PREPROCESSOR_RELATED = 0x02000000;
/**
* IProblem relates to a valid syntax error in the parser
*/
public final static int SYNTAX_RELATED = 0x04000000;
/**
* IProblem relates to a valid syntax error in the parser
*/
public final static int SYNTAX_RELATED = 0x04000000;
/**
* IProblem relates to a valid semantical error in the parser
*/
public final static int SEMANTICS_RELATED = 0x08000000;
/**
* IProblem relates to a valid semantical error in the parser
*/
public final static int SEMANTICS_RELATED = 0x08000000;
/**
* IProblem relates to an implementation of design limitation
*/
public final static int INTERNAL_RELATED = 0x10000000;
/**
* IProblem relates to an implementation of design limitation
*/
public final static int INTERNAL_RELATED = 0x10000000;
/**
* Check the parameter bitmask against an IProblem's ID to broadly segregate
* the types of problems.
*
* @param bitmask
* @return true if ( (id & bitmask ) != 0 )
*/
public boolean checkCategory(int bitmask);
/**
* Check the parameter bitmask against an IProblem's ID to broadly segregate the
* types of problems.
*
* @param bitmask
* @return true if ( (id & bitmask ) != 0 )
*/
public boolean checkCategory(int bitmask);
/**
* Mask to use in order to filter out the category portion of the problem
* ID.
*/
public final static int IGNORE_CATEGORIES_MASK = 0xFFFFFF;
/**
* Mask to use in order to filter out the category portion of the problem ID.
*/
public final static int IGNORE_CATEGORIES_MASK = 0xFFFFFF;
/**
* Below are listed all available problem attributes. The JavaDoc for each
* problem ID indicates when they should be contributed to creating a
* problem of that type.
*/
/**
* Below are listed all available problem attributes. The JavaDoc for each problem ID indicates
* when they should be contributed to creating a problem of that type.
*/
// Preprocessor IProblem attributes
/**
* The text that follows a #error preprocessor directive
*/
public final static String A_PREPROC_POUND_ERROR = ParserMessages
.getString("IProblem.preproc.poundError"); //$NON-NLS-1$
// Preprocessor IProblem attributes
/**
* The text that follows a #error preprocessor directive
*/
public final static String A_PREPROC_POUND_ERROR = ParserMessages.getString("IProblem.preproc.poundError"); //$NON-NLS-1$
/**
* The filename that failed somehow in an preprocessor include directive
*/
public final static String A_PREPROC_INCLUDE_FILENAME = ParserMessages
.getString("IProblem.preproc.include"); //$NON-NLS-1$
/**
* The filename that failed somehow in an preprocessor include directive
*/
public final static String A_PREPROC_INCLUDE_FILENAME = ParserMessages.getString("IProblem.preproc.include"); //$NON-NLS-1$
/**
* A preprocessor macro name
*/
public final static String A_PREPROC_MACRO_NAME = ParserMessages
.getString("IProblem.preproc.macro"); //$NON-NLS-1$
/**
* A preprocessor macro name
*/
public final static String A_PREPROC_MACRO_NAME = ParserMessages.getString("IProblem.preproc.macro"); //$NON-NLS-1$
/**
* A preprocessor conditional that could not be evaluated
*
* #if X + Y == Z <== that one, if X, Y or Z are not defined #endif
*/
public final static String A_PREPROC_CONDITION = ParserMessages
.getString("IProblem.preproc.condition"); //$NON-NLS-1$
/**
* A preprocessor conditional that could not be evaluated
*
* #if X + Y == Z <== that one, if X, Y or Z are not defined
* #endif
*/
public final static String A_PREPROC_CONDITION = ParserMessages.getString("IProblem.preproc.condition"); //$NON-NLS-1$
/**
* A preprocessor directive that could not be interpretted
*
* e.g. #blah
*/
public final static String A_PREPROC_UNKNOWN_DIRECTIVE = ParserMessages
.getString("IProblem.preproc.unknownDirective"); //$NON-NLS-1$
/**
* A preprocessor directive that could not be interpretted
*
* e.g. #blah
*/
public final static String A_PREPROC_UNKNOWN_DIRECTIVE = ParserMessages.getString("IProblem.preproc.unknownDirective"); //$NON-NLS-1$
/**
* The preprocessor conditional statement that caused an unbalanced
* mismatch.
*
* #if X #else #else <=== that one #endif
*/
public final static String A_PREPROC_CONDITIONAL_MISMATCH = ParserMessages
.getString("IProblem.preproc.conditionalMismatch"); //$NON-NLS-1$
/**
* The preprocessor conditional statement that caused an unbalanced mismatch.
*
* #if X
* #else
* #else <=== that one
* #endif
*/
public final static String A_PREPROC_CONDITIONAL_MISMATCH = ParserMessages.getString("IProblem.preproc.conditionalMismatch"); //$NON-NLS-1$
/**
* The Bad character encountered in scanner
*/
public static final String A_SCANNER_BADCHAR = null;
/**
* The Bad character encountered in scanner
*/
public static final String A_SCANNER_BADCHAR = null;
/**
* A_SYMBOL_NAME - symbol name
*/
public static final String A_SYMBOL_NAME = ParserMessages
.getString("IProblem.symbolName"); //$NON-NLS-1$
/**
* A_SYMBOL_NAME - symbol name
*/
public static final String A_SYMBOL_NAME = ParserMessages.getString("IProblem.symbolName"); //$NON-NLS-1$
/**
* A_NAMESPACE_NAME = namespace name
*/
public static final String A_NAMESPACE_NAME = ParserMessages
.getString("IProblem.namespaceName"); //$NON-NLS-1$
/**
* A_NAMESPACE_NAME = namespace name
*/
public static final String A_NAMESPACE_NAME = ParserMessages.getString("IProblem.namespaceName"); //$NON-NLS-1$
/**
* A_TYPE_NAME - type name
*/
public static final String A_TYPE_NAME = ParserMessages
.getString("IProblem.typeName"); //$NON-NLS-1$
/**
* A_TYPE_NAME - type name
*/
public static final String A_TYPE_NAME = ParserMessages.getString("IProblem.typeName"); //$NON-NLS-1$
/**
* Below are listed all available problem IDs. Note that this list could be
* augmented in the future, as new features are added to the C/C++ core
* implementation.
*/
/**
* Below are listed all available problem IDs. Note that this list could be augmented in the future,
* as new features are added to the C/C++ core implementation.
*/
/*
* Scanner Problems
*/
/*
* Scanner Problems
*/
/**
* Bad character encountered by Scanner. Required attributes:
* A_SCANNER_BADCHAR
*
* @see #A_SCANNER_BADCHAR
*/
public final static int SCANNER_BAD_CHARACTER = SCANNER_RELATED | 0x001;
/**
* Bad character encountered by Scanner.
* Required attributes: A_SCANNER_BADCHAR
* @see #A_SCANNER_BADCHAR
*/
public final static int SCANNER_BAD_CHARACTER = SCANNER_RELATED | 0x001;
/**
* Unbounded literal string encountered by Scanner. Required attributes:
* none.
*/
public final static int SCANNER_UNBOUNDED_STRING = SCANNER_RELATED | 0x002;
/**
* Unbounded literal string encountered by Scanner.
* Required attributes: none.
*/
public final static int SCANNER_UNBOUNDED_STRING = SCANNER_RELATED | 0x002;
/**
* Invalid escape sequence encountered by Scanner. Required attributes:
* none.
*/
public final static int SCANNER_INVALID_ESCAPECHAR = SCANNER_RELATED | 0x003;
/**
* Invalid escape sequence encountered by Scanner.
* Required attributes: none.
*/
public final static int SCANNER_INVALID_ESCAPECHAR = SCANNER_RELATED | 0x003;
/**
* Bad floating point encountered by Scanner. Required attributes: none.
*/
public final static int SCANNER_BAD_FLOATING_POINT = SCANNER_RELATED | 0x004;
/**
* Bad floating point encountered by Scanner.
* Required attributes: none.
*/
public final static int SCANNER_BAD_FLOATING_POINT = SCANNER_RELATED | 0x004;
/**
* Bad hexidecimal encountered by Scanner. Required attributes: none.
*/
public final static int SCANNER_BAD_HEX_FORMAT = SCANNER_RELATED | 0x005;
/**
* Bad hexidecimal encountered by Scanner.
* Required attributes: none.
*/
public final static int SCANNER_BAD_HEX_FORMAT = SCANNER_RELATED | 0x005;
/**
* Unexpected EOF encountered by Scanner. Required attributes: none.
*/
public final static int SCANNER_UNEXPECTED_EOF = SCANNER_RELATED | 0x006;
/**
* Unexpected EOF encountered by Scanner.
* Required attributes: none.
*/
public final static int SCANNER_UNEXPECTED_EOF = SCANNER_RELATED | 0x006;
/**
* Bad octal encountered by Scanner. Required attributes: none.
*/
public final static int SCANNER_BAD_OCTAL_FORMAT = SCANNER_RELATED | 0x007;
/**
* Bad octal encountered by Scanner.
* Required attributes: none.
*/
public final static int SCANNER_BAD_OCTAL_FORMAT = SCANNER_RELATED | 0x007;
/**
* Bad decimal encountered by Scanner. Required attributes: none.
*/
public final static int SCANNER_BAD_DECIMAL_FORMAT = SCANNER_RELATED | 0x008;
/**
* Bad decimal encountered by Scanner.
* Required attributes: none.
*/
public final static int SCANNER_BAD_DECIMAL_FORMAT = SCANNER_RELATED | 0x008;
/**
* Assignment '=' encountered in macro by Scanner. Required attributes:
* none.
*/
public final static int SCANNER_ASSIGNMENT_NOT_ALLOWED = SCANNER_RELATED | 0x009;
/**
* Assignment '=' encountered in macro by Scanner.
* Required attributes: none.
*/
public final static int SCANNER_ASSIGNMENT_NOT_ALLOWED = SCANNER_RELATED | 0x009;
/**
* Division by 0 encountered in macro by Scanner. Required attributes: none.
*/
public final static int SCANNER_DIVIDE_BY_ZERO = SCANNER_RELATED | 0x00A;
/**
* Division by 0 encountered in macro by Scanner.
* Required attributes: none.
*/
public final static int SCANNER_DIVIDE_BY_ZERO = SCANNER_RELATED | 0x00A;
/**
* Missing ')' encountered in macro by Scanner. Required attributes: none.
*/
public final static int SCANNER_MISSING_R_PAREN = SCANNER_RELATED | 0x00B;
/**
* Missing ')' encountered in macro by Scanner.
* Required attributes: none.
*/
public final static int SCANNER_MISSING_R_PAREN = SCANNER_RELATED | 0x00B;
/**
* Expression syntax error encountered in macro by Scanner. Required
* attributes: none.
*/
public final static int SCANNER_EXPRESSION_SYNTAX_ERROR = SCANNER_RELATED | 0x00C;
/**
* Expression syntax error encountered in macro by Scanner.
* Required attributes: none.
*/
public final static int SCANNER_EXPRESSION_SYNTAX_ERROR = SCANNER_RELATED | 0x00C;
/**
* Expression syntax error encountered in macro by Scanner. Required
* attributes: none.
*/
public final static int SCANNER_ILLEGAL_IDENTIFIER = SCANNER_RELATED | 0x00D;
/**
* Expression syntax error encountered in macro by Scanner.
* Required attributes: none.
*/
public final static int SCANNER_ILLEGAL_IDENTIFIER = SCANNER_RELATED | 0x00D;
/**
* Division by 0 encountered in macro by Scanner. Required attributes: none.
*/
public final static int SCANNER_BAD_CONDITIONAL_EXPRESSION = SCANNER_RELATED | 0x00E;
/**
* Division by 0 encountered in macro by Scanner.
* Required attributes: none.
*/
public final static int SCANNER_BAD_CONDITIONAL_EXPRESSION = SCANNER_RELATED | 0x00E;
/*
* Preprocessor Problems
*/
/**
* #error encountered by Preprocessor. Required attributes:
* A_PREPROC_POUND_ERROR
*
* @see #A_PREPROC_POUND_ERROR
*/
public final static int PREPROCESSOR_POUND_ERROR = PREPROCESSOR_RELATED | 0x001;
/*
* Preprocessor Problems
*/
/**
* Inclusion not found by Preprocessor. Required attributes:
* A_PREPROC_INCLUDE_FILENAME
*
* @see #A_PREPROC_INCLUDE_FILENAME
*/
public final static int PREPROCESSOR_INCLUSION_NOT_FOUND = PREPROCESSOR_RELATED | 0x002;
/**
* #error encountered by Preprocessor.
* Required attributes: A_PREPROC_POUND_ERROR
* @see #A_PREPROC_POUND_ERROR
*/
public final static int PREPROCESSOR_POUND_ERROR = PREPROCESSOR_RELATED | 0x001;
/**
* Macro definition not found by Preprocessor. Required attributes:
* A_PREPROC_MACRO_NAME
*
* @see #A_PREPROC_MACRO_NAME
*/
public final static int PREPROCESSOR_DEFINITION_NOT_FOUND = PREPROCESSOR_RELATED | 0x003;
/**
* Inclusion not found by Preprocessor.
* Required attributes: A_PREPROC_INCLUDE_FILENAME
* @see #A_PREPROC_INCLUDE_FILENAME
*/
public final static int PREPROCESSOR_INCLUSION_NOT_FOUND = PREPROCESSOR_RELATED | 0x002;
/**
* Preprocessor conditionals seem unbalanced. Required attributes:
* A_PREPROC_CONDITIONAL_MISMATCH
*
* @see #A_PREPROC_CONDITIONAL_MISMATCH
*/
/**
* Macro definition not found by Preprocessor.
* Required attributes: A_PREPROC_MACRO_NAME
* @see #A_PREPROC_MACRO_NAME
*/
public final static int PREPROCESSOR_DEFINITION_NOT_FOUND = PREPROCESSOR_RELATED | 0x003;
public final static int PREPROCESSOR_UNBALANCE_CONDITION = PREPROCESSOR_RELATED | 0x004;
/**
* Preprocessor conditionals seem unbalanced.
* Required attributes: A_PREPROC_CONDITIONAL_MISMATCH
* @see #A_PREPROC_CONDITIONAL_MISMATCH
*/
/**
* Invalid format to Macro definition. Required attributes:
* A_PREPROC_MACRO_NAME
*
* @see #A_PREPROC_MACRO_NAME
*/
public final static int PREPROCESSOR_INVALID_MACRO_DEFN = PREPROCESSOR_RELATED | 0x005;
public final static int PREPROCESSOR_UNBALANCE_CONDITION = PREPROCESSOR_RELATED | 0x004;
/**
* Invalid or unknown preprocessor directive encountered by Preprocessor.
* Required attributes: A_PREPROC_UNKNOWN_DIRECTIVE
*
* @see #A_PREPROC_UNKNOWN_DIRECTIVE
*/
public final static int PREPROCESSOR_INVALID_DIRECTIVE = PREPROCESSOR_RELATED | 0x006;
/**
* Invalid format to Macro definition.
* Required attributes: A_PREPROC_MACRO_NAME
* @see #A_PREPROC_MACRO_NAME
*/
public final static int PREPROCESSOR_INVALID_MACRO_DEFN = PREPROCESSOR_RELATED | 0x005;
/**
* Invalid macro redefinition encountered by Preprocessor. Required
* attributes: A_PREPROC_MACRO_NAME
*
* @see #A_PREPROC_MACRO_NAME
*/
public final static int PREPROCESSOR_INVALID_MACRO_REDEFN = PREPROCESSOR_RELATED | 0x007;
/**
* Invalid or unknown preprocessor directive encountered by Preprocessor.
* Required attributes: A_PREPROC_UNKNOWN_DIRECTIVE
* @see #A_PREPROC_UNKNOWN_DIRECTIVE
*/
public final static int PREPROCESSOR_INVALID_DIRECTIVE = PREPROCESSOR_RELATED | 0x006;
/**
* Preprocessor Conditional cannot not be evaluated due. Required
* attributes: A_PREPROC_CONDITION
*
* @see #A_PREPROC_CONDITION
*/
public final static int PREPROCESSOR_CONDITIONAL_EVAL_ERROR = PREPROCESSOR_RELATED | 0x008;
/**
* Invalid macro redefinition encountered by Preprocessor.
* Required attributes: A_PREPROC_MACRO_NAME
* @see #A_PREPROC_MACRO_NAME
*/
public final static int PREPROCESSOR_INVALID_MACRO_REDEFN = PREPROCESSOR_RELATED | 0x007;
/**
* Invalid macro usage encountered by Preprocessor. Required attributes:
* A_PREPROC_MACRO_NAME
*
* @see #A_PREPROC_MACRO_NAME
*/
public final static int PREPROCESSOR_MACRO_USAGE_ERROR = PREPROCESSOR_RELATED | 0x009;
/**
* Preprocessor Conditional cannot not be evaluated due.
* Required attributes: A_PREPROC_CONDITION
* @see #A_PREPROC_CONDITION
*/
public final static int PREPROCESSOR_CONDITIONAL_EVAL_ERROR = PREPROCESSOR_RELATED | 0x008;
/**
* Invalid Macro Pasting encountered by Preprocessor. Required attributes:
* A_PREPROC_MACRO_NAME
*
* @see #A_PREPROC_MACRO_NAME
*/
public final static int PREPROCESSOR_MACRO_PASTING_ERROR = PREPROCESSOR_RELATED | 0x00A;
/**
* Invalid macro usage encountered by Preprocessor.
* Required attributes: A_PREPROC_MACRO_NAME
* @see #A_PREPROC_MACRO_NAME
*/
public final static int PREPROCESSOR_MACRO_USAGE_ERROR = PREPROCESSOR_RELATED | 0x009;
/**
* Circular inclusion encountered by Preprocessor. Required attributes:
* A_PREPROC_INCLUDE_FILENAME
*
* @see #A_PREPROC_INCLUDE_FILENAME
*/
public final static int PREPROCESSOR_CIRCULAR_INCLUSION = PREPROCESSOR_RELATED | 0x00B;
/**
* Invalid Macro Pasting encountered by Preprocessor.
* Required attributes: A_PREPROC_MACRO_NAME
* @see #A_PREPROC_MACRO_NAME
*/
public final static int PREPROCESSOR_MACRO_PASTING_ERROR = PREPROCESSOR_RELATED | 0x00A;
/**
* macro argument "..." encountered without the required ')' i.e. must be
* last argument if used Required attributes: none
*/
public final static int PREPROCESSOR_MISSING_RPAREN_PARMLIST = PREPROCESSOR_RELATED | 0x00C;
/**
* Circular inclusion encountered by Preprocessor.
* Required attributes: A_PREPROC_INCLUDE_FILENAME
* @see #A_PREPROC_INCLUDE_FILENAME
*/
public final static int PREPROCESSOR_CIRCULAR_INCLUSION = PREPROCESSOR_RELATED | 0x00B;
/**
* macro argument "..." encountered without the required ')' i.e. must be last argument if used
* Required attributes: none
*/
public final static int PREPROCESSOR_MISSING_RPAREN_PARMLIST = PREPROCESSOR_RELATED | 0x00C;
/**
* __VA_ARGS__ encountered in macro definition without the required '...' parameter
* Required attributes: none
*/
public final static int PREPROCESSOR_INVALID_VA_ARGS = PREPROCESSOR_RELATED | 0x00D;
/*
* Parser Syntactic Problems
*/
public final static int SYNTAX_ERROR = SYNTAX_RELATED | 0x001;
/**
* __VA_ARGS__ encountered in macro definition without the required '...'
* parameter Required attributes: none
*/
public final static int PREPROCESSOR_INVALID_VA_ARGS = PREPROCESSOR_RELATED | 0x00D;
/*
* Parser Syntactic Problems
*/
public final static int SYNTAX_ERROR = SYNTAX_RELATED | 0x001;
}

View file

@ -11,11 +11,12 @@
package org.eclipse.cdt.core.dom.ast;
/**
* This interface represents a parse problem where we tried to match against a declaration.
* This interface represents a parse problem where we tried to match against a
* declaration.
*
* @author jcamelon
*/
public interface IASTProblemDeclaration extends IASTDeclaration, IASTProblemHolder {
public interface IASTProblemDeclaration extends IASTDeclaration,
IASTProblemHolder {
}

View file

@ -10,12 +10,13 @@
**********************************************************************/
package org.eclipse.cdt.core.dom.ast;
/**
* This interface represents a parse problem where we tried to match against a expression.
* This interface represents a parse problem where we tried to match against a
* expression.
*
* @author jcamelon
*/
public interface IASTProblemExpression extends IASTExpression, IASTProblemHolder {
public interface IASTProblemExpression extends IASTExpression,
IASTProblemHolder {
}

View file

@ -11,25 +11,30 @@
package org.eclipse.cdt.core.dom.ast;
/**
* This interface represents a base interface to represent a problem owner or holder.
* This interface represents a base interface to represent a problem owner or
* holder.
*
* @author jcamelon
*/
public interface IASTProblemHolder {
/**
* <code>PROBLEM</code> represents the relationship between a <code>IASTProblemHolder</code> and its <code>IASTProblem</code>.
*/
public static final ASTNodeProperty PROBLEM = new ASTNodeProperty( "Problem"); //$NON-NLS-1$
/**
* Get the problem.
*
* @return <code>IASTProblem</code>
*/
public IASTProblem getProblem();
/**
* Set the problem.
*
* @param p <code>IASTProblem</code>
*/
public void setProblem(IASTProblem p);
/**
* <code>PROBLEM</code> represents the relationship between a
* <code>IASTProblemHolder</code> and its <code>IASTProblem</code>.
*/
public static final ASTNodeProperty PROBLEM = new ASTNodeProperty("Problem"); //$NON-NLS-1$
/**
* Get the problem.
*
* @return <code>IASTProblem</code>
*/
public IASTProblem getProblem();
/**
* Set the problem.
*
* @param p
* <code>IASTProblem</code>
*/
public void setProblem(IASTProblem p);
}

View file

@ -11,10 +11,11 @@
package org.eclipse.cdt.core.dom.ast;
/**
* This interface represents a parse problem where we tried to match against a statement.
* This interface represents a parse problem where we tried to match against a
* statement.
*
* @author jcamelon
*/
public interface IASTProblemStatement extends IASTStatement, IASTProblemHolder {
}

View file

@ -11,7 +11,8 @@
package org.eclipse.cdt.core.dom.ast;
/**
* This interface represents a parse problem where we tried to match against a type-id.
* This interface represents a parse problem where we tried to match against a
* type-id.
*
* @author jcamelon
*/

View file

@ -15,7 +15,13 @@ package org.eclipse.cdt.core.dom.ast;
*/
public interface IASTReturnStatement extends IASTStatement {
public static final ASTNodeProperty RETURNVALUE = new ASTNodeProperty("returnValue"); //$NON-NLS-1$
/**
* <code>RETURNVALUE</code> represents the relationship between an
* <code>IASTReturnStatement</code> and it's nested
* <code>IASTExpression</code>.
*/
public static final ASTNodeProperty RETURNVALUE = new ASTNodeProperty(
"returnValue"); //$NON-NLS-1$
/**
* This is the optional return value for this function.
@ -24,6 +30,12 @@ public interface IASTReturnStatement extends IASTStatement {
*/
public IASTExpression getReturnValue();
/**
* Set the return value.
*
* @param returnValue
* <code>IASTExpression</code>
*/
public void setReturnValue(IASTExpression returnValue);
}

View file

@ -18,32 +18,117 @@ package org.eclipse.cdt.core.dom.ast;
public interface IASTSimpleDeclSpecifier extends IASTDeclSpecifier {
/**
* This returns the built-in type for the declaration. The type is
* then refined by qualifiers for signed/unsigned and short/long.
* The type could also be unspecified which usually means int.
* This returns the built-in type for the declaration. The type is then
* refined by qualifiers for signed/unsigned and short/long. The type could
* also be unspecified which usually means int.
*
* @return
*/
public int getType();
/**
* <code>t_unspecified</code> implies an unspecified type. .e.g x = 5; //
* declaration w/t_unspecified type logically defaults to integer.
*/
public static final int t_unspecified = 0;
/**
* <code>t_void</code> implies void type e.g. void x();
*/
public static final int t_void = 1;
/**
* <code>t_char</code> implies char type e.g. char y;
*/
public static final int t_char = 2;
/**
* <code>t_int</code> implies int type e.g. int x;
*/
public static final int t_int = 3;
/**
* <code>t_float</code> implies floating point type. e.g. float yy;
*/
public static final int t_float = 4;
/**
* <code>t_double</code> implies double floating point type. e.g. double
* d;
*/
public static final int t_double = 5;
/**
* <code>t_last</code> specified for subinterface definition.
*/
public static final int t_last = t_double; // used only in subclasses
public void setType( int type );
/**
* Set this decl specifier type to <code>type</code>.
*
* @param type
* (int)
*/
public void setType(int type);
/**
* Is the type modified by the signed keyword?
*
* @return boolean
*/
public boolean isSigned();
/**
* Is the type modified by the unsigned keyword?
*
* @return boolean
*/
public boolean isUnsigned();
/**
* Is the type modified by the short keyword?
*
* @return boolean
*/
public boolean isShort();
/**
* Is the type modified by the long keyword?
*
* @return boolean
*/
public boolean isLong();
public void setSigned( boolean value );
public void setUnsigned( boolean value );
public void setLong( boolean value );
public void setShort( boolean value );
/**
* Change as to if the type is modified by the keyword signed.
*
* @param value
* boolean
*/
public void setSigned(boolean value);
/**
* Change as to if the type is modified by the keyword unsigned.
*
* @param value
* boolean
*/
public void setUnsigned(boolean value);
/**
* Change as to if the type is modified by the keyword long.
*
* @param value
* boolean
*/
public void setLong(boolean value);
/**
* Change as to if the type is modified by the keyword short.
*
* @param value
* boolean
*/
public void setShort(boolean value);
}

View file

@ -10,7 +10,6 @@
**********************************************************************/
package org.eclipse.cdt.core.dom.ast;
/**
* This is a simple declaration which contains a sequence of declSpecifiers
* followed by a list of declarators.
@ -19,10 +18,23 @@ package org.eclipse.cdt.core.dom.ast;
*/
public interface IASTSimpleDeclaration extends IASTDeclaration, IASTNode {
ASTNodeProperty DECL_SPECIFIER = new ASTNodeProperty( "Decl Specifier"); //$NON-NLS-1$
ASTNodeProperty DECLARATOR = new ASTNodeProperty( "Declarator"); //$NON-NLS-1$
/**
* <code>DECL_SPECIFIER</code> represents the relationship between an
* <code>IASTSimpleDeclaration</code> and it's nested
* <code>IASTDeclSpecifier</code>.
*/
public static final ASTNodeProperty DECL_SPECIFIER = new ASTNodeProperty(
"Decl Specifier"); //$NON-NLS-1$
/**
/**
* <code>DECLARATOR</code> represents the relationship between an
* <code>IASTSimpleDeclaration</code> and it's nested
* <code>IASTDeclarator</code>s.
*/
public static final ASTNodeProperty DECLARATOR = new ASTNodeProperty(
"Declarator"); //$NON-NLS-1$
/**
* This returns the object representing the declSpecifiers for this
* declaration.
*
@ -30,15 +42,27 @@ public interface IASTSimpleDeclaration extends IASTDeclaration, IASTNode {
*/
public IASTDeclSpecifier getDeclSpecifier();
public void setDeclSpecifier( IASTDeclSpecifier declSpec );
/**
* Set the decl specifier.
*
* @param declSpec
* <code>IASTDeclSpecifier</code>
*/
public void setDeclSpecifier(IASTDeclSpecifier declSpec);
/**
* This returns the list of declarators in this declaration.
*
* @return list of IASTDeclarator
* @return <code>IASTDeclarator []</code>
*/
public IASTDeclarator[] getDeclarators();
public void addDeclarator( IASTDeclarator declarator );
/**
* Add a declarator.
*
* @param declarator
* <code>IASTDeclarator</code>
*/
public void addDeclarator(IASTDeclarator declarator);
}

View file

@ -10,7 +10,6 @@
**********************************************************************/
package org.eclipse.cdt.core.dom.ast;
/**
* This is a declarator for a non K&R C function.
*
@ -18,17 +17,41 @@ package org.eclipse.cdt.core.dom.ast;
*/
public interface IASTStandardFunctionDeclarator extends IASTFunctionDeclarator {
public final static ASTNodeProperty FUNCTION_PARAMETER = new ASTNodeProperty( "Parameter"); //$NON-NLS-1$
/**
* <code>FUNCTION_PARAMETER</code> represents the relationship between an
* <code>IASTStandardFunctionDeclarator</code> and it's nested
* <code>IASTParameterDeclaration</code>.
*/
public final static ASTNodeProperty FUNCTION_PARAMETER = new ASTNodeProperty(
"Parameter"); //$NON-NLS-1$
/**
* Gets the parameter declarations for the function
*
* @return List of IASTParameterDeclaration
* @return array of IASTParameterDeclaration
*/
public IASTParameterDeclaration[] getParameters();
public void addParameterDeclaration( IASTParameterDeclaration parameter );
/**
* Add a parameter.
*
* @param parameter
* <code>IASTParameterDeclaration</code>
*/
public void addParameterDeclaration(IASTParameterDeclaration parameter);
/**
* Does this function take a variable number of arguments?
*
* @return boolean
*/
public boolean takesVarArgs();
public void setVarArgs( boolean value );
/**
* Set whether or not this function takes a variable number or arguments.
*
* @param value
* boolean
*/
public void setVarArgs(boolean value);
}

View file

@ -1,5 +1,5 @@
/**********************************************************************
* Copyright (c) 2004 IBM Corporation and others.
Z * Copyright (c) 2004 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
@ -16,6 +16,9 @@ package org.eclipse.cdt.core.dom.ast;
* @author Doug Schaefer
*/
public interface IASTStatement extends IASTNode {
public static final IASTStatement[] EMPTY_STATEMENT_ARRAY = new IASTStatement[0];
/**
* Constant.
*/
public static final IASTStatement[] EMPTY_STATEMENT_ARRAY = new IASTStatement[0];
}

View file

@ -17,8 +17,20 @@ package org.eclipse.cdt.core.dom.ast;
*/
public interface IASTSwitchStatement extends IASTStatement {
public static final ASTNodeProperty CONTROLLER = new ASTNodeProperty("controller"); //$NON-NLS-1$
public static final ASTNodeProperty BODY = new ASTNodeProperty("body"); //$NON-NLS-1$
/**
* <code>CONTROLLER</code> represents the relationship between an
* <code>IASTSwitchStatement</code> and it's nested
* <code>IASTExpression</code>.
*/
public static final ASTNodeProperty CONTROLLER = new ASTNodeProperty(
"controller"); //$NON-NLS-1$
/**
* <code>BODY</code> represents the relationship between an
* <code>IASTSwitchStatement</code> and it's nested
* <code>IASTStatement</code>.
*/
public static final ASTNodeProperty BODY = new ASTNodeProperty("body"); //$NON-NLS-1$
/**
* This returns the expression which determines which case to take.
@ -27,17 +39,29 @@ public interface IASTSwitchStatement extends IASTStatement {
*/
public IASTExpression getController();
/**
* Set the controlling expression for the switch.
*
* @param controller
* <code>IASTExpression</code>
*/
public void setController(IASTExpression controller);
/**
* The body of the switch statement.
* Returns the body of the switch statement.
*
* TODO - finding the cases could be a logical thing
*
* @return
* @return <code>IASTStatement</code>
*/
public IASTStatement getBody();
/**
* Set the body for the switch statement.
*
* @param body
* <code>IASTStatement</code>
*/
public void setBody(IASTStatement body);
}

View file

@ -17,61 +17,121 @@ package org.eclipse.cdt.core.dom.ast;
*/
public interface IASTTranslationUnit extends IASTNode {
public static final ASTNodeProperty OWNED_DECLARATION = new ASTNodeProperty(
"Owned"); //$NON-NLS-1$
public static final ASTNodeProperty SCANNER_PROBLEM = new ASTNodeProperty(
"Scanner Problem"); //$NON-NLS-1$
public static final ASTNodeProperty PREPROCESSOR_STATEMENT = new ASTNodeProperty(
"Inclusion"); //$NON-NLS-1$
/**
* <code>OWNED_DECLARATION</code> represents the relationship between an <code>IASTTranslationUnit</code> and
* it's nested <code>IASTDeclaration</code>'s.
*/
public static final ASTNodeProperty OWNED_DECLARATION = new ASTNodeProperty(
"Owned"); //$NON-NLS-1$
/**
* A translation unit contains an ordered sequence of declarations.
*
* @return List of IASTDeclaration
*/
public IASTDeclaration[] getDeclarations();
/**
* <code>SCANNER_PROBLEM</code> represents the relationship between an <code>IASTTranslationUnit</code> and
* it's nested <code>IASTProblem</code>.
*/
public static final ASTNodeProperty SCANNER_PROBLEM = new ASTNodeProperty(
"Scanner Problem"); //$NON-NLS-1$
public void addDeclaration(IASTDeclaration declaration);
/**
* <code>PREPROCESSOR_STATEMENT</code> represents the relationship between an <code>IASTTranslationUnit</code> and
* it's nested <code>IASTPreprocessorStatement</code>.
*/
public static final ASTNodeProperty PREPROCESSOR_STATEMENT = new ASTNodeProperty(
"PP Statement"); //$NON-NLS-1$
/**
* This returns the global scope for the translation unit.
*
* @return the global scope
*/
public IScope getScope();
/**
* A translation unit contains an ordered sequence of declarations.
*
* @return List of IASTDeclaration
*/
public IASTDeclaration[] getDeclarations();
/**
* Returns the list of declarations in this translation unit for the given
* binding. The list contains the IASTName nodes that declare the binding.
*
* @param binding
* @return List of IASTName nodes for the binding's declaration
*/
public IASTName[] getDeclarations(IBinding binding);
/**
* Add declaration to translation unit.
*
* @param declaration <code>IASTDeclaration</code>
*/
public void addDeclaration(IASTDeclaration declaration);
/**
* Returns the list of references in this translation unit to the given
* binding. This list contains the IASTName nodes that represent a use of the
* binding.
*
* @param binding
* @return List of IASTName nodes representing uses of the binding
*/
public IASTName[] getReferences(IBinding binding);
/**
* This returns the global scope for the translation unit.
*
* @return the global scope
*/
public IScope getScope();
public IASTNodeLocation[] getLocationInfo(int offset, int length);
/**
* Returns the list of declarations in this translation unit for the given
* binding. The list contains the IASTName nodes that declare the binding.
*
* @param binding
* @return List of IASTName nodes for the binding's declaration
*/
public IASTName[] getDeclarations(IBinding binding);
public IASTNode selectNodeForLocation(String path, int offset, int length);
/**
* Returns the list of references in this translation unit to the given
* binding. This list contains the IASTName nodes that represent a use of
* the binding.
*
* @param binding
* @return List of IASTName nodes representing uses of the binding
*/
public IASTName[] getReferences(IBinding binding);
public IASTPreprocessorMacroDefinition[] getMacroDefinitions();
/**
* @param offset
* @param length
* @return
*/
public IASTNodeLocation[] getLocationInfo(int offset, int length);
public IASTPreprocessorIncludeStatement[] getIncludeDirectives();
/**
* Select the node in the treet that best fits the offset/length/file path.
*
* @param path - file name specified through path
* @param offset - location in the file as an offset
* @param length - length of selection
* @return <code>IASTNode</code> that best fits
*/
public IASTNode selectNodeForLocation(String path, int offset, int length);
public IASTPreprocessorStatement[] getAllPreprocessorStatements();
/**
* Get the macro definitions encountered in parsing this translation unit.
*
* @return <code>IASTPreprocessorMacroDefinition[]</code>
*/
public IASTPreprocessorMacroDefinition[] getMacroDefinitions();
public IASTProblem[] getPreprocesorProblems();
/**
* Get the #include directives encountered in parsing this translation unit.
* @return <code>IASTPreprocessorIncludeStatement[]</code>
*/
public IASTPreprocessorIncludeStatement[] getIncludeDirectives();
public String getUnpreprocessedSignature( IASTNodeLocation [] locations );
/**
* Get all preprocessor statements.
*
* @return <code>IASTPreprocessorStatement[]</code>
*/
public IASTPreprocessorStatement[] getAllPreprocessorStatements();
public String getFilePath();
/**
* Get all preprocessor and scanner problems.
* @return <code>IASTProblem[]</code>
*/
public IASTProblem[] getPreprocessorProblems();
/**
* For a given range of locations, return a String that represents what is there underneath the range.
*
* @param locations A range of node locations
* @return A String signature.
*/
public String getUnpreprocessedSignature(IASTNodeLocation[] locations);
/**
* Get the translation unit's full path.
* @return String representation of path.
*/
public String getFilePath();
}

View file

@ -14,13 +14,47 @@ package org.eclipse.cdt.core.dom.ast;
*/
public interface IASTTypeId extends IASTNode {
public static final IASTTypeId [] EMPTY_TYPEID_ARRAY = new IASTTypeId[0];
/**
* Constant.
*/
public static final IASTTypeId[] EMPTY_TYPEID_ARRAY = new IASTTypeId[0];
public static final ASTNodeProperty DECL_SPECIFIER = new ASTNodeProperty( "Decl Specifier"); //$NON-NLS-1$
public static final ASTNodeProperty ABSTRACT_DECLARATOR = new ASTNodeProperty( "Abstract Declarator"); //$NON-NLS-1$
/**
* <code>DECL_SPECIFIER</code> represents the relationship between an <code>IASTTypeId</code> and
* it's nested <code>IASTDeclSpecifier</code>.
*/
public static final ASTNodeProperty DECL_SPECIFIER = new ASTNodeProperty(
"Decl Specifier"); //$NON-NLS-1$
public IASTDeclSpecifier getDeclSpecifier();
public void setDeclSpecifier( IASTDeclSpecifier declSpec );
public IASTDeclarator getAbstractDeclarator();
public void setAbstractDeclarator( IASTDeclarator abstractDeclarator );
/**
* <code>ABSTRACT_DECLARATOR</code> represents the relationship between an <code>IASTTypeId</code> and
* it's nested <code>IASTDeclarator</code>.
*/
public static final ASTNodeProperty ABSTRACT_DECLARATOR = new ASTNodeProperty(
"Abstract Declarator"); //$NON-NLS-1$
/**
* Get the decl specifier.
* @return <code>IASTDeclSpecifier</code>
*/
public IASTDeclSpecifier getDeclSpecifier();
/**
* Set the decl specifier.
* @param declSpec <code>IASTDeclSpecifier</code>
*/
public void setDeclSpecifier(IASTDeclSpecifier declSpec);
/**
* Get the abstract declarator.
*
* @return <code>IASTDeclarator</code>
*/
public IASTDeclarator getAbstractDeclarator();
/**
* Set the abstract declarator.
* @param abstractDeclarator <code>IASTDeclarator</code>
*/
public void setAbstractDeclarator(IASTDeclarator abstractDeclarator);
}

View file

@ -14,14 +14,46 @@ package org.eclipse.cdt.core.dom.ast;
*/
public interface IASTTypeIdExpression extends IASTExpression {
public static final int op_sizeof = 0;
public static final int op_last = op_sizeof;
/**
* <code>op_sizeof</code> sizeof( typeId ) expression
*/
public static final int op_sizeof = 0;
public int getOperator();
public void setOperator( int value );
/**
* <code>op_last</code> defined for sub-interfaces to extend.
*/
public static final int op_last = op_sizeof;
public static final ASTNodeProperty TYPE_ID = new ASTNodeProperty( "Type Id"); //$NON-NLS-1$
public void setTypeId( IASTTypeId typeId );
public IASTTypeId getTypeId();
/**
* Get the operator for the expression.
*
* @return int
*/
public int getOperator();
/**
* Set the operator for the expression.
* @param value int
*/
public void setOperator(int value);
/**
* <code>TYPEID</code> represents the relationship between an <code>IASTTypeIdExpression</code> and
* it's nested <code>IASTTypeId</code>.
*/
public static final ASTNodeProperty TYPE_ID = new ASTNodeProperty("Type Id"); //$NON-NLS-1$
/**
* Set the type Id.
* @param typeId
*/
public void setTypeId(IASTTypeId typeId);
/**
* Get the type Id.
*
* @return
*/
public IASTTypeId getTypeId();
}

View file

@ -10,31 +10,121 @@
package org.eclipse.cdt.core.dom.ast;
/**
* This interface is used to represent a unary expression in the AST.
*
* @author jcamelon
*/
public interface IASTUnaryExpression extends IASTExpression {
public static final int op_prefixIncr = 0;
public static final int op_prefixDecr = 1;
public static final int op_plus = 2;
public static final int op_minus = 3;
public static final int op_star = 4;
public static final int op_amper = 5;
public static final int op_tilde = 6;
public static final int op_not = 7;
public static final int op_sizeof = 8;
public static final int op_postFixIncr = 9;
public static final int op_postFixDecr = 10;
public static final int op_bracketedPrimary = 11;
public static final int op_last = op_bracketedPrimary;
/**
* Prefix increment.
* <code>op_prefixIncr</code> ++exp
*/
public static final int op_prefixIncr = 0;
public int getOperator();
public void setOperator( int value );
/**
* Prefix decrement.
* <code>op_prefixDecr</code> --exp
*/
public static final int op_prefixDecr = 1;
public static final ASTNodeProperty OPERAND = new ASTNodeProperty( "Operand" ); //$NON-NLS-1$
/**
* Operator plus.
* <code>op_plus</code> ==> + exp
*/
public static final int op_plus = 2;
/**
* Operator minus.
* <code>op_minux</code> ==> -exp
*/
public static final int op_minus = 3;
public IASTExpression getOperand();
public void setOperand( IASTExpression expression );
/**
* Operator star.
* <code>op_star</code> ==> *exp
*/
public static final int op_star = 4;
/**
* Operator ampersand.
* <code>op_amper</code> ==> &exp
*/
public static final int op_amper = 5;
/**
* Operator tilde.
* <code>op_tilde</code> ==> ~exp
*/
public static final int op_tilde = 6;
/**
* not.
* <code>op_not</code> ==> ! exp
*/
public static final int op_not = 7;
/**
* sizeof.
* <code>op_sizeof</code> ==> sizeof exp
*/
public static final int op_sizeof = 8;
/**
* Postfix increment.
* <code>op_postFixIncr</code> ==> exp++
*/
public static final int op_postFixIncr = 9;
/**
* Postfix decrement.
* <code>op_bracketedPrimary</code> ==> exp--
*/
public static final int op_postFixDecr = 10;
/**
* A bracketed expression.
* <code>op_bracketedPrimary</code> ==> ( exp )
*/
public static final int op_bracketedPrimary = 11;
/**
* <code>op_last</code> is made available for subclasses.
*/
public static final int op_last = op_bracketedPrimary;
/**
* Get the operator/kind.
*
* @return (int)
*/
public int getOperator();
/**
* Set the operator/kind.
*
* @param value (int) value
*/
public void setOperator(int value);
/**
* <code>OPERAND</code> represents the relationship between an <code>IASTUnaryExpression</code> and
* it's nested <code>IASTExpression</code>.
*/
public static final ASTNodeProperty OPERAND = new ASTNodeProperty("Operand"); //$NON-NLS-1$
/**
* Get the operand.
*
* @return <code>IASTExpression</code>
*/
public IASTExpression getOperand();
/**
* Set the operand.
*
* @param expression <code>IASTExpression</code>
*/
public void setOperand(IASTExpression expression);
}

View file

@ -17,15 +17,31 @@ package org.eclipse.cdt.core.dom.ast;
*/
public interface IASTWhileStatement extends IASTStatement {
public static final ASTNodeProperty CONDITIONEXPRESSION = new ASTNodeProperty("condition"); //$NON-NLS-1$
public static final ASTNodeProperty BODY = new ASTNodeProperty("body"); //$NON-NLS-1$
/**
* <code>CONDITIONEXPRESSION</code> represents the relationship between an <code>IASTWhileStatement</code> and
* it's nested <code>IASTExpression</code>.
*/
public static final ASTNodeProperty CONDITIONEXPRESSION = new ASTNodeProperty(
"condition"); //$NON-NLS-1$
/**
* The condition on the while loop
* <code>BODY</code> represents the relationship between an <code>IASTWhileStatement</code> and
* it's nested <code>IASTStatement</code>.
*/
public static final ASTNodeProperty BODY = new ASTNodeProperty("body"); //$NON-NLS-1$
/**
* Get the condition on the while loop
*
* @return expression for the condition
*/
public IASTExpression getCondition();
/**
* Set the condition of the while loop.
*
* @param condition
*/
public void setCondition(IASTExpression condition);
/**
@ -35,6 +51,11 @@ public interface IASTWhileStatement extends IASTStatement {
*/
public IASTStatement getBody();
/**
* Set the body of the while loop.
*
* @param body
*/
public void setBody(IASTStatement body);
}

View file

@ -447,7 +447,7 @@ public class CASTTranslationUnit extends CASTNode implements
*
* @see org.eclipse.cdt.core.dom.ast.IASTTranslationUnit#getPreprocesorProblems()
*/
public IASTProblem[] getPreprocesorProblems() {
public IASTProblem[] getPreprocessorProblems() {
if (resolver == null)
return EMPTY_PROBLEM_ARRAY;
IASTProblem[] result = resolver.getScannerProblems();

View file

@ -432,7 +432,7 @@ public class CPPASTTranslationUnit extends CPPASTNode implements
*
* @see org.eclipse.cdt.core.dom.ast.IASTTranslationUnit#getPreprocesorProblems()
*/
public IASTProblem[] getPreprocesorProblems() {
public IASTProblem[] getPreprocessorProblems() {
if (resolver == null)
return EMPTY_PROBLEM_ARRAY;
IASTProblem[] result = resolver.getScannerProblems();

View file

@ -384,7 +384,7 @@ public class DOMAST extends ViewPart {
if (monitor.isCanceled()) return Status.CANCEL_STATUS;
monitor.subTask(RETRIEVING_PREPROCESSOR_PROBLEMS);
start=System.currentTimeMillis();
IASTProblem[] problems = tu.getPreprocesorProblems();
IASTProblem[] problems = tu.getPreprocessorProblems();
monitor.worked(5);
System.out.println("[DOM AST View] done " + RETRIEVING_PREPROCESSOR_PROBLEMS + ": " + (System.currentTimeMillis()- start) );