mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Add JavaDoc.
Formatted public interfaces. Restructured some public interfaces.
This commit is contained in:
parent
39ca877911
commit
834e06e8fc
87 changed files with 2610 additions and 1704 deletions
|
@ -124,12 +124,12 @@ public class AST2BaseTest extends TestCase {
|
||||||
if( lang == ParserLanguage.C && expectNoProblems )
|
if( lang == ParserLanguage.C && expectNoProblems )
|
||||||
{
|
{
|
||||||
assertEquals( CVisitor.getProblems(tu).length, 0 );
|
assertEquals( CVisitor.getProblems(tu).length, 0 );
|
||||||
assertEquals( tu.getPreprocesorProblems().length, 0 );
|
assertEquals( tu.getPreprocessorProblems().length, 0 );
|
||||||
}
|
}
|
||||||
else if ( lang == ParserLanguage.CPP && expectNoProblems )
|
else if ( lang == ParserLanguage.CPP && expectNoProblems )
|
||||||
{
|
{
|
||||||
assertEquals( CPPVisitor.getProblems(tu).length, 0 );
|
assertEquals( CPPVisitor.getProblems(tu).length, 0 );
|
||||||
assertEquals( tu.getPreprocesorProblems().length, 0 );
|
assertEquals( tu.getPreprocessorProblems().length, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
return tu;
|
return tu;
|
||||||
|
|
|
@ -20,22 +20,21 @@ import org.eclipse.cdt.core.parser.CodeReader;
|
||||||
*/
|
*/
|
||||||
public interface ICodeReaderFactory {
|
public interface ICodeReaderFactory {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return unique identifier as int
|
* @return unique identifier as int
|
||||||
*/
|
*/
|
||||||
public int getUniqueIdentifier();
|
public int getUniqueIdentifier();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create CodeReader for translation unit
|
* Create CodeReader for translation unit
|
||||||
*
|
*
|
||||||
* @param path Canonical Path representing path location for file to be opened
|
* @param path
|
||||||
|
* Canonical Path representing path location for file to be
|
||||||
|
* opened
|
||||||
* @return CodeReader for contents at that path.
|
* @return CodeReader for contents at that path.
|
||||||
*/
|
*/
|
||||||
public CodeReader createCodeReaderForTranslationUnit(String path);
|
public CodeReader createCodeReaderForTranslationUnit(String path);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create CodeReader for inclusion.
|
* Create CodeReader for inclusion.
|
||||||
*
|
*
|
||||||
|
|
|
@ -13,15 +13,16 @@ package org.eclipse.cdt.core.dom;
|
||||||
import org.eclipse.cdt.core.parser.IScannerInfo;
|
import org.eclipse.cdt.core.parser.IScannerInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This interface represents a parser configuration as specified by the
|
* This interface represents a parser configuration as specified by the client
|
||||||
* client to the parser service.
|
* to the parser service.
|
||||||
*
|
*
|
||||||
* @author jcamelon
|
* @author jcamelon
|
||||||
*/
|
*/
|
||||||
public interface IParserConfiguration {
|
public interface IParserConfiguration {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return IScannerInfo representing the build information required to parse.
|
* @return IScannerInfo representing the build information required to
|
||||||
|
* parse.
|
||||||
*/
|
*/
|
||||||
public IScannerInfo getScannerInfo();
|
public IScannerInfo getScannerInfo();
|
||||||
|
|
||||||
|
|
|
@ -13,27 +13,29 @@ import java.util.List;
|
||||||
import org.eclipse.cdt.core.parser.IToken;
|
import org.eclipse.cdt.core.parser.IToken;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class represents the node that would occur at the point of
|
* This class represents the node that would occur at the point of a context
|
||||||
* a context completion.
|
* completion.
|
||||||
*
|
*
|
||||||
* This node may contain the prefix text of an identifer up to the point.
|
* This node may contain the prefix text of an identifer up to the point. If
|
||||||
* If there is no prefix, the completion occurred at the point where a
|
* there is no prefix, the completion occurred at the point where a new token
|
||||||
* new token would have begun.
|
* would have begun.
|
||||||
*
|
*
|
||||||
* The node points to the parent node where this node, if replaced by
|
* The node points to the parent node where this node, if replaced by a proper
|
||||||
* a proper node, would reside in the tree.
|
* node, would reside in the tree.
|
||||||
*
|
*
|
||||||
* @author Doug Schaefer
|
* @author Doug Schaefer
|
||||||
*/
|
*/
|
||||||
public class ASTCompletionNode {
|
public class ASTCompletionNode {
|
||||||
|
|
||||||
private IToken completionToken;
|
private IToken completionToken;
|
||||||
|
|
||||||
private List names = new ArrayList();
|
private List names = new ArrayList();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Only constructor.
|
* Only constructor.
|
||||||
*
|
*
|
||||||
* @param completionToken - the completion token
|
* @param completionToken -
|
||||||
|
* the completion token
|
||||||
*/
|
*/
|
||||||
public ASTCompletionNode(IToken completionToken) {
|
public ASTCompletionNode(IToken completionToken) {
|
||||||
this.completionToken = completionToken;
|
this.completionToken = completionToken;
|
||||||
|
@ -49,8 +51,8 @@ public class ASTCompletionNode {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If the point of completion was at the end of a potential
|
* If the point of completion was at the end of a potential identifier, this
|
||||||
* identifier, this string contains the text of that identifier.
|
* string contains the text of that identifier.
|
||||||
*
|
*
|
||||||
* @return the prefix text up to the point of completion
|
* @return the prefix text up to the point of completion
|
||||||
*/
|
*/
|
||||||
|
@ -67,7 +69,6 @@ public class ASTCompletionNode {
|
||||||
return completionToken.getLength();
|
return completionToken.getLength();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a list of names that fit in this context.
|
* Get a list of names that fit in this context.
|
||||||
*
|
*
|
||||||
|
|
|
@ -11,10 +11,10 @@
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This interface represents a structural property in an IASTNode.
|
* This interface represents a structural property in an IASTNode. This is used
|
||||||
* This is used to determine the relationship between a child node and
|
* to determine the relationship between a child node and it's parent. This is
|
||||||
* it's parent. This is especially important with rewrite since we need
|
* especially important with rewrite since we need to understand how to properly
|
||||||
* to understand how to properly replace the child in the source.
|
* replace the child in the source.
|
||||||
*
|
*
|
||||||
* @author Doug Schaefer
|
* @author Doug Schaefer
|
||||||
*/
|
*/
|
||||||
|
@ -23,27 +23,26 @@ public class ASTNodeProperty {
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param n name
|
* @param n
|
||||||
|
* name
|
||||||
*/
|
*/
|
||||||
public ASTNodeProperty(String n) {
|
public ASTNodeProperty(String n) {
|
||||||
this.name = n;
|
this.name = n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Each property has a name to help distinguish it from other
|
* Each property has a name to help distinguish it from other properties of
|
||||||
* properties of a node.
|
* a node.
|
||||||
*
|
*
|
||||||
* @return the name of the property
|
* @return the name of the property
|
||||||
*/
|
*/
|
||||||
public String getName()
|
public String getName() {
|
||||||
{
|
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param name The name to set.
|
* @param name
|
||||||
|
* The name to set.
|
||||||
*/
|
*/
|
||||||
public void setName(String name) {
|
public void setName(String name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
|
|
@ -40,9 +40,13 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPVisitor;
|
||||||
public class ASTUtil {
|
public class ASTUtil {
|
||||||
|
|
||||||
private static final String COMMA_SPACE = ", "; //$NON-NLS-1$
|
private static final String COMMA_SPACE = ", "; //$NON-NLS-1$
|
||||||
|
|
||||||
private static final String EMPTY_STRING = ""; //$NON-NLS-1$
|
private static final String EMPTY_STRING = ""; //$NON-NLS-1$
|
||||||
|
|
||||||
private static final String SPACE = " "; //$NON-NLS-1$
|
private static final String SPACE = " "; //$NON-NLS-1$
|
||||||
|
|
||||||
private static final String[] EMPTY_STRING_ARRAY = new String[0];
|
private static final String[] EMPTY_STRING_ARRAY = new String[0];
|
||||||
|
|
||||||
private static final int DEAULT_ITYPE_SIZE = 2;
|
private static final int DEAULT_ITYPE_SIZE = 2;
|
||||||
|
|
||||||
public static String getParameterTypeString(IFunctionType type) {
|
public static String getParameterTypeString(IFunctionType type) {
|
||||||
|
@ -53,7 +57,8 @@ public class ASTUtil {
|
||||||
for (int i = 0; i < parms.length; i++) {
|
for (int i = 0; i < parms.length; i++) {
|
||||||
if (parms[i] != null) {
|
if (parms[i] != null) {
|
||||||
result.append(parms[i]);
|
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);
|
result.append(Keywords.cpRPAREN);
|
||||||
|
@ -64,7 +69,9 @@ public class ASTUtil {
|
||||||
IType[] parms = null;
|
IType[] parms = null;
|
||||||
try {
|
try {
|
||||||
parms = type.getParameterTypes();
|
parms = type.getParameterTypes();
|
||||||
} catch (DOMException e) { return EMPTY_STRING_ARRAY; }
|
} catch (DOMException e) {
|
||||||
|
return EMPTY_STRING_ARRAY;
|
||||||
|
}
|
||||||
|
|
||||||
String[] result = new String[parms.length];
|
String[] result = new String[parms.length];
|
||||||
|
|
||||||
|
@ -85,24 +92,78 @@ public class ASTUtil {
|
||||||
result.append(Keywords.cpLBRACKET);
|
result.append(Keywords.cpLBRACKET);
|
||||||
if (type instanceof ICArrayType) {
|
if (type instanceof ICArrayType) {
|
||||||
try {
|
try {
|
||||||
if (((ICArrayType)type).isConst()) { result.append(Keywords.CONST); needSpace=true; }
|
if (((ICArrayType) type).isConst()) {
|
||||||
if (((ICArrayType)type).isRestrict()) { if (needSpace) { result.append(SPACE); needSpace=false; } result.append(Keywords.RESTRICT); needSpace=true; }
|
result.append(Keywords.CONST);
|
||||||
if (((ICArrayType)type).isStatic()) { if (needSpace) { result.append(SPACE); needSpace=false; } result.append(Keywords.STATIC); needSpace=true; }
|
needSpace = true;
|
||||||
if (((ICArrayType)type).isVolatile()) { if (needSpace) { result.append(SPACE); needSpace=false; } result.append(Keywords.VOLATILE); }
|
}
|
||||||
} catch (DOMException e) {}
|
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);
|
result.append(Keywords.cpRBRACKET);
|
||||||
} else if (type instanceof IBasicType) {
|
} else if (type instanceof IBasicType) {
|
||||||
try {
|
try {
|
||||||
if (((IBasicType)type).isSigned()) { result.append(Keywords.SIGNED); needSpace = true; }
|
if (((IBasicType) type).isSigned()) {
|
||||||
else if (((IBasicType)type).isUnsigned()) { if (needSpace) { result.append(SPACE); needSpace=false; } result.append(Keywords.UNSIGNED); needSpace=true; }
|
result.append(Keywords.SIGNED);
|
||||||
if (((IBasicType)type).isLong()) { if (needSpace) { result.append(SPACE); needSpace=false; } result.append(Keywords.LONG); needSpace = true; }
|
needSpace = true;
|
||||||
else if (((IBasicType)type).isShort()) { if (needSpace) { result.append(SPACE); needSpace=false; }result.append(Keywords.SHORT); needSpace = true; }
|
} else if (((IBasicType) type).isUnsigned()) {
|
||||||
} catch (DOMException e) {}
|
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) {
|
if (type instanceof IGPPBasicType) {
|
||||||
try {
|
try {
|
||||||
if (((IGPPBasicType)type).isLongLong()) { if (needSpace) { result.append(SPACE); needSpace=false; } result.append(Keywords.LONG_LONG); needSpace=true; }
|
if (((IGPPBasicType) type).isLongLong()) {
|
||||||
|
if (needSpace) {
|
||||||
|
result.append(SPACE);
|
||||||
|
needSpace = false;
|
||||||
|
}
|
||||||
|
result.append(Keywords.LONG_LONG);
|
||||||
|
needSpace = true;
|
||||||
|
}
|
||||||
|
|
||||||
switch (((IGPPBasicType) type).getType()) {
|
switch (((IGPPBasicType) type).getType()) {
|
||||||
case IGPPBasicType.t_Complex:
|
case IGPPBasicType.t_Complex:
|
||||||
|
@ -115,7 +176,8 @@ public class ASTUtil {
|
||||||
result.append(GCCKeywords.TYPEOF);
|
result.append(GCCKeywords.TYPEOF);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} catch (DOMException e) {}
|
} catch (DOMException e) {
|
||||||
|
}
|
||||||
} else if (type instanceof ICPPBasicType) {
|
} else if (type instanceof ICPPBasicType) {
|
||||||
try {
|
try {
|
||||||
switch (((ICPPBasicType) type).getType()) {
|
switch (((ICPPBasicType) type).getType()) {
|
||||||
|
@ -126,7 +188,8 @@ public class ASTUtil {
|
||||||
result.append(Keywords.WCHAR_T);
|
result.append(Keywords.WCHAR_T);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} catch (DOMException e) {}
|
} catch (DOMException e) {
|
||||||
|
}
|
||||||
} else if (type instanceof ICBasicType) {
|
} else if (type instanceof ICBasicType) {
|
||||||
try {
|
try {
|
||||||
switch (((ICBasicType) type).getType()) {
|
switch (((ICBasicType) type).getType()) {
|
||||||
|
@ -140,7 +203,8 @@ public class ASTUtil {
|
||||||
result.append(Keywords.c_IMAGINARY);
|
result.append(Keywords.c_IMAGINARY);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} catch (DOMException e) {}
|
} catch (DOMException e) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -161,7 +225,8 @@ public class ASTUtil {
|
||||||
result.append(Keywords.VOID);
|
result.append(Keywords.VOID);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} catch (DOMException e) {}
|
} catch (DOMException e) {
|
||||||
|
}
|
||||||
|
|
||||||
} else if (type instanceof ICompositeType) {
|
} else if (type instanceof ICompositeType) {
|
||||||
if (type instanceof ICPPClassType) {
|
if (type instanceof ICPPClassType) {
|
||||||
|
@ -171,7 +236,8 @@ public class ASTUtil {
|
||||||
result.append(Keywords.CLASS);
|
result.append(Keywords.CLASS);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} catch (DOMException e) {}
|
} catch (DOMException e) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -183,50 +249,114 @@ public class ASTUtil {
|
||||||
result.append(Keywords.UNION);
|
result.append(Keywords.UNION);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} catch (DOMException e) {}
|
} catch (DOMException e) {
|
||||||
|
}
|
||||||
|
|
||||||
} else if (type instanceof ICPPReferenceType) {
|
} else if (type instanceof ICPPReferenceType) {
|
||||||
result.append(Keywords.cpAMPER);
|
result.append(Keywords.cpAMPER);
|
||||||
} else if (type instanceof ICPPTemplateTypeParameter) {
|
} else if (type instanceof ICPPTemplateTypeParameter) {
|
||||||
try {
|
try {
|
||||||
result.append(getType(((ICPPTemplateTypeParameter)type).getDefault()));
|
result.append(getType(((ICPPTemplateTypeParameter) type)
|
||||||
} catch (DOMException e) {}
|
.getDefault()));
|
||||||
|
} catch (DOMException e) {
|
||||||
|
}
|
||||||
} else if (type instanceof IEnumeration) {
|
} else if (type instanceof IEnumeration) {
|
||||||
result.append(Keywords.ENUM);
|
result.append(Keywords.ENUM);
|
||||||
} else if (type instanceof IFunctionType) {
|
} else if (type instanceof IFunctionType) {
|
||||||
try {
|
try {
|
||||||
String temp = getType(((IFunctionType) type).getReturnType());
|
String temp = getType(((IFunctionType) type).getReturnType());
|
||||||
if (temp != null && !temp.equals(EMPTY_STRING)) { result.append(temp); needSpace=true; }
|
if (temp != null && !temp.equals(EMPTY_STRING)) {
|
||||||
if (needSpace) { result.append(SPACE); needSpace=false; }
|
result.append(temp);
|
||||||
|
needSpace = true;
|
||||||
|
}
|
||||||
|
if (needSpace) {
|
||||||
|
result.append(SPACE);
|
||||||
|
needSpace = false;
|
||||||
|
}
|
||||||
temp = getParameterTypeString((IFunctionType) type);
|
temp = getParameterTypeString((IFunctionType) type);
|
||||||
if (temp != null && !temp.equals(EMPTY_STRING)) { result.append(temp); needSpace=false; }
|
if (temp != null && !temp.equals(EMPTY_STRING)) {
|
||||||
} catch (DOMException e) {}
|
result.append(temp);
|
||||||
|
needSpace = false;
|
||||||
|
}
|
||||||
|
} catch (DOMException e) {
|
||||||
|
}
|
||||||
} else if (type instanceof IPointerType) {
|
} else if (type instanceof IPointerType) {
|
||||||
result.append(Keywords.cpSTAR); needSpace=true;
|
result.append(Keywords.cpSTAR);
|
||||||
|
needSpace = true;
|
||||||
|
|
||||||
if (type instanceof IGPPPointerType) {
|
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) {
|
} 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 {
|
try {
|
||||||
if (((IPointerType)type).isConst()) { if (needSpace) { result.append(SPACE); needSpace=false; } result.append(Keywords.CONST); needSpace=true; }
|
if (((IPointerType) type).isConst()) {
|
||||||
if (((IPointerType)type).isVolatile()) { if (needSpace) { result.append(SPACE); needSpace=false; } result.append(Keywords.VOLATILE); needSpace=true; }
|
if (needSpace) {
|
||||||
} catch (DOMException e) {}
|
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) {
|
} else if (type instanceof IQualifierType) {
|
||||||
|
|
||||||
if (type instanceof ICQualifierType) {
|
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) {
|
} 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 {
|
try {
|
||||||
if (((IQualifierType)type).isConst()) { if (needSpace) { result.append(SPACE); needSpace=false; } result.append(Keywords.CONST); needSpace=true; }
|
if (((IQualifierType) type).isConst()) {
|
||||||
if (((IQualifierType)type).isVolatile()) { if (needSpace) { result.append(SPACE); needSpace=false; } result.append(Keywords.VOLATILE); needSpace=true; }
|
if (needSpace) {
|
||||||
} catch (DOMException e) {}
|
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) {
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -243,19 +373,22 @@ public class ASTUtil {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
type = ((ITypeContainer) type).getType();
|
type = ((ITypeContainer) type).getType();
|
||||||
} catch (DOMException e) {}
|
} catch (DOMException e) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type != null && !(type instanceof ITypeContainer)) {
|
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
|
// 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--) {
|
for (int j = types.length - 1; j >= 0; j--) {
|
||||||
if (types[j] != null)
|
if (types[j] != null)
|
||||||
result.append(getTypeString(types[j]));
|
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();
|
return result.toString();
|
||||||
|
@ -295,8 +428,8 @@ public class ASTUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return's the String representation of a node's type (if available). This is
|
* Return's the String representation of a node's type (if available). This
|
||||||
* currently only being used for testing.
|
* is currently only being used for testing.
|
||||||
*
|
*
|
||||||
* TODO Remove this function when done testing if it is no longer needed
|
* TODO Remove this function when done testing if it is no longer needed
|
||||||
*
|
*
|
||||||
|
@ -307,15 +440,22 @@ public class ASTUtil {
|
||||||
try {
|
try {
|
||||||
if (node instanceof IASTDeclarator)
|
if (node instanceof IASTDeclarator)
|
||||||
return getDeclaratorType((IASTDeclarator) node);
|
return getDeclaratorType((IASTDeclarator) node);
|
||||||
if (node instanceof IASTName && ((IASTName)node).resolveBinding() instanceof IVariable)
|
if (node instanceof IASTName
|
||||||
return getType(((IVariable)((IASTName)node).resolveBinding()).getType());
|
&& ((IASTName) node).resolveBinding() instanceof IVariable)
|
||||||
if (node instanceof IASTName && ((IASTName)node).resolveBinding() instanceof IFunction)
|
return getType(((IVariable) ((IASTName) node).resolveBinding())
|
||||||
return getType(((IFunction)((IASTName)node).resolveBinding()).getType());
|
.getType());
|
||||||
if (node instanceof IASTName && ((IASTName)node).resolveBinding() instanceof IType)
|
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 getType((IType) ((IASTName) node).resolveBinding());
|
||||||
if (node instanceof IASTTypeId)
|
if (node instanceof IASTTypeId)
|
||||||
return getType((IASTTypeId) node);
|
return getType((IASTTypeId) node);
|
||||||
} catch (DOMException e) { return EMPTY_STRING; }
|
} catch (DOMException e) {
|
||||||
|
return EMPTY_STRING;
|
||||||
|
}
|
||||||
|
|
||||||
return EMPTY_STRING;
|
return EMPTY_STRING;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,29 +16,41 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTEnumerationSpecifier.IASTEnumerator;
|
import org.eclipse.cdt.core.dom.ast.IASTEnumerationSpecifier.IASTEnumerator;
|
||||||
|
|
||||||
|
|
||||||
public abstract class ASTVisitor {
|
public abstract class ASTVisitor {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* These values should be overriden in the implementation subclass.
|
* These values should be overriden in the implementation subclass.
|
||||||
*/
|
*/
|
||||||
public boolean shouldVisitNames = false;
|
public boolean shouldVisitNames = false;
|
||||||
|
|
||||||
public boolean shouldVisitDeclarations = false;
|
public boolean shouldVisitDeclarations = false;
|
||||||
|
|
||||||
public boolean shouldVisitInitializers = false;
|
public boolean shouldVisitInitializers = false;
|
||||||
|
|
||||||
public boolean shouldVisitParameterDeclarations = false;
|
public boolean shouldVisitParameterDeclarations = false;
|
||||||
|
|
||||||
public boolean shouldVisitDeclarators = false;
|
public boolean shouldVisitDeclarators = false;
|
||||||
|
|
||||||
public boolean shouldVisitDeclSpecifiers = false;
|
public boolean shouldVisitDeclSpecifiers = false;
|
||||||
|
|
||||||
public boolean shouldVisitExpressions = false;
|
public boolean shouldVisitExpressions = false;
|
||||||
|
|
||||||
public boolean shouldVisitStatements = false;
|
public boolean shouldVisitStatements = false;
|
||||||
|
|
||||||
public boolean shouldVisitTypeIds = false;
|
public boolean shouldVisitTypeIds = false;
|
||||||
|
|
||||||
public boolean shouldVisitEnumerators = false;
|
public boolean shouldVisitEnumerators = false;
|
||||||
|
|
||||||
public boolean shouldVisitTranslationUnit = 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_SKIP = 1;
|
||||||
|
|
||||||
public final static int PROCESS_ABORT = 2;
|
public final static int PROCESS_ABORT = 2;
|
||||||
|
|
||||||
public final static int PROCESS_CONTINUE = 3;
|
public final static int PROCESS_CONTINUE = 3;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -46,15 +58,47 @@ public abstract class ASTVisitor {
|
||||||
* visit methods
|
* visit methods
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public int visit( IASTTranslationUnit tu ) { return PROCESS_CONTINUE; }
|
public int visit(IASTTranslationUnit tu) {
|
||||||
public int visit( IASTName name ) { return PROCESS_CONTINUE; }
|
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(IASTName name) {
|
||||||
public int visit( IASTDeclarator declarator ) { return PROCESS_CONTINUE; }
|
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(IASTDeclaration declaration) {
|
||||||
public int visit( IASTTypeId typeId ) { return PROCESS_CONTINUE; }
|
return PROCESS_CONTINUE;
|
||||||
public int visit( IASTEnumerator enumerator ) { 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;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -25,9 +25,9 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPSemantics;
|
||||||
public class DOMException extends Exception {
|
public class DOMException extends Exception {
|
||||||
IProblemBinding problemBinding;
|
IProblemBinding problemBinding;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param problem binding for throwing
|
* @param problem
|
||||||
|
* binding for throwing
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public DOMException(IProblemBinding problem) {
|
public DOMException(IProblemBinding problem) {
|
||||||
|
@ -43,8 +43,4 @@ public class DOMException extends Exception {
|
||||||
public IProblemBinding getProblem() {
|
public IProblemBinding getProblem() {
|
||||||
return problemBinding;
|
return problemBinding;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMessage() {
|
|
||||||
return problemBinding.getMessage();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
* IBM Rational Software - Initial API and implementation */
|
* IBM Rational Software - Initial API and implementation */
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ASM Statement as a Declaration.
|
* ASM Statement as a Declaration.
|
||||||
*
|
*
|
||||||
|
@ -19,11 +18,14 @@ public interface IASTASMDeclaration extends IASTDeclaration {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the assembly value.
|
* Get the assembly value.
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String getAssembly();
|
public String getAssembly();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the assembly value.
|
* Set the assembly value.
|
||||||
|
*
|
||||||
* @param assembly
|
* @param assembly
|
||||||
*/
|
*/
|
||||||
public void setAssembly(String assembly);
|
public void setAssembly(String assembly);
|
||||||
|
|
|
@ -18,9 +18,11 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
public interface IASTArrayDeclarator extends IASTDeclarator {
|
public interface IASTArrayDeclarator extends IASTDeclarator {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Node property that describes the relationship between an <code>IASTArrayDeclarator</code> and an <code>IASTArrayModifier</code>.
|
* 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$
|
public static final ASTNodeProperty ARRAY_MODIFIER = new ASTNodeProperty(
|
||||||
|
"Array Modifier"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all <code>IASTArrayModifier</code>'s for this declarator.
|
* Get all <code>IASTArrayModifier</code>'s for this declarator.
|
||||||
|
@ -31,7 +33,9 @@ public interface IASTArrayDeclarator extends IASTDeclarator {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add an <code>IASTArrayModifier</code> to this declarator
|
* 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);
|
||||||
|
|
||||||
|
|
|
@ -10,31 +10,37 @@
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the portion of the node that represents the portions when someone declares a
|
* This is the portion of the node that represents the portions when someone
|
||||||
* variable/type which is an array.
|
* declares a variable/type which is an array.
|
||||||
*
|
*
|
||||||
* @author jcamelon
|
* @author jcamelon
|
||||||
*/
|
*/
|
||||||
public interface IASTArrayModifier extends IASTNode {
|
public interface IASTArrayModifier extends IASTNode {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Node property that describes the relationship between an <code>IASTArrayModifier</code> and an <code>IASTExpression</code>.
|
* 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$
|
public static final ASTNodeProperty CONSTANT_EXPRESSION = new ASTNodeProperty(
|
||||||
|
"Constant Expression"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>EMPTY_ARRAY</code> is referred to in implementations
|
* <code>EMPTY_ARRAY</code> is referred to in implementations
|
||||||
*/
|
*/
|
||||||
public static final IASTArrayModifier[] EMPTY_ARRAY = new IASTArrayModifier[0];
|
public static final IASTArrayModifier[] EMPTY_ARRAY = new IASTArrayModifier[0];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the constant expression that represents the size of the array.
|
* Get the constant expression that represents the size of the array.
|
||||||
*
|
*
|
||||||
* @return <code>IASTExpression</code>
|
* @return <code>IASTExpression</code>
|
||||||
*/
|
*/
|
||||||
public IASTExpression getConstantExpression();
|
public IASTExpression getConstantExpression();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the constant expression that represents the size of the array.
|
* Set the constant expression that represents the size of the array.
|
||||||
*
|
*
|
||||||
* @param expression <code>IASTExpression</code>
|
* @param expression
|
||||||
|
* <code>IASTExpression</code>
|
||||||
*/
|
*/
|
||||||
public void setConstantExpression(IASTExpression expression);
|
public void setConstantExpression(IASTExpression expression);
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,7 @@
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This interface represents a postfix array subscript expression.
|
* This interface represents a postfix array subscript expression. x[ 10 ]
|
||||||
* x[ 10 ]
|
|
||||||
* y.z()[ t * t ]
|
* y.z()[ t * t ]
|
||||||
*
|
*
|
||||||
* @author jcamelon
|
* @author jcamelon
|
||||||
|
@ -19,31 +18,47 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
public interface IASTArraySubscriptExpression extends IASTExpression {
|
public interface IASTArraySubscriptExpression extends IASTExpression {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Node property that describes the relationship between an <code>IASTArraySubscriptExpression</code> and an <code>IASTExpression</code> representing the subscript.
|
* 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$
|
public static final ASTNodeProperty ARRAY = new ASTNodeProperty("Array"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the expression that represents the array.
|
* Get the expression that represents the array.
|
||||||
|
*
|
||||||
* @return <code>IASTExpression</code> that represents the array.
|
* @return <code>IASTExpression</code> that represents the array.
|
||||||
*/
|
*/
|
||||||
public IASTExpression getArrayExpression();
|
public IASTExpression getArrayExpression();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the expression that represents the array.
|
* Set the expression that represents the array.
|
||||||
* @param expression <code>IASTExpression</code> to be set.
|
*
|
||||||
|
* @param expression
|
||||||
|
* <code>IASTExpression</code> to be set.
|
||||||
*/
|
*/
|
||||||
public void setArrayExpression(IASTExpression expression);
|
public void setArrayExpression(IASTExpression expression);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Node property that describes the relationship between an <code>IASTArraySubscriptExpression</code> and an <code>IASTExpression</code> representing the array.
|
* 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$
|
public static final ASTNodeProperty SUBSCRIPT = new ASTNodeProperty(
|
||||||
|
"Subscript"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the subscript expression.
|
* Get the subscript expression.
|
||||||
|
*
|
||||||
* @return <code>IASTExpression</code> that represents the subscript.
|
* @return <code>IASTExpression</code> that represents the subscript.
|
||||||
*/
|
*/
|
||||||
public IASTExpression getSubscriptExpression();
|
public IASTExpression getSubscriptExpression();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the subscript expression.
|
* Set the subscript expression.
|
||||||
* @param expression <code>IASTExpression</code> to be set.
|
*
|
||||||
|
* @param expression
|
||||||
|
* <code>IASTExpression</code> to be set.
|
||||||
*/
|
*/
|
||||||
public void setSubscriptExpression(IASTExpression expression);
|
public void setSubscriptExpression(IASTExpression expression);
|
||||||
|
|
||||||
|
|
|
@ -18,30 +18,41 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
public interface IASTBinaryExpression extends IASTExpression {
|
public interface IASTBinaryExpression extends IASTExpression {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Node property that describes the relationship between an <code>IASTBinaryExpression</code> and an <code>IASTExpression</code> representing the lhs.
|
* 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$
|
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.
|
* 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$
|
public static final ASTNodeProperty OPERAND_TWO = new ASTNodeProperty(
|
||||||
|
"Operand 2"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the operator.
|
* Set the operator.
|
||||||
* @param op Value to set.
|
*
|
||||||
|
* @param op
|
||||||
|
* Value to set.
|
||||||
*/
|
*/
|
||||||
public void setOperator(int op);
|
public void setOperator(int op);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the operator.
|
* Get the operator.
|
||||||
|
*
|
||||||
* @return int value as operator
|
* @return int value as operator
|
||||||
*/
|
*/
|
||||||
public int getOperator();
|
public int getOperator();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* multiply *
|
* multiply *
|
||||||
*/
|
*/
|
||||||
public static final int op_multiply = 1;
|
public static final int op_multiply = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* divide /
|
* divide /
|
||||||
*/
|
*/
|
||||||
|
@ -193,21 +204,26 @@ public interface IASTBinaryExpression extends IASTExpression {
|
||||||
* @return <code>IASTExpression</code> representing operand 1.
|
* @return <code>IASTExpression</code> representing operand 1.
|
||||||
*/
|
*/
|
||||||
public IASTExpression getOperand1();
|
public IASTExpression getOperand1();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the first operand.
|
* 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.
|
* Get the second operand.
|
||||||
*
|
*
|
||||||
* @return <code>IASTExpression</code> representing operand 2.
|
* @return <code>IASTExpression</code> representing operand 2.
|
||||||
*/
|
*/
|
||||||
public IASTExpression getOperand2();
|
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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,29 +11,32 @@
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a case in a switch statement. Note that in the grammar,
|
* This is a case in a switch statement. Note that in the grammar, a statement
|
||||||
* a statement is part of the clause. For the AST, just go on to the
|
* is part of the clause. For the AST, just go on to the next statement to find
|
||||||
* next statement to find it. It's really only there to ensure that there
|
* it. It's really only there to ensure that there is at least one statement
|
||||||
* is at least one statement following this clause.
|
* following this clause.
|
||||||
*
|
*
|
||||||
* @author Doug Schaefer
|
* @author Doug Schaefer
|
||||||
*/
|
*/
|
||||||
public interface IASTCaseStatement extends IASTStatement {
|
public interface IASTCaseStatement extends IASTStatement {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>ASTNodeProperty</code> that represents the relationship between a case statement and the expression it contains.
|
* <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$
|
public static final ASTNodeProperty EXPRESSION = new ASTNodeProperty(
|
||||||
|
"expression"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The expression that determines whether this case should be
|
* The expression that determines whether this case should be taken.
|
||||||
* taken.
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public IASTExpression getExpression();
|
public IASTExpression getExpression();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the expression.
|
* Set the expression.
|
||||||
|
*
|
||||||
* @param expression
|
* @param expression
|
||||||
*/
|
*/
|
||||||
public void setExpression(IASTExpression expression);
|
public void setExpression(IASTExpression expression);
|
||||||
|
|
|
@ -20,6 +20,7 @@ public interface IASTCastExpression extends IASTExpression {
|
||||||
* <code>op_cast</code> represents a traditional cast.
|
* <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
|
* <code>op_last</code> for subinterfaces
|
||||||
*/
|
*/
|
||||||
|
@ -40,33 +41,43 @@ public interface IASTCastExpression extends IASTExpression {
|
||||||
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.
|
* Get expression being cast.
|
||||||
|
*
|
||||||
* @return <code>IASTExpression</code> the expression being cast
|
* @return <code>IASTExpression</code> the expression being cast
|
||||||
*/
|
*/
|
||||||
public IASTExpression getOperand();
|
public IASTExpression getOperand();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the expression being cast.
|
* 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.
|
* <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$
|
public static final ASTNodeProperty TYPE_ID = new ASTNodeProperty("Type Id"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the typeId.
|
* Set the typeId.
|
||||||
* @param typeId <code>IASTTypeId</code> to be set.
|
*
|
||||||
|
* @param typeId
|
||||||
|
* <code>IASTTypeId</code> to be set.
|
||||||
*/
|
*/
|
||||||
public void setTypeId(IASTTypeId typeId);
|
public void setTypeId(IASTTypeId typeId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the typeId.
|
* Get the typeId.
|
||||||
|
*
|
||||||
* @return <code>IASTTypeId</code> representing type being casted to.
|
* @return <code>IASTTypeId</code> representing type being casted to.
|
||||||
*/
|
*/
|
||||||
public IASTTypeId getTypeId();
|
public IASTTypeId getTypeId();
|
||||||
|
|
|
@ -10,23 +10,27 @@
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
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
|
* @author Doug Schaefer
|
||||||
*/
|
*/
|
||||||
public interface IASTCompositeTypeSpecifier extends IASTDeclSpecifier {
|
public interface IASTCompositeTypeSpecifier extends IASTDeclSpecifier {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>TYPE_NAME</code> represents the relationship between an <code>IASTCompositeTypeSpecifier</code> and its <code>IASTName</code>.
|
* <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$
|
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.
|
* <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$
|
public static final ASTNodeProperty MEMBER_DECLARATION = new ASTNodeProperty(
|
||||||
|
"Member Declaration"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the type (key) of this composite specifier.
|
* Get the type (key) of this composite specifier.
|
||||||
|
@ -35,21 +39,22 @@ public interface IASTCompositeTypeSpecifier extends IASTDeclSpecifier {
|
||||||
*/
|
*/
|
||||||
public int getKey();
|
public int getKey();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>k_struct</code> represents 'struct' in C & C++
|
* <code>k_struct</code> represents 'struct' in C & C++
|
||||||
*/
|
*/
|
||||||
public static final int k_struct = 1;
|
public static final int k_struct = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>k_union</code> represents 'union' in C & C++
|
* <code>k_union</code> represents 'union' in C & C++
|
||||||
*/
|
*/
|
||||||
public static final int k_union = 2;
|
public static final int k_union = 2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>k_last</code> allows for subinterfaces to continue enumerating keys
|
* <code>k_last</code> allows for subinterfaces to continue enumerating
|
||||||
|
* keys
|
||||||
*/
|
*/
|
||||||
public static final int k_last = k_union;
|
public static final int k_last = k_union;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the type (key) of this composite specifier.
|
* Set the type (key) of this composite specifier.
|
||||||
*
|
*
|
||||||
|
@ -58,8 +63,8 @@ public interface IASTCompositeTypeSpecifier extends IASTDeclSpecifier {
|
||||||
public void setKey(int key);
|
public void setKey(int key);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the name for this composite type. If this is an anonymous
|
* Return the name for this composite type. If this is an anonymous type,
|
||||||
* type, this will return an empty name.
|
* this will return an empty name.
|
||||||
*
|
*
|
||||||
* @return the name of the type
|
* @return the name of the type
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This represents a block of statements.
|
* This represents a block of statements.
|
||||||
*
|
*
|
||||||
|
@ -19,9 +18,12 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
public interface IASTCompoundStatement extends IASTStatement {
|
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.
|
* Gets the statements in this block.
|
||||||
|
@ -33,12 +35,14 @@ public interface IASTCompoundStatement extends IASTStatement {
|
||||||
/**
|
/**
|
||||||
* Add a statement to the compound block.
|
* 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>
|
* @return the <code>IScope</code>
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -17,17 +17,28 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
public interface IASTConditionalExpression extends IASTExpression {
|
public interface IASTConditionalExpression extends IASTExpression {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>LOGICAL_CONDITION</code> represents the relationship between an <code>IASTConditionalExpression</code> and its condition <code>IASTExpression</code>.
|
* <code>LOGICAL_CONDITION</code> represents the relationship between an
|
||||||
|
* <code>IASTConditionalExpression</code> and its condition
|
||||||
|
* <code>IASTExpression</code>.
|
||||||
*/
|
*/
|
||||||
public static final ASTNodeProperty LOGICAL_CONDITION = new ASTNodeProperty( "Logical Condition"); //$NON-NLS-1$
|
public static final ASTNodeProperty LOGICAL_CONDITION = new ASTNodeProperty(
|
||||||
|
"Logical Condition"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>POSITIVE_RESULT</code> represents the relationship between an <code>IASTConditionalExpression</code> and its positive result <code>IASTExpression</code>.
|
* <code>POSITIVE_RESULT</code> represents the relationship between an
|
||||||
|
* <code>IASTConditionalExpression</code> and its positive result
|
||||||
|
* <code>IASTExpression</code>.
|
||||||
*/
|
*/
|
||||||
public static final ASTNodeProperty POSITIVE_RESULT = new ASTNodeProperty( "Positive Result" ); //$NON-NLS-1$
|
public static final ASTNodeProperty POSITIVE_RESULT = new ASTNodeProperty(
|
||||||
|
"Positive Result"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>NEGATIVE_RESULT</code> represents the relationship between an <code>IASTConditionalExpression</code> and its positive result <code>IASTExpression</code>.
|
* <code>NEGATIVE_RESULT</code> represents the relationship between an
|
||||||
|
* <code>IASTConditionalExpression</code> and its positive result
|
||||||
|
* <code>IASTExpression</code>.
|
||||||
*/
|
*/
|
||||||
public static final ASTNodeProperty NEGATIVE_RESULT = new ASTNodeProperty( "Negative Result" ); //$NON-NLS-1$
|
public static final ASTNodeProperty NEGATIVE_RESULT = new ASTNodeProperty(
|
||||||
|
"Negative Result"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the logical condition expression.
|
* Get the logical condition expression.
|
||||||
|
@ -36,10 +47,12 @@ public interface IASTConditionalExpression extends IASTExpression {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public IASTExpression getLogicalConditionExpression();
|
public IASTExpression getLogicalConditionExpression();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the logical condition expression.
|
* Set the logical condition expression.
|
||||||
*
|
*
|
||||||
* @param expression condition to be set
|
* @param expression
|
||||||
|
* condition to be set
|
||||||
*/
|
*/
|
||||||
public void setLogicalConditionExpression(IASTExpression expression);
|
public void setLogicalConditionExpression(IASTExpression expression);
|
||||||
|
|
||||||
|
@ -49,6 +62,7 @@ public interface IASTConditionalExpression extends IASTExpression {
|
||||||
* @return <code>IASTExpression</code>
|
* @return <code>IASTExpression</code>
|
||||||
*/
|
*/
|
||||||
public IASTExpression getPositiveResultExpression();
|
public IASTExpression getPositiveResultExpression();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set positive result expression.
|
* Set positive result expression.
|
||||||
*
|
*
|
||||||
|
@ -58,6 +72,7 @@ public interface IASTConditionalExpression extends IASTExpression {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the negative result expression.
|
* Get the negative result expression.
|
||||||
|
*
|
||||||
* @return <code>IASTExpression</code>
|
* @return <code>IASTExpression</code>
|
||||||
*/
|
*/
|
||||||
public IASTExpression getNegativeResultExpression();
|
public IASTExpression getNegativeResultExpression();
|
||||||
|
@ -65,7 +80,8 @@ public interface IASTConditionalExpression extends IASTExpression {
|
||||||
/**
|
/**
|
||||||
* Set negative result expression.
|
* Set negative result expression.
|
||||||
*
|
*
|
||||||
* @param expression <code>IASTExpression</code>
|
* @param expression
|
||||||
|
* <code>IASTExpression</code>
|
||||||
*/
|
*/
|
||||||
public void setNegativeResultExpression(IASTExpression expression);
|
public void setNegativeResultExpression(IASTExpression expression);
|
||||||
|
|
||||||
|
|
|
@ -21,20 +21,24 @@ public interface IASTDeclSpecifier extends IASTNode {
|
||||||
* <code>sc_unspecified</code> undefined storage class
|
* <code>sc_unspecified</code> undefined storage class
|
||||||
*/
|
*/
|
||||||
public static final int sc_unspecified = 0;
|
public static final int sc_unspecified = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>sc_typedef</code> typedef
|
* <code>sc_typedef</code> typedef
|
||||||
*/
|
*/
|
||||||
public static final int sc_typedef = 1;
|
public static final int sc_typedef = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>sc_extern</code>extern
|
* <code>sc_extern</code>extern
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public static final int sc_extern = 2;
|
public static final int sc_extern = 2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>sc_static</code>static
|
* <code>sc_static</code>static
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public static final int sc_static = 3;
|
public static final int sc_static = 3;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>sc_auto</code>auto
|
* <code>sc_auto</code>auto
|
||||||
*/
|
*/
|
||||||
|
@ -53,11 +57,15 @@ public interface IASTDeclSpecifier extends IASTNode {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the storage class.
|
* Set the storage class.
|
||||||
* @param storageClass int
|
*
|
||||||
|
* @param storageClass
|
||||||
|
* int
|
||||||
*/
|
*/
|
||||||
public void setStorageClass(int storageClass);
|
public void setStorageClass(int storageClass);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the storage class.
|
* Get the storage class.
|
||||||
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public int getStorageClass();
|
public int getStorageClass();
|
||||||
|
@ -65,40 +73,54 @@ public interface IASTDeclSpecifier extends IASTNode {
|
||||||
// Type qualifier
|
// Type qualifier
|
||||||
/**
|
/**
|
||||||
* Is const modifier used?
|
* Is const modifier used?
|
||||||
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public boolean isConst();
|
public boolean isConst();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set const modifier used.
|
* Set const modifier used.
|
||||||
* @param value boolean
|
*
|
||||||
|
* @param value
|
||||||
|
* boolean
|
||||||
*/
|
*/
|
||||||
public void setConst(boolean value);
|
public void setConst(boolean value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Is volatile modifier used?
|
* Is volatile modifier used?
|
||||||
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public boolean isVolatile();
|
public boolean isVolatile();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set volatile modifier used.
|
* Set volatile modifier used.
|
||||||
* @param value boolean
|
*
|
||||||
|
* @param value
|
||||||
|
* boolean
|
||||||
*/
|
*/
|
||||||
public void setVolatile(boolean value);
|
public void setVolatile(boolean value);
|
||||||
|
|
||||||
// Function specifier
|
// Function specifier
|
||||||
/**
|
/**
|
||||||
* Is inline modifier used?
|
* Is inline modifier used?
|
||||||
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public boolean isInline();
|
public boolean isInline();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set inline modifier used.
|
* Set inline modifier used.
|
||||||
* @param value boolean
|
*
|
||||||
|
* @param value
|
||||||
|
* boolean
|
||||||
*/
|
*/
|
||||||
public void setInline(boolean value);
|
public void setInline(boolean value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the string that represents the decl specifier seq. as represented in the file pre-processing.
|
* Get the string that represents the decl specifier seq. as represented in
|
||||||
|
* the file pre-processing.
|
||||||
|
*
|
||||||
* @return String
|
* @return String
|
||||||
*/
|
*/
|
||||||
public String getUnpreprocessedSignature();
|
public String getUnpreprocessedSignature();
|
||||||
|
|
|
@ -18,9 +18,11 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
public interface IASTDeclarationStatement extends IASTStatement {
|
public interface IASTDeclarationStatement extends IASTStatement {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>DECLARATION</code> represents the relationship between a declaration statement and the declaration it wraps.
|
* <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.
|
* Gets the declaration introduced by this statement.
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base interface for a declarator.
|
* Base interface for a declarator.
|
||||||
*
|
*
|
||||||
|
@ -24,25 +23,36 @@ public interface IASTDeclarator extends IASTNode {
|
||||||
public static final IASTDeclarator[] EMPTY_DECLARATOR_ARRAY = new IASTDeclarator[0];
|
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$
|
public static final ASTNodeProperty POINTER_OPERATOR = new ASTNodeProperty(
|
||||||
/**
|
"Pointer Operator"); //$NON-NLS-1$
|
||||||
* <code>INITIALIZER</code> represents the relationship between an <code>IASTDeclarator</code> and an <code>IASTInitializer</code>.
|
|
||||||
*/
|
|
||||||
public static final ASTNodeProperty INITIALIZER = new ASTNodeProperty( "Initializer"); //$NON-NLS-1$
|
|
||||||
/**
|
|
||||||
* <code>NESTED_DECLARATOR</code> represents the relationship between an <code>IASTDeclarator</code> and a nested <code>IASTDeclarator</code>.
|
|
||||||
*/
|
|
||||||
public static final ASTNodeProperty NESTED_DECLARATOR = new ASTNodeProperty( "Nested Declarator"); //$NON-NLS-1$
|
|
||||||
/**
|
|
||||||
* <code>DECLARATOR_NAME</code> represents the relationship between an <code>IASTDeclarator</code> and an <code>IASTName</code>.
|
|
||||||
*/
|
|
||||||
public static final ASTNodeProperty DECLARATOR_NAME = new ASTNodeProperty( "Declarator Name"); //$NON-NLS-1$
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the list of pointer operators applied to the type for
|
* <code>INITIALIZER</code> represents the relationship between an
|
||||||
* the declarator.
|
* <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
|
* @return array of IASTPointerOperator
|
||||||
*/
|
*/
|
||||||
|
@ -51,13 +61,14 @@ public interface IASTDeclarator extends IASTNode {
|
||||||
/**
|
/**
|
||||||
* Adds a pointer operator to the declarator.
|
* 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
|
* If the declarator is nested in parenthesis, this returns the declarator
|
||||||
* declarator as found in those parenethesis.
|
* as found in those parenethesis.
|
||||||
*
|
*
|
||||||
* @return the nested declarator or null
|
* @return the nested declarator or null
|
||||||
*/
|
*/
|
||||||
|
@ -76,7 +87,8 @@ public interface IASTDeclarator extends IASTNode {
|
||||||
/**
|
/**
|
||||||
* Set the name of he declarator.
|
* 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);
|
||||||
|
|
||||||
|
@ -90,7 +102,8 @@ public interface IASTDeclarator extends IASTNode {
|
||||||
/**
|
/**
|
||||||
* Set the optional initializer.
|
* Set the optional initializer.
|
||||||
*
|
*
|
||||||
* @param initializer <code>IASTInitializer</code>
|
* @param initializer
|
||||||
|
* <code>IASTInitializer</code>
|
||||||
*/
|
*/
|
||||||
public void setInitializer(IASTInitializer initializer);
|
public void setInitializer(IASTInitializer initializer);
|
||||||
|
|
||||||
|
|
|
@ -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,
|
* 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
|
* a statement is part of the clause. For the AST, just go on to the next
|
||||||
* next statement to find it. It's really only there to ensure that there
|
* statement to find it. It's really only there to ensure that there is at least
|
||||||
* is at least one statement following this clause.
|
* one statement following this clause.
|
||||||
*
|
*
|
||||||
* @author Doug Schaefer
|
* @author Doug Schaefer
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -18,13 +18,19 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
public interface IASTDoStatement extends IASTStatement {
|
public interface IASTDoStatement extends IASTStatement {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>BODY</code> represents the relationship between a <code>IASTDoStatement</code> and its nested body <code>IASTStatement</code>.
|
* <code>BODY</code> represents the relationship between a
|
||||||
|
* <code>IASTDoStatement</code> and its nested body
|
||||||
|
* <code>IASTStatement</code>.
|
||||||
*/
|
*/
|
||||||
public static final ASTNodeProperty BODY = new ASTNodeProperty("body"); //$NON-NLS-1$
|
public static final ASTNodeProperty BODY = new ASTNodeProperty("body"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>CONDITION</code> represents the relationship between a <code>IASTDoStatement</code> and its condition <code>IASTExpression</code>.
|
* <code>CONDITION</code> represents the relationship between a
|
||||||
|
* <code>IASTDoStatement</code> and its condition
|
||||||
|
* <code>IASTExpression</code>.
|
||||||
*/
|
*/
|
||||||
public static final ASTNodeProperty CONDITION = new ASTNodeProperty("condition"); //$NON-NLS-1$
|
public static final ASTNodeProperty CONDITION = new ASTNodeProperty(
|
||||||
|
"condition"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the body of the loop.
|
* Get the body of the loop.
|
||||||
|
@ -35,7 +41,9 @@ public interface IASTDoStatement extends IASTStatement {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the body of the loop.
|
* Set the body of the loop.
|
||||||
* @param body an <code>IASTStatement</code>
|
*
|
||||||
|
* @param body
|
||||||
|
* an <code>IASTStatement</code>
|
||||||
*/
|
*/
|
||||||
public void setBody(IASTStatement body);
|
public void setBody(IASTStatement body);
|
||||||
|
|
||||||
|
@ -48,7 +56,9 @@ public interface IASTDoStatement extends IASTStatement {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the condition for the loop.
|
* Set the condition for the loop.
|
||||||
* @param condition an IASTExpression
|
*
|
||||||
|
* @param condition
|
||||||
|
* an IASTExpression
|
||||||
*/
|
*/
|
||||||
public void setCondition(IASTExpression condition);
|
public void setCondition(IASTExpression condition);
|
||||||
|
|
||||||
|
|
|
@ -16,19 +16,21 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
*/
|
*/
|
||||||
public interface IASTElaboratedTypeSpecifier extends IASTDeclSpecifier {
|
public interface IASTElaboratedTypeSpecifier extends IASTDeclSpecifier {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enumeration.
|
* Enumeration.
|
||||||
*/
|
*/
|
||||||
public static final int k_enum = 0;
|
public static final int k_enum = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Structure.
|
* Structure.
|
||||||
*/
|
*/
|
||||||
public static final int k_struct = 1;
|
public static final int k_struct = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Union.
|
* Union.
|
||||||
*/
|
*/
|
||||||
public static final int k_union = 2;
|
public static final int k_union = 2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constant for extensibility in sub-interfaces.
|
* Constant for extensibility in sub-interfaces.
|
||||||
*/
|
*/
|
||||||
|
@ -40,26 +42,34 @@ public interface IASTElaboratedTypeSpecifier extends IASTDeclSpecifier {
|
||||||
* @return int (kind).
|
* @return int (kind).
|
||||||
*/
|
*/
|
||||||
public int getKind();
|
public int getKind();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the kind.
|
* Set the kind.
|
||||||
* @param value int (kind)
|
*
|
||||||
|
* @param value
|
||||||
|
* int (kind)
|
||||||
*/
|
*/
|
||||||
public void setKind(int value);
|
public void setKind(int value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>TYPE_NAME</code> describes the relationship between <code>IASTElaboratedTypeSpecifier</code> and <code>IASTName</code>.
|
* <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$
|
public static final ASTNodeProperty TYPE_NAME = new ASTNodeProperty(
|
||||||
|
"Type Name"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the name.
|
* Get the name.
|
||||||
*
|
*
|
||||||
* @return <code>IASTName</code>
|
* @return <code>IASTName</code>
|
||||||
*/
|
*/
|
||||||
public IASTName getName();
|
public IASTName getName();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the name.
|
* Set the name.
|
||||||
*
|
*
|
||||||
* @param name <code>IASTName</code>
|
* @param name
|
||||||
|
* <code>IASTName</code>
|
||||||
*/
|
*/
|
||||||
public void setName(IASTName name);
|
public void setName(IASTName name);
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
* IBM Rational Software - Initial API and implementation */
|
* IBM Rational Software - Initial API and implementation */
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This interface represents enumerations in C and C++.
|
* This interface represents enumerations in C and C++.
|
||||||
*
|
*
|
||||||
|
@ -19,6 +18,7 @@ public interface IASTEnumerationSpecifier extends IASTDeclSpecifier {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This interface represents an enumerator member of an enum specifier.
|
* This interface represents an enumerator member of an enum specifier.
|
||||||
|
*
|
||||||
* @author jcamelon
|
* @author jcamelon
|
||||||
*/
|
*/
|
||||||
public interface IASTEnumerator extends IASTNode {
|
public interface IASTEnumerator extends IASTNode {
|
||||||
|
@ -28,15 +28,19 @@ public interface IASTEnumerationSpecifier extends IASTDeclSpecifier {
|
||||||
public static final IASTEnumerator[] EMPTY_ENUMERATOR_ARRAY = new IASTEnumerator[0];
|
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>.
|
* <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$
|
public static final ASTNodeProperty ENUMERATOR_NAME = new ASTNodeProperty(
|
||||||
|
"Enumerator Name"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the enumerator's name.
|
* Set the enumerator's name.
|
||||||
*
|
*
|
||||||
* @param name
|
* @param name
|
||||||
*/
|
*/
|
||||||
public void setName(IASTName name);
|
public void setName(IASTName name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the enumerator's name.
|
* Get the enumerator's name.
|
||||||
*
|
*
|
||||||
|
@ -45,15 +49,19 @@ public interface IASTEnumerationSpecifier extends IASTDeclSpecifier {
|
||||||
public IASTName getName();
|
public IASTName getName();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>ENUMERATOR_VALUE</code> describes the relationship between <code>IASTEnumerator</code> and <code>IASTExpression</code>.
|
* <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$
|
public static final ASTNodeProperty ENUMERATOR_VALUE = new ASTNodeProperty(
|
||||||
|
"Enumerator Value"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set enumerator value.
|
* Set enumerator value.
|
||||||
*
|
*
|
||||||
* @param expression
|
* @param expression
|
||||||
*/
|
*/
|
||||||
public void setValue(IASTExpression expression);
|
public void setValue(IASTExpression expression);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get enumerator value.
|
* Get enumerator value.
|
||||||
*
|
*
|
||||||
|
@ -63,33 +71,43 @@ public interface IASTEnumerationSpecifier extends IASTDeclSpecifier {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>ENUMERATOR</code> describes the relationship between <code>IASTEnumerationSpecifier</code> and the nested <code>IASTEnumerator</code>s.
|
* <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$
|
public static final ASTNodeProperty ENUMERATOR = new ASTNodeProperty(
|
||||||
|
"Enumerator"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add an enumerator.
|
* Add an enumerator.
|
||||||
*
|
*
|
||||||
* @param enumerator <code>IASTEnumerator</code>
|
* @param enumerator
|
||||||
|
* <code>IASTEnumerator</code>
|
||||||
*/
|
*/
|
||||||
public void addEnumerator(IASTEnumerator enumerator);
|
public void addEnumerator(IASTEnumerator enumerator);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get enumerators.
|
* Get enumerators.
|
||||||
|
*
|
||||||
* @return <code>IASTEnumerator []</code> array
|
* @return <code>IASTEnumerator []</code> array
|
||||||
*/
|
*/
|
||||||
public IASTEnumerator[] getEnumerators();
|
public IASTEnumerator[] getEnumerators();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>ENUMERATION_NAME</code> describes the relationship between <code>IASTEnumerationSpecifier</code> and its <code>IASTName</code>.
|
* <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$
|
public static final ASTNodeProperty ENUMERATION_NAME = new ASTNodeProperty(
|
||||||
|
"Enum Name"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the enum's name.
|
* Set the enum's name.
|
||||||
*
|
*
|
||||||
* @param name
|
* @param name
|
||||||
*/
|
*/
|
||||||
public void setName(IASTName name);
|
public void setName(IASTName name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the enum's name.
|
* Get the enum's name.
|
||||||
*
|
*
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
* IBM Rational Software - Initial API and implementation */
|
* IBM Rational Software - Initial API and implementation */
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Expression List (Comma separated list of expressions).
|
* Expression List (Comma separated list of expressions).
|
||||||
*
|
*
|
||||||
|
@ -18,9 +17,12 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
public interface IASTExpressionList extends IASTExpression {
|
public interface IASTExpressionList extends IASTExpression {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>NESTED_EXPRESSION</code> describes the relationship between <code>IASTExpressionList</code> and the nested <code>IASTExpression</code>s.
|
* <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$
|
public static final ASTNodeProperty NESTED_EXPRESSION = new ASTNodeProperty(
|
||||||
|
"Nested Expression"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get nested expressions.
|
* Get nested expressions.
|
||||||
|
@ -32,7 +34,8 @@ public interface IASTExpressionList extends IASTExpression {
|
||||||
/**
|
/**
|
||||||
* Add nested expression.
|
* Add nested expression.
|
||||||
*
|
*
|
||||||
* @param expression <code>IASTExpression</code> value to be added.
|
* @param expression
|
||||||
|
* <code>IASTExpression</code> value to be added.
|
||||||
*/
|
*/
|
||||||
public void addExpression(IASTExpression expression);
|
public void addExpression(IASTExpression expression);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Expression statement.
|
* Expression statement.
|
||||||
*
|
*
|
||||||
|
@ -19,9 +18,12 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
public interface IASTExpressionStatement extends IASTStatement {
|
public interface IASTExpressionStatement extends IASTStatement {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>EXPRESSION</code> is the relationship between an <code>IASTExpressionStatement</code> and an <code>IASTExpression</code>.
|
* <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$
|
public static final ASTNodeProperty EXPFRESSION = new ASTNodeProperty(
|
||||||
|
"Expression"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the expression in this statement.
|
* Get the expression in this statement.
|
||||||
*
|
*
|
||||||
|
|
|
@ -19,13 +19,15 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
public interface IASTFieldDeclarator extends IASTDeclarator {
|
public interface IASTFieldDeclarator extends IASTDeclarator {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>FIELD_SIZE</code> represents the relationship between a <code>IASTFieldDeclarator</code> and its <code>IASTExpression</code>.
|
* <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$
|
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.
|
* This returns the number of bits if this is a bit field. If it is not a
|
||||||
* If it is not a bit field, it returns null.
|
* bit field, it returns null.
|
||||||
*
|
*
|
||||||
* @return size of bit field or null.
|
* @return size of bit field or null.
|
||||||
*/
|
*/
|
||||||
|
@ -33,7 +35,9 @@ public interface IASTFieldDeclarator extends IASTDeclarator {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the bitfield size.
|
* Set the bitfield size.
|
||||||
* @param size <code>IASTExpression</code>
|
*
|
||||||
|
* @param size
|
||||||
|
* <code>IASTExpression</code>
|
||||||
*/
|
*/
|
||||||
public void setBitFieldSize(IASTExpression size);
|
public void setBitFieldSize(IASTExpression size);
|
||||||
|
|
||||||
|
|
|
@ -11,22 +11,29 @@
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This interface represents expressions that access a field reference.
|
* This interface represents expressions that access a field reference. e.g. a.b =>
|
||||||
* e.g. a.b => a is the expression, b is the field name.
|
* a is the expression, b is the field name. e.g. a()->def => a() is the
|
||||||
* e.g. a()->def => a() is the expression, def is the field name.
|
* expression, def is the field name.
|
||||||
*
|
*
|
||||||
* @author Doug Schaefer
|
* @author Doug Schaefer
|
||||||
*/
|
*/
|
||||||
public interface IASTFieldReference extends IASTExpression {
|
public interface IASTFieldReference extends IASTExpression {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>FIELD_OWNER</code> represents the relationship between a <code>IASTFieldReference</code> and its <code>IASTExpression</code> field owner.
|
* <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$
|
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.
|
* <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$
|
public static final ASTNodeProperty FIELD_NAME = new ASTNodeProperty(
|
||||||
|
"Field Name"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This returns an expression for the object containing the field.
|
* This returns an expression for the object containing the field.
|
||||||
|
@ -52,13 +59,13 @@ public interface IASTFieldReference extends IASTExpression {
|
||||||
/**
|
/**
|
||||||
* Set the name of the field.
|
* 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
|
* This returns true of this is the arrow operator and not the dot operator.
|
||||||
* dot operator.
|
|
||||||
*
|
*
|
||||||
* @return is this a pointer dereference
|
* @return is this a pointer dereference
|
||||||
*/
|
*/
|
||||||
|
@ -66,7 +73,9 @@ public interface IASTFieldReference extends IASTExpression {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set whether or not this is a pointer dereference (default == no).
|
* 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);
|
||||||
|
|
||||||
|
|
|
@ -11,38 +11,55 @@
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The for statement. The initialization clause can be an expression or
|
* The for statement. The initialization clause can be an expression or a
|
||||||
* a declaration but not both.
|
* declaration but not both.
|
||||||
*
|
*
|
||||||
* @author Doug Schaefer
|
* @author Doug Schaefer
|
||||||
*/
|
*/
|
||||||
public interface IASTForStatement extends IASTStatement {
|
public interface IASTForStatement extends IASTStatement {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>INITEXPRESSION</code> represents the relationship between a <code>IASTForStatement</code> and its <code>IASTExpression</code> initializer.
|
* <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$
|
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.
|
* <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$
|
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.
|
* <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$
|
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.
|
* <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$
|
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.
|
* <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$
|
public static final ASTNodeProperty BODY = new ASTNodeProperty("body"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the initial expression for the loop. Returns null if there is
|
* Get the initial expression for the loop. Returns null if there is none.
|
||||||
* none. You can not have both an initial expression and an initial
|
* You can not have both an initial expression and an initial declaration.
|
||||||
* declaration.
|
|
||||||
*
|
*
|
||||||
* @return <code>IASTExpression</code>
|
* @return <code>IASTExpression</code>
|
||||||
*/
|
*/
|
||||||
|
@ -51,22 +68,24 @@ public interface IASTForStatement extends IASTStatement {
|
||||||
/**
|
/**
|
||||||
* Set the initial expression for the loop.
|
* Set the initial expression for the loop.
|
||||||
*
|
*
|
||||||
* @param expression <code>IASTExpression</code>
|
* @param expression
|
||||||
|
* <code>IASTExpression</code>
|
||||||
*/
|
*/
|
||||||
public void setInit(IASTExpression expression);
|
public void setInit(IASTExpression expression);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the initial declaration for the loop. Returns null if there is
|
* Get the initial declaration for the loop. Returns null if there is none.
|
||||||
* none. You can not have both an initial declaration and an initial
|
* You can not have both an initial declaration and an initial declaration.
|
||||||
* declaration.
|
|
||||||
*
|
*
|
||||||
* @return <code>IASTDeclaration</code>
|
* @return <code>IASTDeclaration</code>
|
||||||
*/
|
*/
|
||||||
public IASTDeclaration getInitDeclaration();
|
public IASTDeclaration getInitDeclaration();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the intiial declaration for the loop.
|
* Set the intiial declaration for the loop.
|
||||||
*
|
*
|
||||||
* @param declaration <code>IASTDeclaration</code>
|
* @param declaration
|
||||||
|
* <code>IASTDeclaration</code>
|
||||||
*/
|
*/
|
||||||
public void setInit(IASTDeclaration declaration);
|
public void setInit(IASTDeclaration declaration);
|
||||||
|
|
||||||
|
@ -80,7 +99,8 @@ public interface IASTForStatement extends IASTStatement {
|
||||||
/**
|
/**
|
||||||
* Set the condition expression for the loop.
|
* Set the condition expression for the loop.
|
||||||
*
|
*
|
||||||
* @param condition <code>IASTExpression</code>
|
* @param condition
|
||||||
|
* <code>IASTExpression</code>
|
||||||
*/
|
*/
|
||||||
public void setCondition(IASTExpression condition);
|
public void setCondition(IASTExpression condition);
|
||||||
|
|
||||||
|
@ -93,9 +113,11 @@ public interface IASTForStatement extends IASTStatement {
|
||||||
public IASTExpression getIterationExpression();
|
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);
|
public void setIterationExpression(IASTExpression iterator);
|
||||||
|
|
||||||
|
@ -105,15 +127,18 @@ public interface IASTForStatement extends IASTStatement {
|
||||||
* @return <code>IASTStatement</code>
|
* @return <code>IASTStatement</code>
|
||||||
*/
|
*/
|
||||||
public IASTStatement getBody();
|
public IASTStatement getBody();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the body of the for loop.
|
* 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.
|
* Get the <code>IScope</code> represented by this for loop.
|
||||||
|
*
|
||||||
* @return <code>IScope</code>
|
* @return <code>IScope</code>
|
||||||
*/
|
*/
|
||||||
public IScope getScope();
|
public IScope getScope();
|
||||||
|
|
|
@ -10,40 +10,55 @@
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This interface represents a function call expression.
|
* This interface represents a function call expression. f( x ) : f is the
|
||||||
* f( x ) : f is the function name expression, x is the parameter expression.
|
* function name expression, x is the parameter expression.
|
||||||
*
|
*
|
||||||
* @author jcamelon
|
* @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.
|
* Set the function name expression.
|
||||||
* @param expression <code>IASTExpression</code> representing the function name
|
*
|
||||||
|
* @param expression
|
||||||
|
* <code>IASTExpression</code> representing the function name
|
||||||
*/
|
*/
|
||||||
public void setFunctionNameExpression(IASTExpression expression);
|
public void setFunctionNameExpression(IASTExpression expression);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the function name expression.
|
* Get the function name expression.
|
||||||
|
*
|
||||||
* @return <code>IASTExpression</code> representing the function name
|
* @return <code>IASTExpression</code> representing the function name
|
||||||
*/
|
*/
|
||||||
public IASTExpression getFunctionNameExpression();
|
public IASTExpression getFunctionNameExpression();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>PARAMETERS</code> represents the relationship between a <code>IASTFunctionCallExpression</code> and its <code>IASTExpression</code> (parameters).
|
* <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$
|
public static final ASTNodeProperty PARAMETERS = new ASTNodeProperty(
|
||||||
|
"Parameters"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the parameters expression.
|
* Set the parameters expression.
|
||||||
* @param expression <code>IASTExpression</code> representing the parameters
|
*
|
||||||
|
* @param expression
|
||||||
|
* <code>IASTExpression</code> representing the parameters
|
||||||
*/
|
*/
|
||||||
public void setParameterExpression(IASTExpression expression);
|
public void setParameterExpression(IASTExpression expression);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the parameter expression.
|
* Get the parameter expression.
|
||||||
|
*
|
||||||
* @return <code>IASTExpression</code> representing the parameters
|
* @return <code>IASTExpression</code> representing the parameters
|
||||||
*/
|
*/
|
||||||
public IASTExpression getParameterExpression();
|
public IASTExpression getParameterExpression();
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a declarator for a function.
|
* This is a declarator for a function.
|
||||||
*
|
*
|
||||||
|
|
|
@ -18,17 +18,27 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
public interface IASTFunctionDefinition extends IASTDeclaration {
|
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$
|
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>.
|
* <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$
|
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>.
|
* <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 FUNCTION_BODY = new ASTNodeProperty(
|
||||||
|
"Function Body"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the decl specifier for the function.
|
* Get the decl specifier for the function.
|
||||||
|
@ -59,8 +69,8 @@ public interface IASTFunctionDefinition extends IASTDeclaration {
|
||||||
public void setDeclarator(IASTFunctionDeclarator declarator);
|
public void setDeclarator(IASTFunctionDeclarator declarator);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the body of the function. This is usually a compound statement
|
* Get the body of the function. This is usually a compound statement but
|
||||||
* but C++ also has a function try block.
|
* C++ also has a function try block.
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@ -68,12 +78,14 @@ public interface IASTFunctionDefinition extends IASTDeclaration {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the body of the function.
|
* Set the body of the function.
|
||||||
|
*
|
||||||
* @param statement
|
* @param statement
|
||||||
*/
|
*/
|
||||||
public void setBody(IASTStatement statement);
|
public void setBody(IASTStatement statement);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the logical IScope that the function definition body represents.
|
* Get the logical IScope that the function definition body represents.
|
||||||
|
*
|
||||||
* @return <code>IScope</code> representing function body.
|
* @return <code>IScope</code> representing function body.
|
||||||
*/
|
*/
|
||||||
public IScope getScope();
|
public IScope getScope();
|
||||||
|
|
|
@ -11,15 +11,16 @@
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This interface represents the name of a function style macro parameter.
|
* This interface represents the name of a function style macro parameter. This
|
||||||
* This is not an IASTName, as there are not any bindings for
|
* is not an IASTName, as there are not any bindings for
|
||||||
*
|
*
|
||||||
* @author jcamelon
|
* @author jcamelon
|
||||||
*/
|
*/
|
||||||
public interface IASTFunctionStyleMacroParameter extends IASTNode {
|
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];
|
public static final IASTFunctionStyleMacroParameter[] EMPTY_PARAMETER_ARRAY = new IASTFunctionStyleMacroParameter[0];
|
||||||
|
|
||||||
|
@ -33,7 +34,8 @@ public interface IASTFunctionStyleMacroParameter extends IASTNode {
|
||||||
/**
|
/**
|
||||||
* Set the parameter name.
|
* Set the parameter name.
|
||||||
*
|
*
|
||||||
* @param value String
|
* @param value
|
||||||
|
* String
|
||||||
*/
|
*/
|
||||||
public void setParameter(String value);
|
public void setParameter(String value);
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,8 @@ public interface IASTGotoStatement extends IASTStatement {
|
||||||
/**
|
/**
|
||||||
* Set the name for a goto statement label.
|
* Set the name for a goto statement label.
|
||||||
*
|
*
|
||||||
* @param name <code>IASTName</code>
|
* @param name
|
||||||
|
* <code>IASTName</code>
|
||||||
*/
|
*/
|
||||||
public void setName(IASTName name);
|
public void setName(IASTName name);
|
||||||
|
|
||||||
|
|
|
@ -18,9 +18,12 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
public interface IASTIdExpression extends IASTExpression {
|
public interface IASTIdExpression extends IASTExpression {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>ID_NAME</code> represents the relationship between an <code>IASTIdExpression</code> and a <code>IASTName</code>.
|
* <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$
|
public static final ASTNodeProperty ID_NAME = new ASTNodeProperty(
|
||||||
|
"IdExpression Name"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the name used in the expression.
|
* Returns the name used in the expression.
|
||||||
*
|
*
|
||||||
|
|
|
@ -18,15 +18,23 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
public interface IASTIfStatement extends IASTStatement {
|
public interface IASTIfStatement extends IASTStatement {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>CONDITION</code> represents the relationship between an <code>IASTIfStatement</code> and its nested <code>IASTExpression</code>.
|
* <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$
|
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).
|
* <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$
|
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).
|
* <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$
|
public static final ASTNodeProperty ELSE = new ASTNodeProperty("else"); //$NON-NLS-1$
|
||||||
|
|
||||||
|
@ -39,7 +47,9 @@ public interface IASTIfStatement extends IASTStatement {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the condition in the if statement.
|
* Set the condition in the if statement.
|
||||||
* @param condition <code>IASTExpression</code>
|
*
|
||||||
|
* @param condition
|
||||||
|
* <code>IASTExpression</code>
|
||||||
*/
|
*/
|
||||||
public void setCondition(IASTExpression condition);
|
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.
|
* 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);
|
public void setThenClause(IASTStatement thenClause);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the statement that is executed if the condition is false. This
|
* Get the statement that is executed if the condition is false. This clause
|
||||||
* clause is optional and returns null if there is none.
|
* is optional and returns null if there is none.
|
||||||
*
|
*
|
||||||
* @return the else clause or null <code>IASTStatement</code>
|
* @return the else clause or null <code>IASTStatement</code>
|
||||||
*/
|
*/
|
||||||
|
@ -68,7 +79,8 @@ public interface IASTIfStatement extends IASTStatement {
|
||||||
/**
|
/**
|
||||||
* Set the else clause.
|
* Set the else clause.
|
||||||
*
|
*
|
||||||
* @param elseClause <code>IASTStatement</code>
|
* @param elseClause
|
||||||
|
* <code>IASTStatement</code>
|
||||||
*/
|
*/
|
||||||
public void setElseClause(IASTStatement elseClause);
|
public void setElseClause(IASTStatement elseClause);
|
||||||
|
|
||||||
|
|
|
@ -18,9 +18,12 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
public interface IASTInitializerExpression extends IASTInitializer {
|
public interface IASTInitializerExpression extends IASTInitializer {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>INITIALIZER_EXPRESSION</code> represents the relationship between an <code>IASTInitializerExpression</code>. and its <code></code>IASTExpression</code>.
|
* <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$
|
public static final ASTNodeProperty INITIALIZER_EXPRESSION = new ASTNodeProperty(
|
||||||
|
"Initializer Expression"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the expression for the initializer.
|
* Get the expression for the initializer.
|
||||||
*
|
*
|
||||||
|
@ -31,7 +34,8 @@ public interface IASTInitializerExpression extends IASTInitializer {
|
||||||
/**
|
/**
|
||||||
* Set the initializer's expression.
|
* 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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is an an initializer that is a list of initializers.
|
* This is an an initializer that is a list of initializers.
|
||||||
*
|
*
|
||||||
|
@ -19,9 +18,11 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
public interface IASTInitializerList extends IASTInitializer {
|
public interface IASTInitializerList extends IASTInitializer {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>NESTED_INITIALIZER</code> describes the relationship between an <code>IASTInitializerList</code> and its sub-<code>IASTInitializer</code>s.
|
* <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$
|
public static final ASTNodeProperty NESTED_INITIALIZER = new ASTNodeProperty(
|
||||||
|
"Nested Initializer"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the list of initializers.
|
* Get the list of initializers.
|
||||||
|
@ -33,7 +34,8 @@ public interface IASTInitializerList extends IASTInitializer {
|
||||||
/**
|
/**
|
||||||
* Add an initializer to the initializer list.
|
* 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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,18 +21,22 @@ public interface IASTLiteralExpression extends IASTExpression {
|
||||||
* An integer literal e.g. 5
|
* An integer literal e.g. 5
|
||||||
*/
|
*/
|
||||||
public static final int lk_integer_constant = 0;
|
public static final int lk_integer_constant = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A floating point literal e.g. 6.0
|
* A floating point literal e.g. 6.0
|
||||||
*/
|
*/
|
||||||
public static final int lk_float_constant = 1;
|
public static final int lk_float_constant = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A char literal e.g. 'abc'
|
* A char literal e.g. 'abc'
|
||||||
*/
|
*/
|
||||||
public static final int lk_char_constant = 2;
|
public static final int lk_char_constant = 2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A string literal e.g. "abcdefg"
|
* A string literal e.g. "abcdefg"
|
||||||
*/
|
*/
|
||||||
public static final int lk_string_literal = 3;
|
public static final int lk_string_literal = 3;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A constant defined for subclasses to extend from.
|
* A constant defined for subclasses to extend from.
|
||||||
*/
|
*/
|
||||||
|
@ -44,10 +48,12 @@ public interface IASTLiteralExpression extends IASTExpression {
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public int getKind();
|
public int getKind();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the literal expression kind.
|
* Set the literal expression kind.
|
||||||
*
|
*
|
||||||
* @param value int
|
* @param value
|
||||||
|
* int
|
||||||
*/
|
*/
|
||||||
public void setKind(int value);
|
public void setKind(int value);
|
||||||
|
|
||||||
|
|
|
@ -11,9 +11,9 @@
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Macro expansion is a node location.
|
* A Macro expansion is a node location. Nodes that have locations that arrive
|
||||||
* Nodes that have locations that arrive through the expansion of preprocessor macros
|
* through the expansion of preprocessor macros will refer to these type of
|
||||||
* will refer to these type of objects.
|
* objects.
|
||||||
*
|
*
|
||||||
* @author Doug Schaefer
|
* @author Doug Schaefer
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class represents a name in the program that represents a semantic
|
* This class represents a name in the program that represents a semantic object
|
||||||
* object in the program.
|
* in the program.
|
||||||
*
|
*
|
||||||
* The toString method produces a string representation of the name as
|
* The toString method produces a string representation of the name as
|
||||||
* appropriate for the language.
|
* appropriate for the language.
|
||||||
|
@ -34,8 +34,8 @@ public interface IASTName extends IASTNode {
|
||||||
public IBinding resolveBinding();
|
public IBinding resolveBinding();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a list of bindings in the scope of the name that have the
|
* Return a list of bindings in the scope of the name that have the name as
|
||||||
* name as a prefix.
|
* a prefix.
|
||||||
*
|
*
|
||||||
* @return <code>IBinding []</code> bindings that start with this name
|
* @return <code>IBinding []</code> bindings that start with this name
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -11,15 +11,17 @@
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the use of a typedef name in an decl specifier in C.
|
* Represents the use of a typedef name in an decl specifier in C. Also used for
|
||||||
* Also used for class/struct/union names in C.
|
* class/struct/union names in C.
|
||||||
*
|
*
|
||||||
* @author Doug Schaefer
|
* @author Doug Schaefer
|
||||||
*/
|
*/
|
||||||
public interface IASTNamedTypeSpecifier extends IASTDeclSpecifier {
|
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$
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,8 @@ public interface IASTNode {
|
||||||
/**
|
/**
|
||||||
* Set the parent node of this node in the tree.
|
* 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);
|
public void setParent(IASTNode node);
|
||||||
|
|
||||||
|
@ -74,8 +75,8 @@ public interface IASTNode {
|
||||||
public void setPropertyInParent(ASTNodeProperty property);
|
public void setPropertyInParent(ASTNodeProperty property);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abstract method to be overriden by all subclasses.
|
* Abstract method to be overriden by all subclasses. Necessary for
|
||||||
* Necessary for visitation of the tree using an <code>ASTVisitor</code>.
|
* visitation of the tree using an <code>ASTVisitor</code>.
|
||||||
*
|
*
|
||||||
* @param visitor
|
* @param visitor
|
||||||
* @return continue on (true) or quit( false )
|
* @return continue on (true) or quit( false )
|
||||||
|
|
|
@ -11,17 +11,16 @@
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A NodeLocation represents the source location of a given node. Most
|
* A NodeLocation represents the source location of a given node. Most often
|
||||||
* often this is a file it may be other fancy things like macro
|
* this is a file it may be other fancy things like macro expansions.
|
||||||
* expansions.
|
|
||||||
*
|
*
|
||||||
* @author Doug Schaefer
|
* @author Doug Schaefer
|
||||||
*/
|
*/
|
||||||
public interface IASTNodeLocation {
|
public interface IASTNodeLocation {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the offset into the actual source location that this node
|
* This is the offset into the actual source location that this node starts
|
||||||
* starts at.
|
* at.
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -9,10 +9,8 @@
|
||||||
* IBM Rational Software - Initial API and implementation */
|
* IBM Rational Software - Initial API and implementation */
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This node represents a null statement.
|
* This node represents a null statement. ';'
|
||||||
* ';'
|
|
||||||
*
|
*
|
||||||
* @author jcamelon
|
* @author jcamelon
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -22,13 +22,20 @@ public interface IASTParameterDeclaration extends IASTNode {
|
||||||
public static final IASTParameterDeclaration[] EMPTY_PARAMETERDECLARATION_ARRAY = new IASTParameterDeclaration[0];
|
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$
|
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>.
|
* <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 DECLARATOR = new ASTNodeProperty(
|
||||||
|
"Declarator"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the decl specifier.
|
* Get the decl specifier.
|
||||||
|
@ -47,14 +54,16 @@ public interface IASTParameterDeclaration extends IASTNode {
|
||||||
/**
|
/**
|
||||||
* Set the decl specifier.
|
* Set the decl specifier.
|
||||||
*
|
*
|
||||||
* @param declSpec <code>IASTDeclSpecifier</code>.
|
* @param declSpec
|
||||||
|
* <code>IASTDeclSpecifier</code>.
|
||||||
*/
|
*/
|
||||||
public void setDeclSpecifier(IASTDeclSpecifier declSpec);
|
public void setDeclSpecifier(IASTDeclSpecifier declSpec);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the declarator.
|
* Set the declarator.
|
||||||
*
|
*
|
||||||
* @param declarator <code>IASTDeclarator</code>
|
* @param declarator
|
||||||
|
* <code>IASTDeclarator</code>
|
||||||
*/
|
*/
|
||||||
public void setDeclarator(IASTDeclarator declarator);
|
public void setDeclarator(IASTDeclarator declarator);
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@ public interface IASTPointer extends IASTPointerOperator {
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public boolean isConst();
|
public boolean isConst();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Is this a volatile pointer?
|
* Is this a volatile pointer?
|
||||||
*
|
*
|
||||||
|
@ -34,13 +35,16 @@ public interface IASTPointer extends IASTPointerOperator {
|
||||||
/**
|
/**
|
||||||
* Set this to be a const pointer (true/false).
|
* 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).
|
* 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);
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,8 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
*
|
*
|
||||||
* @author jcamelon
|
* @author jcamelon
|
||||||
*/
|
*/
|
||||||
public interface IASTPreprocessorElifStatement extends IASTPreprocessorStatement {
|
public interface IASTPreprocessorElifStatement extends
|
||||||
|
IASTPreprocessorStatement {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Was this #elif branch taken?
|
* Was this #elif branch taken?
|
||||||
|
|
|
@ -15,10 +15,12 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
*
|
*
|
||||||
* @author jcamelon
|
* @author jcamelon
|
||||||
*/
|
*/
|
||||||
public interface IASTPreprocessorElseStatement extends IASTPreprocessorStatement {
|
public interface IASTPreprocessorElseStatement extends
|
||||||
|
IASTPreprocessorStatement {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Was this #else branch taken?
|
* Was this #else branch taken?
|
||||||
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public boolean taken();
|
public boolean taken();
|
||||||
|
|
|
@ -12,8 +12,10 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This interface represent a preprocessor #endif statement.
|
* This interface represent a preprocessor #endif statement.
|
||||||
|
*
|
||||||
* @author jcamelon
|
* @author jcamelon
|
||||||
*/
|
*/
|
||||||
public interface IASTPreprocessorEndifStatement extends IASTPreprocessorStatement{
|
public interface IASTPreprocessorEndifStatement extends
|
||||||
|
IASTPreprocessorStatement {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,8 @@ public interface IASTPreprocessorFunctionStyleMacroDefinition extends
|
||||||
IASTPreprocessorMacroDefinition {
|
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(
|
public static final ASTNodeProperty PARAMETER = new ASTNodeProperty(
|
||||||
"Function Macro Parameter"); //$NON-NLS-1$
|
"Function Macro Parameter"); //$NON-NLS-1$
|
||||||
|
@ -35,7 +36,8 @@ public interface IASTPreprocessorFunctionStyleMacroDefinition extends
|
||||||
/**
|
/**
|
||||||
* Add a function-style macro parameter.
|
* Add a function-style macro parameter.
|
||||||
*
|
*
|
||||||
* @param parm <code>IASTFunctionStyleMacroParameter</code>
|
* @param parm
|
||||||
|
* <code>IASTFunctionStyleMacroParameter</code>
|
||||||
*/
|
*/
|
||||||
public void addParameter(IASTFunctionStyleMacroParameter parm);
|
public void addParameter(IASTFunctionStyleMacroParameter parm);
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This interface represent a preprocessor #if statement.
|
* This interface represent a preprocessor #if statement.
|
||||||
|
*
|
||||||
* @author jcamelon
|
* @author jcamelon
|
||||||
*/
|
*/
|
||||||
public interface IASTPreprocessorIfStatement extends IASTPreprocessorStatement {
|
public interface IASTPreprocessorIfStatement extends IASTPreprocessorStatement {
|
||||||
|
|
|
@ -12,12 +12,15 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This interface represent a preprocessor #ifdef statement.
|
* This interface represent a preprocessor #ifdef statement.
|
||||||
|
*
|
||||||
* @author jcamelon
|
* @author jcamelon
|
||||||
*/
|
*/
|
||||||
public interface IASTPreprocessorIfdefStatement extends IASTPreprocessorStatement {
|
public interface IASTPreprocessorIfdefStatement extends
|
||||||
|
IASTPreprocessorStatement {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Was this #ifdef branch taken?
|
* Was this #ifdef branch taken?
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public boolean taken();
|
public boolean taken();
|
||||||
|
|
|
@ -20,6 +20,7 @@ public interface IASTPreprocessorIfndefStatement extends
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Was this branch taken?
|
* Was this branch taken?
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public boolean taken();
|
public boolean taken();
|
||||||
|
|
|
@ -12,6 +12,7 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This interface represent a preprocessor #include statement.
|
* This interface represent a preprocessor #include statement.
|
||||||
|
*
|
||||||
* @author jcamelon
|
* @author jcamelon
|
||||||
*/
|
*/
|
||||||
public interface IASTPreprocessorIncludeStatement extends
|
public interface IASTPreprocessorIncludeStatement extends
|
||||||
|
@ -19,6 +20,7 @@ public interface IASTPreprocessorIncludeStatement extends
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the full path filename of the file found through #include.
|
* Get the full path filename of the file found through #include.
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public String getPath();
|
public String getPath();
|
||||||
|
|
|
@ -15,18 +15,23 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
*
|
*
|
||||||
* @author Doug Schaefer
|
* @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.
|
* <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$
|
public static final ASTNodeProperty MACRO_NAME = new ASTNodeProperty(
|
||||||
|
"Macro Name"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the macro name.
|
* Get the macro name.
|
||||||
*
|
*
|
||||||
* @return <code>IASTName</code>
|
* @return <code>IASTName</code>
|
||||||
*/
|
*/
|
||||||
public IASTName getName();
|
public IASTName getName();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the macro name.
|
* Set the macro name.
|
||||||
*
|
*
|
||||||
|
@ -40,10 +45,12 @@ public interface IASTPreprocessorMacroDefinition extends IASTPreprocessorStateme
|
||||||
* @return String
|
* @return String
|
||||||
*/
|
*/
|
||||||
public String getExpansion();
|
public String getExpansion();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the macro expansion.
|
* Set the macro expansion.
|
||||||
*
|
*
|
||||||
* @param exp String
|
* @param exp
|
||||||
|
* String
|
||||||
*/
|
*/
|
||||||
public void setExpansion(String exp);
|
public void setExpansion(String exp);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,11 +11,12 @@
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This interface represents an object-style macro definition.
|
* This interface represents an object-style macro definition. e.g. #define
|
||||||
* e.g. #define ONE_TWO_THREE 123
|
* ONE_TWO_THREE 123
|
||||||
*
|
*
|
||||||
* @author jcamelon
|
* @author jcamelon
|
||||||
*/
|
*/
|
||||||
public interface IASTPreprocessorObjectStyleMacroDefinition extends IASTPreprocessorMacroDefinition {
|
public interface IASTPreprocessorObjectStyleMacroDefinition extends
|
||||||
|
IASTPreprocessorMacroDefinition {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
*
|
*
|
||||||
* @author jcamelon
|
* @author jcamelon
|
||||||
*/
|
*/
|
||||||
public interface IASTPreprocessorUndefStatement extends IASTPreprocessorStatement {
|
public interface IASTPreprocessorUndefStatement extends
|
||||||
|
IASTPreprocessorStatement {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,15 +15,17 @@ import org.eclipse.cdt.internal.core.parser.ParserMessages;
|
||||||
/**
|
/**
|
||||||
* @author jcamelon
|
* @author jcamelon
|
||||||
*
|
*
|
||||||
* Description of a C/C++ parse/compilation problem, as detected by the parser or some of the underlying
|
* Description of a C/C++ parse/compilation problem, as detected by the parser
|
||||||
* clients of the parser.
|
* or some of the underlying clients of the parser.
|
||||||
*
|
*
|
||||||
* A problem provides access to:
|
* A problem provides access to:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li> its location (originating source file name, source position, line number), </li>
|
* <li> its location (originating source file name, source position, line
|
||||||
* <li> its message description and a predicate to check its severity (warning or error). </li>
|
* number), </li>
|
||||||
* <li> its ID : an number identifying the very nature of this problem. All possible IDs are listed
|
* <li> its message description and a predicate to check its severity (warning
|
||||||
* as constants on this interface. </li>
|
* 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>
|
* </ul>
|
||||||
*/
|
*/
|
||||||
public interface IASTProblem extends IASTNode {
|
public interface IASTProblem extends IASTNode {
|
||||||
|
@ -35,9 +37,11 @@ public interface IASTProblem extends IASTNode {
|
||||||
int getID();
|
int getID();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Answer a localized, human-readable message string which describes the problem.
|
* Answer a localized, human-readable message string which describes the
|
||||||
|
* problem.
|
||||||
*
|
*
|
||||||
* @return a localized, human-readable message string which describes the problem
|
* @return a localized, human-readable message string which describes the
|
||||||
|
* problem
|
||||||
*/
|
*/
|
||||||
String getMessage();
|
String getMessage();
|
||||||
|
|
||||||
|
@ -61,7 +65,8 @@ public interface IASTProblem extends IASTNode {
|
||||||
/**
|
/**
|
||||||
* Checks the severity to see if the Warning bit is not set.
|
* 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
|
* @return true if the Warning bit is not set for the severity, false
|
||||||
|
* otherwise
|
||||||
*/
|
*/
|
||||||
boolean isWarning();
|
boolean isWarning();
|
||||||
|
|
||||||
|
@ -73,18 +78,20 @@ public interface IASTProblem extends IASTNode {
|
||||||
/**
|
/**
|
||||||
* Unknown filename sentinel value
|
* Unknown filename sentinel value
|
||||||
*/
|
*/
|
||||||
public final static String FILENAME_NOT_PROVIDED = ParserMessages.getString("IProblem.unknownFileName"); //$NON-NLS-1$
|
public final static String FILENAME_NOT_PROVIDED = ParserMessages
|
||||||
|
.getString("IProblem.unknownFileName"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Problem Categories
|
* Problem Categories The high bits of a problem ID contains information
|
||||||
* The high bits of a problem ID contains information about the category of a problem.
|
* about the category of a problem. For example, (problemID & TypeRelated) !=
|
||||||
* For example, (problemID & TypeRelated) != 0, indicates that this problem is type related.
|
* 0, indicates that this problem is type related.
|
||||||
*
|
*
|
||||||
* A problem category can help to implement custom problem filters. Indeed, when numerous problems
|
* A problem category can help to implement custom problem filters. Indeed,
|
||||||
* are listed, focusing on import related problems first might be relevant.
|
* 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
|
* When a problem is tagged as Internal, it means that no change other than
|
||||||
* can fix the corresponding problem.
|
* a local source code change can fix the corresponding problem.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -112,10 +119,9 @@ public interface IASTProblem extends IASTNode {
|
||||||
*/
|
*/
|
||||||
public final static int INTERNAL_RELATED = 0x10000000;
|
public final static int INTERNAL_RELATED = 0x10000000;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check the parameter bitmask against an IProblem's ID to broadly segregate the
|
* Check the parameter bitmask against an IProblem's ID to broadly segregate
|
||||||
* types of problems.
|
* the types of problems.
|
||||||
*
|
*
|
||||||
* @param bitmask
|
* @param bitmask
|
||||||
* @return true if ( (id & bitmask ) != 0 )
|
* @return true if ( (id & bitmask ) != 0 )
|
||||||
|
@ -123,55 +129,60 @@ public interface IASTProblem extends IASTNode {
|
||||||
public boolean checkCategory(int bitmask);
|
public boolean checkCategory(int bitmask);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mask to use in order to filter out the category portion of the problem ID.
|
* Mask to use in order to filter out the category portion of the problem
|
||||||
|
* ID.
|
||||||
*/
|
*/
|
||||||
public final static int IGNORE_CATEGORIES_MASK = 0xFFFFFF;
|
public final static int IGNORE_CATEGORIES_MASK = 0xFFFFFF;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Below are listed all available problem attributes. The JavaDoc for each problem ID indicates
|
* Below are listed all available problem attributes. The JavaDoc for each
|
||||||
* when they should be contributed to creating a problem of that type.
|
* problem ID indicates when they should be contributed to creating a
|
||||||
|
* problem of that type.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Preprocessor IProblem attributes
|
// Preprocessor IProblem attributes
|
||||||
/**
|
/**
|
||||||
* The text that follows a #error preprocessor directive
|
* The text that follows a #error preprocessor directive
|
||||||
*/
|
*/
|
||||||
public final static String A_PREPROC_POUND_ERROR = ParserMessages.getString("IProblem.preproc.poundError"); //$NON-NLS-1$
|
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
|
* 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$
|
public final static String A_PREPROC_INCLUDE_FILENAME = ParserMessages
|
||||||
|
.getString("IProblem.preproc.include"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A preprocessor macro name
|
* A preprocessor macro name
|
||||||
*/
|
*/
|
||||||
public final static String A_PREPROC_MACRO_NAME = ParserMessages.getString("IProblem.preproc.macro"); //$NON-NLS-1$
|
public final static String A_PREPROC_MACRO_NAME = ParserMessages
|
||||||
|
.getString("IProblem.preproc.macro"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A preprocessor conditional that could not be evaluated
|
* A preprocessor conditional that could not be evaluated
|
||||||
*
|
*
|
||||||
* #if X + Y == Z <== that one, if X, Y or Z are not defined
|
* #if X + Y == Z <== that one, if X, Y or Z are not defined #endif
|
||||||
* #endif
|
|
||||||
*/
|
*/
|
||||||
public final static String A_PREPROC_CONDITION = ParserMessages.getString("IProblem.preproc.condition"); //$NON-NLS-1$
|
public final static String A_PREPROC_CONDITION = ParserMessages
|
||||||
|
.getString("IProblem.preproc.condition"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A preprocessor directive that could not be interpretted
|
* A preprocessor directive that could not be interpretted
|
||||||
*
|
*
|
||||||
* e.g. #blah
|
* e.g. #blah
|
||||||
*/
|
*/
|
||||||
public final static String A_PREPROC_UNKNOWN_DIRECTIVE = ParserMessages.getString("IProblem.preproc.unknownDirective"); //$NON-NLS-1$
|
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.
|
* The preprocessor conditional statement that caused an unbalanced
|
||||||
|
* mismatch.
|
||||||
*
|
*
|
||||||
* #if X
|
* #if X #else #else <=== that one #endif
|
||||||
* #else
|
|
||||||
* #else <=== that one
|
|
||||||
* #endif
|
|
||||||
*/
|
*/
|
||||||
public final static String A_PREPROC_CONDITIONAL_MISMATCH = ParserMessages.getString("IProblem.preproc.conditionalMismatch"); //$NON-NLS-1$
|
public final static String A_PREPROC_CONDITIONAL_MISMATCH = ParserMessages
|
||||||
|
.getString("IProblem.preproc.conditionalMismatch"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Bad character encountered in scanner
|
* The Bad character encountered in scanner
|
||||||
|
@ -181,21 +192,25 @@ public interface IASTProblem extends IASTNode {
|
||||||
/**
|
/**
|
||||||
* A_SYMBOL_NAME - symbol name
|
* A_SYMBOL_NAME - symbol name
|
||||||
*/
|
*/
|
||||||
public static final String A_SYMBOL_NAME = ParserMessages.getString("IProblem.symbolName"); //$NON-NLS-1$
|
public static final String A_SYMBOL_NAME = ParserMessages
|
||||||
|
.getString("IProblem.symbolName"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A_NAMESPACE_NAME = namespace name
|
* A_NAMESPACE_NAME = namespace name
|
||||||
*/
|
*/
|
||||||
public static final String A_NAMESPACE_NAME = ParserMessages.getString("IProblem.namespaceName"); //$NON-NLS-1$
|
public static final String A_NAMESPACE_NAME = ParserMessages
|
||||||
|
.getString("IProblem.namespaceName"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A_TYPE_NAME - type name
|
* A_TYPE_NAME - type name
|
||||||
*/
|
*/
|
||||||
public static final String A_TYPE_NAME = ParserMessages.getString("IProblem.typeName"); //$NON-NLS-1$
|
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,
|
* Below are listed all available problem IDs. Note that this list could be
|
||||||
* as new features are added to the C/C++ core implementation.
|
* augmented in the future, as new features are added to the C/C++ core
|
||||||
|
* implementation.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -203,127 +218,124 @@ public interface IASTProblem extends IASTNode {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bad character encountered by Scanner.
|
* Bad character encountered by Scanner. Required attributes:
|
||||||
* Required attributes: A_SCANNER_BADCHAR
|
* A_SCANNER_BADCHAR
|
||||||
|
*
|
||||||
* @see #A_SCANNER_BADCHAR
|
* @see #A_SCANNER_BADCHAR
|
||||||
*/
|
*/
|
||||||
public final static int SCANNER_BAD_CHARACTER = SCANNER_RELATED | 0x001;
|
public final static int SCANNER_BAD_CHARACTER = SCANNER_RELATED | 0x001;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unbounded literal string encountered by Scanner.
|
* Unbounded literal string encountered by Scanner. Required attributes:
|
||||||
* Required attributes: none.
|
* none.
|
||||||
*/
|
*/
|
||||||
public final static int SCANNER_UNBOUNDED_STRING = SCANNER_RELATED | 0x002;
|
public final static int SCANNER_UNBOUNDED_STRING = SCANNER_RELATED | 0x002;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invalid escape sequence encountered by Scanner.
|
* Invalid escape sequence encountered by Scanner. Required attributes:
|
||||||
* Required attributes: none.
|
* none.
|
||||||
*/
|
*/
|
||||||
public final static int SCANNER_INVALID_ESCAPECHAR = SCANNER_RELATED | 0x003;
|
public final static int SCANNER_INVALID_ESCAPECHAR = SCANNER_RELATED | 0x003;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bad floating point encountered by Scanner.
|
* Bad floating point encountered by Scanner. Required attributes: none.
|
||||||
* Required attributes: none.
|
|
||||||
*/
|
*/
|
||||||
public final static int SCANNER_BAD_FLOATING_POINT = SCANNER_RELATED | 0x004;
|
public final static int SCANNER_BAD_FLOATING_POINT = SCANNER_RELATED | 0x004;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bad hexidecimal encountered by Scanner.
|
* Bad hexidecimal encountered by Scanner. Required attributes: none.
|
||||||
* Required attributes: none.
|
|
||||||
*/
|
*/
|
||||||
public final static int SCANNER_BAD_HEX_FORMAT = SCANNER_RELATED | 0x005;
|
public final static int SCANNER_BAD_HEX_FORMAT = SCANNER_RELATED | 0x005;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unexpected EOF encountered by Scanner.
|
* Unexpected EOF encountered by Scanner. Required attributes: none.
|
||||||
* Required attributes: none.
|
|
||||||
*/
|
*/
|
||||||
public final static int SCANNER_UNEXPECTED_EOF = SCANNER_RELATED | 0x006;
|
public final static int SCANNER_UNEXPECTED_EOF = SCANNER_RELATED | 0x006;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bad octal encountered by Scanner.
|
* Bad octal encountered by Scanner. Required attributes: none.
|
||||||
* Required attributes: none.
|
|
||||||
*/
|
*/
|
||||||
public final static int SCANNER_BAD_OCTAL_FORMAT = SCANNER_RELATED | 0x007;
|
public final static int SCANNER_BAD_OCTAL_FORMAT = SCANNER_RELATED | 0x007;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bad decimal encountered by Scanner.
|
* Bad decimal encountered by Scanner. Required attributes: none.
|
||||||
* Required attributes: none.
|
|
||||||
*/
|
*/
|
||||||
public final static int SCANNER_BAD_DECIMAL_FORMAT = SCANNER_RELATED | 0x008;
|
public final static int SCANNER_BAD_DECIMAL_FORMAT = SCANNER_RELATED | 0x008;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Assignment '=' encountered in macro by Scanner.
|
* Assignment '=' encountered in macro by Scanner. Required attributes:
|
||||||
* Required attributes: none.
|
* none.
|
||||||
*/
|
*/
|
||||||
public final static int SCANNER_ASSIGNMENT_NOT_ALLOWED = SCANNER_RELATED | 0x009;
|
public final static int SCANNER_ASSIGNMENT_NOT_ALLOWED = SCANNER_RELATED | 0x009;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Division by 0 encountered in macro by Scanner.
|
* Division by 0 encountered in macro by Scanner. Required attributes: none.
|
||||||
* Required attributes: none.
|
|
||||||
*/
|
*/
|
||||||
public final static int SCANNER_DIVIDE_BY_ZERO = SCANNER_RELATED | 0x00A;
|
public final static int SCANNER_DIVIDE_BY_ZERO = SCANNER_RELATED | 0x00A;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Missing ')' encountered in macro by Scanner.
|
* Missing ')' encountered in macro by Scanner. Required attributes: none.
|
||||||
* Required attributes: none.
|
|
||||||
*/
|
*/
|
||||||
public final static int SCANNER_MISSING_R_PAREN = SCANNER_RELATED | 0x00B;
|
public final static int SCANNER_MISSING_R_PAREN = SCANNER_RELATED | 0x00B;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Expression syntax error encountered in macro by Scanner.
|
* Expression syntax error encountered in macro by Scanner. Required
|
||||||
* Required attributes: none.
|
* attributes: none.
|
||||||
*/
|
*/
|
||||||
public final static int SCANNER_EXPRESSION_SYNTAX_ERROR = SCANNER_RELATED | 0x00C;
|
public final static int SCANNER_EXPRESSION_SYNTAX_ERROR = SCANNER_RELATED | 0x00C;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Expression syntax error encountered in macro by Scanner.
|
* Expression syntax error encountered in macro by Scanner. Required
|
||||||
* Required attributes: none.
|
* attributes: none.
|
||||||
*/
|
*/
|
||||||
public final static int SCANNER_ILLEGAL_IDENTIFIER = SCANNER_RELATED | 0x00D;
|
public final static int SCANNER_ILLEGAL_IDENTIFIER = SCANNER_RELATED | 0x00D;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Division by 0 encountered in macro by Scanner.
|
* Division by 0 encountered in macro by Scanner. Required attributes: none.
|
||||||
* Required attributes: none.
|
|
||||||
*/
|
*/
|
||||||
public final static int SCANNER_BAD_CONDITIONAL_EXPRESSION = SCANNER_RELATED | 0x00E;
|
public final static int SCANNER_BAD_CONDITIONAL_EXPRESSION = SCANNER_RELATED | 0x00E;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Preprocessor Problems
|
* Preprocessor Problems
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* #error encountered by Preprocessor.
|
* #error encountered by Preprocessor. Required attributes:
|
||||||
* Required attributes: A_PREPROC_POUND_ERROR
|
* A_PREPROC_POUND_ERROR
|
||||||
|
*
|
||||||
* @see #A_PREPROC_POUND_ERROR
|
* @see #A_PREPROC_POUND_ERROR
|
||||||
*/
|
*/
|
||||||
public final static int PREPROCESSOR_POUND_ERROR = PREPROCESSOR_RELATED | 0x001;
|
public final static int PREPROCESSOR_POUND_ERROR = PREPROCESSOR_RELATED | 0x001;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inclusion not found by Preprocessor.
|
* Inclusion not found by Preprocessor. Required attributes:
|
||||||
* Required attributes: A_PREPROC_INCLUDE_FILENAME
|
* A_PREPROC_INCLUDE_FILENAME
|
||||||
|
*
|
||||||
* @see #A_PREPROC_INCLUDE_FILENAME
|
* @see #A_PREPROC_INCLUDE_FILENAME
|
||||||
*/
|
*/
|
||||||
public final static int PREPROCESSOR_INCLUSION_NOT_FOUND = PREPROCESSOR_RELATED | 0x002;
|
public final static int PREPROCESSOR_INCLUSION_NOT_FOUND = PREPROCESSOR_RELATED | 0x002;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Macro definition not found by Preprocessor.
|
* Macro definition not found by Preprocessor. Required attributes:
|
||||||
* Required attributes: A_PREPROC_MACRO_NAME
|
* A_PREPROC_MACRO_NAME
|
||||||
|
*
|
||||||
* @see #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_DEFINITION_NOT_FOUND = PREPROCESSOR_RELATED | 0x003;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Preprocessor conditionals seem unbalanced.
|
* Preprocessor conditionals seem unbalanced. Required attributes:
|
||||||
* Required attributes: A_PREPROC_CONDITIONAL_MISMATCH
|
* A_PREPROC_CONDITIONAL_MISMATCH
|
||||||
|
*
|
||||||
* @see #A_PREPROC_CONDITIONAL_MISMATCH
|
* @see #A_PREPROC_CONDITIONAL_MISMATCH
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public final static int PREPROCESSOR_UNBALANCE_CONDITION = PREPROCESSOR_RELATED | 0x004;
|
public final static int PREPROCESSOR_UNBALANCE_CONDITION = PREPROCESSOR_RELATED | 0x004;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invalid format to Macro definition.
|
* Invalid format to Macro definition. Required attributes:
|
||||||
* Required attributes: A_PREPROC_MACRO_NAME
|
* A_PREPROC_MACRO_NAME
|
||||||
|
*
|
||||||
* @see #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_INVALID_MACRO_DEFN = PREPROCESSOR_RELATED | 0x005;
|
||||||
|
@ -331,54 +343,60 @@ public interface IASTProblem extends IASTNode {
|
||||||
/**
|
/**
|
||||||
* Invalid or unknown preprocessor directive encountered by Preprocessor.
|
* Invalid or unknown preprocessor directive encountered by Preprocessor.
|
||||||
* Required attributes: A_PREPROC_UNKNOWN_DIRECTIVE
|
* Required attributes: A_PREPROC_UNKNOWN_DIRECTIVE
|
||||||
|
*
|
||||||
* @see #A_PREPROC_UNKNOWN_DIRECTIVE
|
* @see #A_PREPROC_UNKNOWN_DIRECTIVE
|
||||||
*/
|
*/
|
||||||
public final static int PREPROCESSOR_INVALID_DIRECTIVE = PREPROCESSOR_RELATED | 0x006;
|
public final static int PREPROCESSOR_INVALID_DIRECTIVE = PREPROCESSOR_RELATED | 0x006;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invalid macro redefinition encountered by Preprocessor.
|
* Invalid macro redefinition encountered by Preprocessor. Required
|
||||||
* Required attributes: A_PREPROC_MACRO_NAME
|
* attributes: A_PREPROC_MACRO_NAME
|
||||||
|
*
|
||||||
* @see #A_PREPROC_MACRO_NAME
|
* @see #A_PREPROC_MACRO_NAME
|
||||||
*/
|
*/
|
||||||
public final static int PREPROCESSOR_INVALID_MACRO_REDEFN = PREPROCESSOR_RELATED | 0x007;
|
public final static int PREPROCESSOR_INVALID_MACRO_REDEFN = PREPROCESSOR_RELATED | 0x007;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Preprocessor Conditional cannot not be evaluated due.
|
* Preprocessor Conditional cannot not be evaluated due. Required
|
||||||
* Required attributes: A_PREPROC_CONDITION
|
* attributes: A_PREPROC_CONDITION
|
||||||
|
*
|
||||||
* @see #A_PREPROC_CONDITION
|
* @see #A_PREPROC_CONDITION
|
||||||
*/
|
*/
|
||||||
public final static int PREPROCESSOR_CONDITIONAL_EVAL_ERROR = PREPROCESSOR_RELATED | 0x008;
|
public final static int PREPROCESSOR_CONDITIONAL_EVAL_ERROR = PREPROCESSOR_RELATED | 0x008;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invalid macro usage encountered by Preprocessor.
|
* Invalid macro usage encountered by Preprocessor. Required attributes:
|
||||||
* Required attributes: A_PREPROC_MACRO_NAME
|
* A_PREPROC_MACRO_NAME
|
||||||
|
*
|
||||||
* @see #A_PREPROC_MACRO_NAME
|
* @see #A_PREPROC_MACRO_NAME
|
||||||
*/
|
*/
|
||||||
public final static int PREPROCESSOR_MACRO_USAGE_ERROR = PREPROCESSOR_RELATED | 0x009;
|
public final static int PREPROCESSOR_MACRO_USAGE_ERROR = PREPROCESSOR_RELATED | 0x009;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invalid Macro Pasting encountered by Preprocessor.
|
* Invalid Macro Pasting encountered by Preprocessor. Required attributes:
|
||||||
* Required attributes: A_PREPROC_MACRO_NAME
|
* A_PREPROC_MACRO_NAME
|
||||||
|
*
|
||||||
* @see #A_PREPROC_MACRO_NAME
|
* @see #A_PREPROC_MACRO_NAME
|
||||||
*/
|
*/
|
||||||
public final static int PREPROCESSOR_MACRO_PASTING_ERROR = PREPROCESSOR_RELATED | 0x00A;
|
public final static int PREPROCESSOR_MACRO_PASTING_ERROR = PREPROCESSOR_RELATED | 0x00A;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Circular inclusion encountered by Preprocessor.
|
* Circular inclusion encountered by Preprocessor. Required attributes:
|
||||||
* Required attributes: A_PREPROC_INCLUDE_FILENAME
|
* A_PREPROC_INCLUDE_FILENAME
|
||||||
|
*
|
||||||
* @see #A_PREPROC_INCLUDE_FILENAME
|
* @see #A_PREPROC_INCLUDE_FILENAME
|
||||||
*/
|
*/
|
||||||
public final static int PREPROCESSOR_CIRCULAR_INCLUSION = PREPROCESSOR_RELATED | 0x00B;
|
public final static int PREPROCESSOR_CIRCULAR_INCLUSION = PREPROCESSOR_RELATED | 0x00B;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* macro argument "..." encountered without the required ')' i.e. must be last argument if used
|
* macro argument "..." encountered without the required ')' i.e. must be
|
||||||
* Required attributes: none
|
* last argument if used Required attributes: none
|
||||||
*/
|
*/
|
||||||
public final static int PREPROCESSOR_MISSING_RPAREN_PARMLIST = PREPROCESSOR_RELATED | 0x00C;
|
public final static int PREPROCESSOR_MISSING_RPAREN_PARMLIST = PREPROCESSOR_RELATED | 0x00C;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* __VA_ARGS__ encountered in macro definition without the required '...' parameter
|
* __VA_ARGS__ encountered in macro definition without the required '...'
|
||||||
* Required attributes: none
|
* parameter Required attributes: none
|
||||||
*/
|
*/
|
||||||
public final static int PREPROCESSOR_INVALID_VA_ARGS = PREPROCESSOR_RELATED | 0x00D;
|
public final static int PREPROCESSOR_INVALID_VA_ARGS = PREPROCESSOR_RELATED | 0x00D;
|
||||||
|
|
||||||
|
@ -387,5 +405,4 @@ public interface IASTProblem extends IASTNode {
|
||||||
*/
|
*/
|
||||||
public final static int SYNTAX_ERROR = SYNTAX_RELATED | 0x001;
|
public final static int SYNTAX_ERROR = SYNTAX_RELATED | 0x001;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,11 +11,12 @@
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
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
|
* @author jcamelon
|
||||||
*/
|
*/
|
||||||
public interface IASTProblemDeclaration extends IASTDeclaration, IASTProblemHolder {
|
public interface IASTProblemDeclaration extends IASTDeclaration,
|
||||||
|
IASTProblemHolder {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,12 +10,13 @@
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
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
|
* @author jcamelon
|
||||||
*/
|
*/
|
||||||
public interface IASTProblemExpression extends IASTExpression, IASTProblemHolder {
|
public interface IASTProblemExpression extends IASTExpression,
|
||||||
|
IASTProblemHolder {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,25 +11,30 @@
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
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
|
* @author jcamelon
|
||||||
*/
|
*/
|
||||||
public interface IASTProblemHolder {
|
public interface IASTProblemHolder {
|
||||||
/**
|
/**
|
||||||
* <code>PROBLEM</code> represents the relationship between a <code>IASTProblemHolder</code> and its <code>IASTProblem</code>.
|
* <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$
|
public static final ASTNodeProperty PROBLEM = new ASTNodeProperty("Problem"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the problem.
|
* Get the problem.
|
||||||
*
|
*
|
||||||
* @return <code>IASTProblem</code>
|
* @return <code>IASTProblem</code>
|
||||||
*/
|
*/
|
||||||
public IASTProblem getProblem();
|
public IASTProblem getProblem();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the problem.
|
* Set the problem.
|
||||||
*
|
*
|
||||||
* @param p <code>IASTProblem</code>
|
* @param p
|
||||||
|
* <code>IASTProblem</code>
|
||||||
*/
|
*/
|
||||||
public void setProblem(IASTProblem p);
|
public void setProblem(IASTProblem p);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,10 +11,11 @@
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
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
|
* @author jcamelon
|
||||||
*/
|
*/
|
||||||
public interface IASTProblemStatement extends IASTStatement, IASTProblemHolder {
|
public interface IASTProblemStatement extends IASTStatement, IASTProblemHolder {
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,8 @@
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
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
|
* @author jcamelon
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -15,7 +15,13 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
*/
|
*/
|
||||||
public interface IASTReturnStatement extends IASTStatement {
|
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.
|
* This is the optional return value for this function.
|
||||||
|
@ -24,6 +30,12 @@ public interface IASTReturnStatement extends IASTStatement {
|
||||||
*/
|
*/
|
||||||
public IASTExpression getReturnValue();
|
public IASTExpression getReturnValue();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the return value.
|
||||||
|
*
|
||||||
|
* @param returnValue
|
||||||
|
* <code>IASTExpression</code>
|
||||||
|
*/
|
||||||
public void setReturnValue(IASTExpression returnValue);
|
public void setReturnValue(IASTExpression returnValue);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,32 +18,117 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
public interface IASTSimpleDeclSpecifier extends IASTDeclSpecifier {
|
public interface IASTSimpleDeclSpecifier extends IASTDeclSpecifier {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This returns the built-in type for the declaration. The type is
|
* This returns the built-in type for the declaration. The type is then
|
||||||
* then refined by qualifiers for signed/unsigned and short/long.
|
* refined by qualifiers for signed/unsigned and short/long. The type could
|
||||||
* The type could also be unspecified which usually means int.
|
* also be unspecified which usually means int.
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public int getType();
|
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;
|
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;
|
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;
|
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;
|
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;
|
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;
|
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 static final int t_last = t_double; // used only in subclasses
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set this decl specifier type to <code>type</code>.
|
||||||
|
*
|
||||||
|
* @param type
|
||||||
|
* (int)
|
||||||
|
*/
|
||||||
public void setType(int type);
|
public void setType(int type);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is the type modified by the signed keyword?
|
||||||
|
*
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
public boolean isSigned();
|
public boolean isSigned();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is the type modified by the unsigned keyword?
|
||||||
|
*
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
public boolean isUnsigned();
|
public boolean isUnsigned();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is the type modified by the short keyword?
|
||||||
|
*
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
public boolean isShort();
|
public boolean isShort();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is the type modified by the long keyword?
|
||||||
|
*
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
public boolean isLong();
|
public boolean isLong();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Change as to if the type is modified by the keyword signed.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* boolean
|
||||||
|
*/
|
||||||
public void setSigned(boolean value);
|
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);
|
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);
|
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);
|
public void setShort(boolean value);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a simple declaration which contains a sequence of declSpecifiers
|
* This is a simple declaration which contains a sequence of declSpecifiers
|
||||||
* followed by a list of declarators.
|
* followed by a list of declarators.
|
||||||
|
@ -19,8 +18,21 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
*/
|
*/
|
||||||
public interface IASTSimpleDeclaration extends IASTDeclaration, IASTNode {
|
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
|
* This returns the object representing the declSpecifiers for this
|
||||||
|
@ -30,15 +42,27 @@ public interface IASTSimpleDeclaration extends IASTDeclaration, IASTNode {
|
||||||
*/
|
*/
|
||||||
public IASTDeclSpecifier getDeclSpecifier();
|
public IASTDeclSpecifier getDeclSpecifier();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the decl specifier.
|
||||||
|
*
|
||||||
|
* @param declSpec
|
||||||
|
* <code>IASTDeclSpecifier</code>
|
||||||
|
*/
|
||||||
public void setDeclSpecifier(IASTDeclSpecifier declSpec);
|
public void setDeclSpecifier(IASTDeclSpecifier declSpec);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This returns the list of declarators in this declaration.
|
* This returns the list of declarators in this declaration.
|
||||||
*
|
*
|
||||||
* @return list of IASTDeclarator
|
* @return <code>IASTDeclarator []</code>
|
||||||
*/
|
*/
|
||||||
public IASTDeclarator[] getDeclarators();
|
public IASTDeclarator[] getDeclarators();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a declarator.
|
||||||
|
*
|
||||||
|
* @param declarator
|
||||||
|
* <code>IASTDeclarator</code>
|
||||||
|
*/
|
||||||
public void addDeclarator(IASTDeclarator declarator);
|
public void addDeclarator(IASTDeclarator declarator);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a declarator for a non K&R C function.
|
* 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 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
|
* Gets the parameter declarations for the function
|
||||||
*
|
*
|
||||||
* @return List of IASTParameterDeclaration
|
* @return array of IASTParameterDeclaration
|
||||||
*/
|
*/
|
||||||
public IASTParameterDeclaration[] getParameters();
|
public IASTParameterDeclaration[] getParameters();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a parameter.
|
||||||
|
*
|
||||||
|
* @param parameter
|
||||||
|
* <code>IASTParameterDeclaration</code>
|
||||||
|
*/
|
||||||
public void addParameterDeclaration(IASTParameterDeclaration parameter);
|
public void addParameterDeclaration(IASTParameterDeclaration parameter);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Does this function take a variable number of arguments?
|
||||||
|
*
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
public boolean takesVarArgs();
|
public boolean takesVarArgs();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set whether or not this function takes a variable number or arguments.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* boolean
|
||||||
|
*/
|
||||||
public void setVarArgs(boolean value);
|
public void setVarArgs(boolean value);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Common Public License v1.0
|
* are made available under the terms of the Common Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -16,6 +16,9 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
* @author Doug Schaefer
|
* @author Doug Schaefer
|
||||||
*/
|
*/
|
||||||
public interface IASTStatement extends IASTNode {
|
public interface IASTStatement extends IASTNode {
|
||||||
|
/**
|
||||||
|
* Constant.
|
||||||
|
*/
|
||||||
public static final IASTStatement[] EMPTY_STATEMENT_ARRAY = new IASTStatement[0];
|
public static final IASTStatement[] EMPTY_STATEMENT_ARRAY = new IASTStatement[0];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,19 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
*/
|
*/
|
||||||
public interface IASTSwitchStatement extends IASTStatement {
|
public interface IASTSwitchStatement extends IASTStatement {
|
||||||
|
|
||||||
public static final ASTNodeProperty CONTROLLER = new ASTNodeProperty("controller"); //$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$
|
public static final ASTNodeProperty BODY = new ASTNodeProperty("body"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -27,17 +39,29 @@ public interface IASTSwitchStatement extends IASTStatement {
|
||||||
*/
|
*/
|
||||||
public IASTExpression getController();
|
public IASTExpression getController();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the controlling expression for the switch.
|
||||||
|
*
|
||||||
|
* @param controller
|
||||||
|
* <code>IASTExpression</code>
|
||||||
|
*/
|
||||||
public void setController(IASTExpression controller);
|
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
|
* TODO - finding the cases could be a logical thing
|
||||||
*
|
*
|
||||||
* @return
|
* @return <code>IASTStatement</code>
|
||||||
*/
|
*/
|
||||||
public IASTStatement getBody();
|
public IASTStatement getBody();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the body for the switch statement.
|
||||||
|
*
|
||||||
|
* @param body
|
||||||
|
* <code>IASTStatement</code>
|
||||||
|
*/
|
||||||
public void setBody(IASTStatement body);
|
public void setBody(IASTStatement body);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,12 +17,26 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
*/
|
*/
|
||||||
public interface IASTTranslationUnit extends IASTNode {
|
public interface IASTTranslationUnit extends IASTNode {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <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(
|
public static final ASTNodeProperty OWNED_DECLARATION = new ASTNodeProperty(
|
||||||
"Owned"); //$NON-NLS-1$
|
"Owned"); //$NON-NLS-1$
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <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(
|
public static final ASTNodeProperty SCANNER_PROBLEM = new ASTNodeProperty(
|
||||||
"Scanner Problem"); //$NON-NLS-1$
|
"Scanner Problem"); //$NON-NLS-1$
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <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(
|
public static final ASTNodeProperty PREPROCESSOR_STATEMENT = new ASTNodeProperty(
|
||||||
"Inclusion"); //$NON-NLS-1$
|
"PP Statement"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A translation unit contains an ordered sequence of declarations.
|
* A translation unit contains an ordered sequence of declarations.
|
||||||
|
@ -31,6 +45,11 @@ public interface IASTTranslationUnit extends IASTNode {
|
||||||
*/
|
*/
|
||||||
public IASTDeclaration[] getDeclarations();
|
public IASTDeclaration[] getDeclarations();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add declaration to translation unit.
|
||||||
|
*
|
||||||
|
* @param declaration <code>IASTDeclaration</code>
|
||||||
|
*/
|
||||||
public void addDeclaration(IASTDeclaration declaration);
|
public void addDeclaration(IASTDeclaration declaration);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -51,27 +70,68 @@ public interface IASTTranslationUnit extends IASTNode {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the list of references in this translation unit to the given
|
* 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. This list contains the IASTName nodes that represent a use of
|
||||||
* binding.
|
* the binding.
|
||||||
*
|
*
|
||||||
* @param binding
|
* @param binding
|
||||||
* @return List of IASTName nodes representing uses of the binding
|
* @return List of IASTName nodes representing uses of the binding
|
||||||
*/
|
*/
|
||||||
public IASTName[] getReferences(IBinding binding);
|
public IASTName[] getReferences(IBinding binding);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param offset
|
||||||
|
* @param length
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public IASTNodeLocation[] getLocationInfo(int offset, int length);
|
public IASTNodeLocation[] getLocationInfo(int offset, int length);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 IASTNode selectNodeForLocation(String path, int offset, int length);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the macro definitions encountered in parsing this translation unit.
|
||||||
|
*
|
||||||
|
* @return <code>IASTPreprocessorMacroDefinition[]</code>
|
||||||
|
*/
|
||||||
public IASTPreprocessorMacroDefinition[] getMacroDefinitions();
|
public IASTPreprocessorMacroDefinition[] getMacroDefinitions();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the #include directives encountered in parsing this translation unit.
|
||||||
|
* @return <code>IASTPreprocessorIncludeStatement[]</code>
|
||||||
|
*/
|
||||||
public IASTPreprocessorIncludeStatement[] getIncludeDirectives();
|
public IASTPreprocessorIncludeStatement[] getIncludeDirectives();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get all preprocessor statements.
|
||||||
|
*
|
||||||
|
* @return <code>IASTPreprocessorStatement[]</code>
|
||||||
|
*/
|
||||||
public IASTPreprocessorStatement[] getAllPreprocessorStatements();
|
public IASTPreprocessorStatement[] getAllPreprocessorStatements();
|
||||||
|
|
||||||
public IASTProblem[] getPreprocesorProblems();
|
/**
|
||||||
|
* 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);
|
public String getUnpreprocessedSignature(IASTNodeLocation[] locations);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the translation unit's full path.
|
||||||
|
* @return String representation of path.
|
||||||
|
*/
|
||||||
public String getFilePath();
|
public String getFilePath();
|
||||||
}
|
}
|
|
@ -14,13 +14,47 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
*/
|
*/
|
||||||
public interface IASTTypeId extends IASTNode {
|
public interface IASTTypeId extends IASTNode {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constant.
|
||||||
|
*/
|
||||||
public static final IASTTypeId[] EMPTY_TYPEID_ARRAY = new IASTTypeId[0];
|
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$
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <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();
|
public IASTDeclSpecifier getDeclSpecifier();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the decl specifier.
|
||||||
|
* @param declSpec <code>IASTDeclSpecifier</code>
|
||||||
|
*/
|
||||||
public void setDeclSpecifier(IASTDeclSpecifier declSpec);
|
public void setDeclSpecifier(IASTDeclSpecifier declSpec);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the abstract declarator.
|
||||||
|
*
|
||||||
|
* @return <code>IASTDeclarator</code>
|
||||||
|
*/
|
||||||
public IASTDeclarator getAbstractDeclarator();
|
public IASTDeclarator getAbstractDeclarator();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the abstract declarator.
|
||||||
|
* @param abstractDeclarator <code>IASTDeclarator</code>
|
||||||
|
*/
|
||||||
public void setAbstractDeclarator(IASTDeclarator abstractDeclarator);
|
public void setAbstractDeclarator(IASTDeclarator abstractDeclarator);
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,14 +14,46 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
*/
|
*/
|
||||||
public interface IASTTypeIdExpression extends IASTExpression {
|
public interface IASTTypeIdExpression extends IASTExpression {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <code>op_sizeof</code> sizeof( typeId ) expression
|
||||||
|
*/
|
||||||
public static final int op_sizeof = 0;
|
public static final int op_sizeof = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <code>op_last</code> defined for sub-interfaces to extend.
|
||||||
|
*/
|
||||||
public static final int op_last = op_sizeof;
|
public static final int op_last = op_sizeof;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the operator for the expression.
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
public int getOperator();
|
public int getOperator();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the operator for the expression.
|
||||||
|
* @param value int
|
||||||
|
*/
|
||||||
public void setOperator(int value);
|
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$
|
public static final ASTNodeProperty TYPE_ID = new ASTNodeProperty("Type Id"); //$NON-NLS-1$
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the type Id.
|
||||||
|
* @param typeId
|
||||||
|
*/
|
||||||
public void setTypeId(IASTTypeId typeId);
|
public void setTypeId(IASTTypeId typeId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the type Id.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public IASTTypeId getTypeId();
|
public IASTTypeId getTypeId();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,31 +10,121 @@
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* This interface is used to represent a unary expression in the AST.
|
||||||
|
*
|
||||||
* @author jcamelon
|
* @author jcamelon
|
||||||
*/
|
*/
|
||||||
public interface IASTUnaryExpression extends IASTExpression {
|
public interface IASTUnaryExpression extends IASTExpression {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prefix increment.
|
||||||
|
* <code>op_prefixIncr</code> ++exp
|
||||||
|
*/
|
||||||
public static final int op_prefixIncr = 0;
|
public static final int op_prefixIncr = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prefix decrement.
|
||||||
|
* <code>op_prefixDecr</code> --exp
|
||||||
|
*/
|
||||||
public static final int op_prefixDecr = 1;
|
public static final int op_prefixDecr = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Operator plus.
|
||||||
|
* <code>op_plus</code> ==> + exp
|
||||||
|
*/
|
||||||
public static final int op_plus = 2;
|
public static final int op_plus = 2;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Operator minus.
|
||||||
|
* <code>op_minux</code> ==> -exp
|
||||||
|
*/
|
||||||
public static final int op_minus = 3;
|
public static final int op_minus = 3;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Operator star.
|
||||||
|
* <code>op_star</code> ==> *exp
|
||||||
|
*/
|
||||||
public static final int op_star = 4;
|
public static final int op_star = 4;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Operator ampersand.
|
||||||
|
* <code>op_amper</code> ==> &exp
|
||||||
|
*/
|
||||||
public static final int op_amper = 5;
|
public static final int op_amper = 5;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Operator tilde.
|
||||||
|
* <code>op_tilde</code> ==> ~exp
|
||||||
|
*/
|
||||||
public static final int op_tilde = 6;
|
public static final int op_tilde = 6;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* not.
|
||||||
|
* <code>op_not</code> ==> ! exp
|
||||||
|
*/
|
||||||
public static final int op_not = 7;
|
public static final int op_not = 7;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sizeof.
|
||||||
|
* <code>op_sizeof</code> ==> sizeof exp
|
||||||
|
*/
|
||||||
public static final int op_sizeof = 8;
|
public static final int op_sizeof = 8;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Postfix increment.
|
||||||
|
* <code>op_postFixIncr</code> ==> exp++
|
||||||
|
*/
|
||||||
public static final int op_postFixIncr = 9;
|
public static final int op_postFixIncr = 9;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Postfix decrement.
|
||||||
|
* <code>op_bracketedPrimary</code> ==> exp--
|
||||||
|
*/
|
||||||
public static final int op_postFixDecr = 10;
|
public static final int op_postFixDecr = 10;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A bracketed expression.
|
||||||
|
* <code>op_bracketedPrimary</code> ==> ( exp )
|
||||||
|
*/
|
||||||
public static final int op_bracketedPrimary = 11;
|
public static final int op_bracketedPrimary = 11;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <code>op_last</code> is made available for subclasses.
|
||||||
|
*/
|
||||||
public static final int op_last = op_bracketedPrimary;
|
public static final int op_last = op_bracketedPrimary;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the operator/kind.
|
||||||
|
*
|
||||||
|
* @return (int)
|
||||||
|
*/
|
||||||
public int getOperator();
|
public int getOperator();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the operator/kind.
|
||||||
|
*
|
||||||
|
* @param value (int) value
|
||||||
|
*/
|
||||||
public void setOperator(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$
|
public static final ASTNodeProperty OPERAND = new ASTNodeProperty("Operand"); //$NON-NLS-1$
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the operand.
|
||||||
|
*
|
||||||
|
* @return <code>IASTExpression</code>
|
||||||
|
*/
|
||||||
public IASTExpression getOperand();
|
public IASTExpression getOperand();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the operand.
|
||||||
|
*
|
||||||
|
* @param expression <code>IASTExpression</code>
|
||||||
|
*/
|
||||||
public void setOperand(IASTExpression expression);
|
public void setOperand(IASTExpression expression);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,15 +17,31 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
*/
|
*/
|
||||||
public interface IASTWhileStatement extends IASTStatement {
|
public interface IASTWhileStatement extends IASTStatement {
|
||||||
|
|
||||||
public static final ASTNodeProperty CONDITIONEXPRESSION = new ASTNodeProperty("condition"); //$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$
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <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$
|
public static final ASTNodeProperty BODY = new ASTNodeProperty("body"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The condition on the while loop
|
* Get the condition on the while loop
|
||||||
*
|
*
|
||||||
* @return expression for the condition
|
* @return expression for the condition
|
||||||
*/
|
*/
|
||||||
public IASTExpression getCondition();
|
public IASTExpression getCondition();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the condition of the while loop.
|
||||||
|
*
|
||||||
|
* @param condition
|
||||||
|
*/
|
||||||
public void setCondition(IASTExpression condition);
|
public void setCondition(IASTExpression condition);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -35,6 +51,11 @@ public interface IASTWhileStatement extends IASTStatement {
|
||||||
*/
|
*/
|
||||||
public IASTStatement getBody();
|
public IASTStatement getBody();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the body of the while loop.
|
||||||
|
*
|
||||||
|
* @param body
|
||||||
|
*/
|
||||||
public void setBody(IASTStatement body);
|
public void setBody(IASTStatement body);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -447,7 +447,7 @@ public class CASTTranslationUnit extends CASTNode implements
|
||||||
*
|
*
|
||||||
* @see org.eclipse.cdt.core.dom.ast.IASTTranslationUnit#getPreprocesorProblems()
|
* @see org.eclipse.cdt.core.dom.ast.IASTTranslationUnit#getPreprocesorProblems()
|
||||||
*/
|
*/
|
||||||
public IASTProblem[] getPreprocesorProblems() {
|
public IASTProblem[] getPreprocessorProblems() {
|
||||||
if (resolver == null)
|
if (resolver == null)
|
||||||
return EMPTY_PROBLEM_ARRAY;
|
return EMPTY_PROBLEM_ARRAY;
|
||||||
IASTProblem[] result = resolver.getScannerProblems();
|
IASTProblem[] result = resolver.getScannerProblems();
|
||||||
|
|
|
@ -432,7 +432,7 @@ public class CPPASTTranslationUnit extends CPPASTNode implements
|
||||||
*
|
*
|
||||||
* @see org.eclipse.cdt.core.dom.ast.IASTTranslationUnit#getPreprocesorProblems()
|
* @see org.eclipse.cdt.core.dom.ast.IASTTranslationUnit#getPreprocesorProblems()
|
||||||
*/
|
*/
|
||||||
public IASTProblem[] getPreprocesorProblems() {
|
public IASTProblem[] getPreprocessorProblems() {
|
||||||
if (resolver == null)
|
if (resolver == null)
|
||||||
return EMPTY_PROBLEM_ARRAY;
|
return EMPTY_PROBLEM_ARRAY;
|
||||||
IASTProblem[] result = resolver.getScannerProblems();
|
IASTProblem[] result = resolver.getScannerProblems();
|
||||||
|
|
|
@ -384,7 +384,7 @@ public class DOMAST extends ViewPart {
|
||||||
if (monitor.isCanceled()) return Status.CANCEL_STATUS;
|
if (monitor.isCanceled()) return Status.CANCEL_STATUS;
|
||||||
monitor.subTask(RETRIEVING_PREPROCESSOR_PROBLEMS);
|
monitor.subTask(RETRIEVING_PREPROCESSOR_PROBLEMS);
|
||||||
start=System.currentTimeMillis();
|
start=System.currentTimeMillis();
|
||||||
IASTProblem[] problems = tu.getPreprocesorProblems();
|
IASTProblem[] problems = tu.getPreprocessorProblems();
|
||||||
monitor.worked(5);
|
monitor.worked(5);
|
||||||
System.out.println("[DOM AST View] done " + RETRIEVING_PREPROCESSOR_PROBLEMS + ": " + (System.currentTimeMillis()- start) );
|
System.out.println("[DOM AST View] done " + RETRIEVING_PREPROCESSOR_PROBLEMS + ": " + (System.currentTimeMillis()- start) );
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue