From 834e06e8fcfd16f5d92b7798d9a9f6093fa1b4dc Mon Sep 17 00:00:00 2001 From: John Camelon Date: Fri, 11 Mar 2005 19:51:49 +0000 Subject: [PATCH] Add JavaDoc. Formatted public interfaces. Restructured some public interfaces. --- .../core/parser/tests/ast2/AST2BaseTest.java | 4 +- .../cdt/core/dom/ICodeReaderFactory.java | 47 +- .../cdt/core/dom/IParserConfiguration.java | 25 +- .../cdt/core/dom/ast/ASTCompletionNode.java | 31 +- .../cdt/core/dom/ast/ASTNodeProperty.java | 49 +- .../org/eclipse/cdt/core/dom/ast/ASTUtil.java | 464 ++++++++---- .../eclipse/cdt/core/dom/ast/ASTVisitor.java | 104 ++- .../cdt/core/dom/ast/DOMException.java | 44 +- .../cdt/core/dom/ast/IASTASMDeclaration.java | 24 +- .../cdt/core/dom/ast/IASTArrayDeclarator.java | 22 +- .../cdt/core/dom/ast/IASTArrayModifier.java | 52 +- .../dom/ast/IASTArraySubscriptExpression.java | 77 +- .../core/dom/ast/IASTBinaryExpression.java | 130 ++-- .../cdt/core/dom/ast/IASTCaseStatement.java | 27 +- .../cdt/core/dom/ast/IASTCastExpression.java | 81 +- .../dom/ast/IASTCompositeTypeSpecifier.java | 59 +- .../core/dom/ast/IASTCompoundStatement.java | 26 +- .../dom/ast/IASTConditionalExpression.java | 120 +-- .../core/dom/ast/IASTContinueStatement.java | 2 +- .../cdt/core/dom/ast/IASTDeclSpecifier.java | 54 +- .../cdt/core/dom/ast/IASTDeclaration.java | 2 +- .../dom/ast/IASTDeclarationStatement.java | 16 +- .../cdt/core/dom/ast/IASTDeclarator.java | 101 +-- .../core/dom/ast/IASTDefaultStatement.java | 6 +- .../cdt/core/dom/ast/IASTDoStatement.java | 38 +- .../dom/ast/IASTElaboratedTypeSpecifier.java | 98 +-- .../dom/ast/IASTEnumerationSpecifier.java | 178 +++-- .../cdt/core/dom/ast/IASTExpression.java | 8 +- .../cdt/core/dom/ast/IASTExpressionList.java | 39 +- .../core/dom/ast/IASTExpressionStatement.java | 16 +- .../cdt/core/dom/ast/IASTFieldDeclarator.java | 26 +- .../cdt/core/dom/ast/IASTFieldReference.java | 65 +- .../cdt/core/dom/ast/IASTForStatement.java | 113 +-- .../dom/ast/IASTFunctionCallExpression.java | 85 ++- .../core/dom/ast/IASTFunctionDeclarator.java | 1 - .../core/dom/ast/IASTFunctionDefinition.java | 60 +- .../ast/IASTFunctionStyleMacroParameter.java | 12 +- .../cdt/core/dom/ast/IASTGotoStatement.java | 11 +- .../cdt/core/dom/ast/IASTIdExpression.java | 15 +- .../cdt/core/dom/ast/IASTIfStatement.java | 60 +- .../cdt/core/dom/ast/IASTInitializer.java | 4 +- .../dom/ast/IASTInitializerExpression.java | 20 +- .../cdt/core/dom/ast/IASTInitializerList.java | 18 +- .../cdt/core/dom/ast/IASTLabelStatement.java | 4 +- .../core/dom/ast/IASTLiteralExpression.java | 88 +-- .../cdt/core/dom/ast/IASTMacroExpansion.java | 8 +- .../eclipse/cdt/core/dom/ast/IASTName.java | 16 +- .../core/dom/ast/IASTNamedTypeSpecifier.java | 22 +- .../eclipse/cdt/core/dom/ast/IASTNode.java | 11 +- .../cdt/core/dom/ast/IASTNodeLocation.java | 11 +- .../cdt/core/dom/ast/IASTNullStatement.java | 4 +- .../dom/ast/IASTParameterDeclaration.java | 73 +- .../eclipse/cdt/core/dom/ast/IASTPointer.java | 16 +- .../cdt/core/dom/ast/IASTPointerOperator.java | 8 +- .../ast/IASTPreprocessorElifStatement.java | 17 +- .../ast/IASTPreprocessorElseStatement.java | 14 +- .../ast/IASTPreprocessorEndifStatement.java | 6 +- .../ast/IASTPreprocessorErrorStatement.java | 2 +- ...processorFunctionStyleMacroDefinition.java | 12 +- .../dom/ast/IASTPreprocessorIfStatement.java | 13 +- .../ast/IASTPreprocessorIfdefStatement.java | 15 +- .../ast/IASTPreprocessorIfndefStatement.java | 13 +- .../ast/IASTPreprocessorIncludeStatement.java | 2 + .../ast/IASTPreprocessorMacroDefinition.java | 67 +- ...reprocessorObjectStyleMacroDefinition.java | 7 +- .../ast/IASTPreprocessorPragmaStatement.java | 2 +- .../ast/IASTPreprocessorUndefStatement.java | 5 +- .../eclipse/cdt/core/dom/ast/IASTProblem.java | 695 +++++++++--------- .../core/dom/ast/IASTProblemDeclaration.java | 7 +- .../core/dom/ast/IASTProblemExpression.java | 7 +- .../cdt/core/dom/ast/IASTProblemHolder.java | 39 +- .../core/dom/ast/IASTProblemStatement.java | 5 +- .../cdt/core/dom/ast/IASTProblemTypeId.java | 3 +- .../cdt/core/dom/ast/IASTReturnStatement.java | 18 +- .../core/dom/ast/IASTSimpleDeclSpecifier.java | 111 ++- .../core/dom/ast/IASTSimpleDeclaration.java | 44 +- .../ast/IASTStandardFunctionDeclarator.java | 39 +- .../cdt/core/dom/ast/IASTStatement.java | 7 +- .../cdt/core/dom/ast/IASTSwitchStatement.java | 40 +- .../cdt/core/dom/ast/IASTTranslationUnit.java | 152 ++-- .../eclipse/cdt/core/dom/ast/IASTTypeId.java | 54 +- .../core/dom/ast/IASTTypeIdExpression.java | 50 +- .../cdt/core/dom/ast/IASTUnaryExpression.java | 136 +++- .../cdt/core/dom/ast/IASTWhileStatement.java | 31 +- .../dom/parser/c/CASTTranslationUnit.java | 2 +- .../dom/parser/cpp/CPPASTTranslationUnit.java | 2 +- .../eclipse/cdt/ui/tests/DOMAST/DOMAST.java | 2 +- 87 files changed, 2610 insertions(+), 1704 deletions(-) diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2BaseTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2BaseTest.java index d48dbb86b78..a0d860ae238 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2BaseTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2BaseTest.java @@ -124,12 +124,12 @@ public class AST2BaseTest extends TestCase { if( lang == ParserLanguage.C && expectNoProblems ) { assertEquals( CVisitor.getProblems(tu).length, 0 ); - assertEquals( tu.getPreprocesorProblems().length, 0 ); + assertEquals( tu.getPreprocessorProblems().length, 0 ); } else if ( lang == ParserLanguage.CPP && expectNoProblems ) { assertEquals( CPPVisitor.getProblems(tu).length, 0 ); - assertEquals( tu.getPreprocesorProblems().length, 0 ); + assertEquals( tu.getPreprocessorProblems().length, 0 ); } return tu; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ICodeReaderFactory.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ICodeReaderFactory.java index 98f5d7693e7..83fe29cefe8 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ICodeReaderFactory.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ICodeReaderFactory.java @@ -14,33 +14,32 @@ import org.eclipse.cdt.core.parser.CodeReader; /** * This is the interface that an AST Service uses to delegate the construction - * of a CodeReader. + * of a CodeReader. * * @author jcamelon */ public interface ICodeReaderFactory { - - /** - * @return unique identifier as int - */ - public int getUniqueIdentifier(); - - - /** - * Create CodeReader for translation unit - * - * @param path Canonical Path representing path location for file to be opened - * @return CodeReader for contents at that path. - */ - public CodeReader createCodeReaderForTranslationUnit( String path ); - - - /** - * Create CodeReader for inclusion. - * - * @param path - * @return CodeReader for contents at that path. - */ - public CodeReader createCodeReaderForInclusion( String path ); + /** + * @return unique identifier as int + */ + public int getUniqueIdentifier(); + + /** + * Create CodeReader for translation unit + * + * @param path + * Canonical Path representing path location for file to be + * opened + * @return CodeReader for contents at that path. + */ + public CodeReader createCodeReaderForTranslationUnit(String path); + + /** + * Create CodeReader for inclusion. + * + * @param path + * @return CodeReader for contents at that path. + */ + public CodeReader createCodeReaderForInclusion(String path); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/IParserConfiguration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/IParserConfiguration.java index 3046881a146..406d0a52b54 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/IParserConfiguration.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/IParserConfiguration.java @@ -13,22 +13,23 @@ package org.eclipse.cdt.core.dom; import org.eclipse.cdt.core.parser.IScannerInfo; /** - * This interface represents a parser configuration as specified by the - * client to the parser service. + * This interface represents a parser configuration as specified by the client + * to the parser service. * * @author jcamelon */ public interface IParserConfiguration { - /** - * @return IScannerInfo representing the build information required to parse. - */ - public IScannerInfo getScannerInfo(); - - //TODO this may change - /** - * @return String representing dialect name for the language - */ - public String getParserDialect(); + /** + * @return IScannerInfo representing the build information required to + * parse. + */ + public IScannerInfo getScannerInfo(); + + // TODO this may change + /** + * @return String representing dialect name for the language + */ + public String getParserDialect(); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTCompletionNode.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTCompletionNode.java index d4dc4c56c97..82a269a9938 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTCompletionNode.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTCompletionNode.java @@ -13,27 +13,29 @@ import java.util.List; import org.eclipse.cdt.core.parser.IToken; /** - * This class represents the node that would occur at the point of - * a context completion. + * This class represents the node that would occur at the point of a context + * completion. * - * This node may contain the prefix text of an identifer up to the point. - * If there is no prefix, the completion occurred at the point where a - * new token would have begun. + * This node may contain the prefix text of an identifer up to the point. If + * there is no prefix, the completion occurred at the point where a new token + * would have begun. * - * The node points to the parent node where this node, if replaced by - * a proper node, would reside in the tree. + * The node points to the parent node where this node, if replaced by a proper + * node, would reside in the tree. * * @author Doug Schaefer */ public class ASTCompletionNode { private IToken completionToken; + private List names = new ArrayList(); /** * Only constructor. * - * @param completionToken - the completion token + * @param completionToken - + * the completion token */ public ASTCompletionNode(IToken completionToken) { this.completionToken = completionToken; @@ -47,10 +49,10 @@ public class ASTCompletionNode { public void addName(IASTName name) { names.add(name); } - + /** - * If the point of completion was at the end of a potential - * identifier, this string contains the text of that identifier. + * If the point of completion was at the end of a potential identifier, this + * string contains the text of that identifier. * * @return the prefix text up to the point of completion */ @@ -66,15 +68,14 @@ public class ASTCompletionNode { public int getLength() { return completionToken.getLength(); } - - + /** * Get a list of names that fit in this context. * * @return array of IASTName's */ public IASTName[] getNames() { - return (IASTName[])names.toArray(new IASTName[names.size()]); + return (IASTName[]) names.toArray(new IASTName[names.size()]); } - + } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTNodeProperty.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTNodeProperty.java index 4a07d016d4d..f396097f9ac 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTNodeProperty.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTNodeProperty.java @@ -11,10 +11,10 @@ package org.eclipse.cdt.core.dom.ast; /** - * This interface represents a structural property in an IASTNode. - * This is used to determine the relationship between a child node and - * it's parent. This is especially important with rewrite since we need - * to understand how to properly replace the child in the source. + * This interface represents a structural property in an IASTNode. This is used + * to determine the relationship between a child node and it's parent. This is + * especially important with rewrite since we need to understand how to properly + * replace the child in the source. * * @author Doug Schaefer */ @@ -22,30 +22,29 @@ public class ASTNodeProperty { private String name; - /** - * @param n name - */ - public ASTNodeProperty(String n) { - this.name = n; - } + /** + * @param n + * name + */ + public ASTNodeProperty(String n) { + this.name = n; + } - - /** - * Each property has a name to help distinguish it from other - * properties of a node. + /** + * Each property has a name to help distinguish it from other properties of + * a node. * * @return the name of the property */ - public String getName() - { - return name; + public String getName() { + return name; + } + + /** + * @param name + * The name to set. + */ + public void setName(String name) { + this.name = name; } - - - /** - * @param name The name to set. - */ - public void setName(String name) { - this.name = name; - } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTUtil.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTUtil.java index e467919893e..0eb64929c1e 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTUtil.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTUtil.java @@ -38,22 +38,27 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPVisitor; */ public class ASTUtil { - + private static final String COMMA_SPACE = ", "; //$NON-NLS-1$ + private static final String EMPTY_STRING = ""; //$NON-NLS-1$ + private static final String SPACE = " "; //$NON-NLS-1$ + private static final String[] EMPTY_STRING_ARRAY = new String[0]; + private static final int DEAULT_ITYPE_SIZE = 2; public static String getParameterTypeString(IFunctionType type) { StringBuffer result = new StringBuffer(); String[] parms = getParameterTypeStringArray(type); - + result.append(Keywords.cpLPAREN); - for(int i=0; i=0; j--) { + + // pop all of the types off of the stack, and build the string + // representation while doing so + for (int j = types.length - 1; j >= 0; j--) { if (types[j] != null) result.append(getTypeString(types[j])); - - if (types[j] != null && j>0) result.append(SPACE); + + if (types[j] != null && j > 0) + result.append(SPACE); } - + return result.toString(); } - + public static String getDeclaratorType(IASTDeclarator decltor) { // get the most nested declarator - while(decltor.getNestedDeclarator() != null) + while (decltor.getNestedDeclarator() != null) decltor = decltor.getNestedDeclarator(); - + IBinding binding = decltor.getName().resolveBinding(); IType type = null; - + try { if (binding instanceof CExternalFunction) { - type = ((CExternalFunction)binding).getType(); + type = ((CExternalFunction) binding).getType(); } else if (binding instanceof CExternalVariable) { - type = ((CExternalVariable)binding).getType(); + type = ((CExternalVariable) binding).getType(); } else if (binding instanceof IEnumerator) { - type = ((IEnumerator)binding).getType(); + type = ((IEnumerator) binding).getType(); } else if (binding instanceof IFunction) { - type = ((IFunction)binding).getType(); + type = ((IFunction) binding).getType(); } else if (binding instanceof ITypedef) { - type = ((ITypedef)binding).getType(); + type = ((ITypedef) binding).getType(); } else if (binding instanceof IVariable) { - type = ((IVariable)binding).getType(); + type = ((IVariable) binding).getType(); } } catch (DOMException e) { return EMPTY_STRING; } - + if (type != null) { return getType(type); } - + return EMPTY_STRING; } /** - * Return's the String representation of a node's type (if available). This is - * currently only being used for testing. + * Return's the String representation of a node's type (if available). This + * is currently only being used for testing. * * TODO Remove this function when done testing if it is no longer needed * @@ -306,37 +439,44 @@ public class ASTUtil { public static String getNodeType(IASTNode node) { try { if (node instanceof IASTDeclarator) - return getDeclaratorType((IASTDeclarator)node); - if (node instanceof IASTName && ((IASTName)node).resolveBinding() instanceof IVariable) - return getType(((IVariable)((IASTName)node).resolveBinding()).getType()); - if (node instanceof IASTName && ((IASTName)node).resolveBinding() instanceof IFunction) - return getType(((IFunction)((IASTName)node).resolveBinding()).getType()); - if (node instanceof IASTName && ((IASTName)node).resolveBinding() instanceof IType) - return getType((IType)((IASTName)node).resolveBinding()); + return getDeclaratorType((IASTDeclarator) node); + if (node instanceof IASTName + && ((IASTName) node).resolveBinding() instanceof IVariable) + return getType(((IVariable) ((IASTName) node).resolveBinding()) + .getType()); + if (node instanceof IASTName + && ((IASTName) node).resolveBinding() instanceof IFunction) + return getType(((IFunction) ((IASTName) node).resolveBinding()) + .getType()); + if (node instanceof IASTName + && ((IASTName) node).resolveBinding() instanceof IType) + return getType((IType) ((IASTName) node).resolveBinding()); if (node instanceof IASTTypeId) - return getType((IASTTypeId)node); - } catch (DOMException e) { return EMPTY_STRING; } - + return getType((IASTTypeId) node); + } catch (DOMException e) { + return EMPTY_STRING; + } + return EMPTY_STRING; } - + public static String getType(IASTTypeId typeId) { if (typeId instanceof CASTTypeId) return createCType(typeId.getAbstractDeclarator()); else if (typeId instanceof CPPASTTypeId) return createCPPType(typeId.getAbstractDeclarator()); - + return EMPTY_STRING; } - + private static String createCType(IASTDeclarator declarator) { IType type = CVisitor.createType(declarator); return getType(type); } - + private static String createCPPType(IASTDeclarator declarator) { IType type = CPPVisitor.createType(declarator); return getType(type); } - + } \ No newline at end of file diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTVisitor.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTVisitor.java index 86fabe74e48..f40d230310b 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTVisitor.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTVisitor.java @@ -16,45 +16,89 @@ package org.eclipse.cdt.core.dom.ast; import org.eclipse.cdt.core.dom.ast.IASTEnumerationSpecifier.IASTEnumerator; - public abstract class ASTVisitor { - + /** * These values should be overriden in the implementation subclass. */ - public boolean shouldVisitNames = false; - public boolean shouldVisitDeclarations = false; - public boolean shouldVisitInitializers = false; + public boolean shouldVisitNames = false; + + public boolean shouldVisitDeclarations = false; + + public boolean shouldVisitInitializers = false; + public boolean shouldVisitParameterDeclarations = false; - public boolean shouldVisitDeclarators = false; + + public boolean shouldVisitDeclarators = false; + public boolean shouldVisitDeclSpecifiers = false; - public boolean shouldVisitExpressions = false; - public boolean shouldVisitStatements = false; - public boolean shouldVisitTypeIds = false; - public boolean shouldVisitEnumerators = false; + + public boolean shouldVisitExpressions = false; + + public boolean shouldVisitStatements = false; + + public boolean shouldVisitTypeIds = false; + + public boolean shouldVisitEnumerators = false; + public boolean shouldVisitTranslationUnit = false; /** - * @return continue to continue visiting, abort to stop, skip to not descend into this node. + * @return continue to continue visiting, abort to stop, skip to not descend + * into this node. */ - public final static int PROCESS_SKIP = 1; - public final static int PROCESS_ABORT = 2; + public final static int PROCESS_SKIP = 1; + + public final static int PROCESS_ABORT = 2; + public final static int PROCESS_CONTINUE = 3; - - /** - * - * visit methods - * - */ - public int visit( IASTTranslationUnit tu ) { return PROCESS_CONTINUE; } - public int visit( IASTName name ) { return PROCESS_CONTINUE; } - public int visit( IASTDeclaration declaration ) { return PROCESS_CONTINUE; } - public int visit( IASTInitializer initializer ) { return PROCESS_CONTINUE; } - public int visit( IASTParameterDeclaration parameterDeclaration ) { return PROCESS_CONTINUE; } - public int visit( IASTDeclarator declarator ) { return PROCESS_CONTINUE; } - public int visit( IASTDeclSpecifier declSpec ) {return PROCESS_CONTINUE; } - public int visit( IASTExpression expression ) { return PROCESS_CONTINUE; } - public int visit( IASTStatement statement ) { return PROCESS_CONTINUE; } - public int visit( IASTTypeId typeId ) { return PROCESS_CONTINUE; } - public int visit( IASTEnumerator enumerator ) { return PROCESS_CONTINUE; } + + /** + * + * visit methods + * + */ + public int visit(IASTTranslationUnit tu) { + return PROCESS_CONTINUE; + } + + public int visit(IASTName name) { + return PROCESS_CONTINUE; + } + + public int visit(IASTDeclaration declaration) { + return PROCESS_CONTINUE; + } + + public int visit(IASTInitializer initializer) { + return PROCESS_CONTINUE; + } + + public int visit(IASTParameterDeclaration parameterDeclaration) { + return PROCESS_CONTINUE; + } + + public int visit(IASTDeclarator declarator) { + return PROCESS_CONTINUE; + } + + public int visit(IASTDeclSpecifier declSpec) { + return PROCESS_CONTINUE; + } + + public int visit(IASTExpression expression) { + return PROCESS_CONTINUE; + } + + public int visit(IASTStatement statement) { + return PROCESS_CONTINUE; + } + + public int visit(IASTTypeId typeId) { + return PROCESS_CONTINUE; + } + + public int visit(IASTEnumerator enumerator) { + return PROCESS_CONTINUE; + } } \ No newline at end of file diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/DOMException.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/DOMException.java index 1bb318c12cf..0cc7d50fdf3 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/DOMException.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/DOMException.java @@ -17,34 +17,30 @@ package org.eclipse.cdt.core.dom.ast; import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPSemantics; /** - * This is the general purpose exception that is thrown for resolving semantic - * aspects of an illegal binding. + * This is the general purpose exception that is thrown for resolving semantic + * aspects of an illegal binding. * * @author aniefer */ public class DOMException extends Exception { - IProblemBinding problemBinding; + IProblemBinding problemBinding; - - /** - * @param problem binding for throwing - * - */ - public DOMException( IProblemBinding problem ) { - super( CPPSemantics.EMPTY_NAME ); - problemBinding = problem; - } + /** + * @param problem + * binding for throwing + * + */ + public DOMException(IProblemBinding problem) { + super(CPPSemantics.EMPTY_NAME); + problemBinding = problem; + } - /** - * Get the problem associated w/this exception. - * - * @return problem - */ - public IProblemBinding getProblem(){ - return problemBinding; - } - - public String getMessage() { - return problemBinding.getMessage(); - } + /** + * Get the problem associated w/this exception. + * + * @return problem + */ + public IProblemBinding getProblem() { + return problemBinding; + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTASMDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTASMDeclaration.java index 352adfe61fc..8e3ddedba2f 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTASMDeclaration.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTASMDeclaration.java @@ -9,7 +9,6 @@ * IBM Rational Software - Initial API and implementation */ package org.eclipse.cdt.core.dom.ast; - /** * ASM Statement as a Declaration. * @@ -17,14 +16,17 @@ package org.eclipse.cdt.core.dom.ast; */ public interface IASTASMDeclaration extends IASTDeclaration { - /** - * Get the assembly value. - * @return - */ - public String getAssembly(); - /** - * Set the assembly value. - * @param assembly - */ - public void setAssembly( String assembly ); + /** + * Get the assembly value. + * + * @return + */ + public String getAssembly(); + + /** + * Set the assembly value. + * + * @param assembly + */ + public void setAssembly(String assembly); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTArrayDeclarator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTArrayDeclarator.java index bd7e1d597c8..3075cad1fec 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTArrayDeclarator.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTArrayDeclarator.java @@ -17,22 +17,26 @@ package org.eclipse.cdt.core.dom.ast; */ public interface IASTArrayDeclarator extends IASTDeclarator { - /** - * Node property that describes the relationship between an IASTArrayDeclarator and an IASTArrayModifier. - */ - public static final ASTNodeProperty ARRAY_MODIFIER = new ASTNodeProperty( "Array Modifier"); //$NON-NLS-1$ - + /** + * Node property that describes the relationship between an + * IASTArrayDeclarator and an IASTArrayModifier. + */ + public static final ASTNodeProperty ARRAY_MODIFIER = new ASTNodeProperty( + "Array Modifier"); //$NON-NLS-1$ + /** * Get all IASTArrayModifier's for this declarator. * * @return array of IASTArrayModifier */ public IASTArrayModifier[] getArrayModifiers(); - + /** * Add an IASTArrayModifier to this declarator - * @param arrayModifier IASTArrayModifier to be added + * + * @param arrayModifier + * IASTArrayModifier to be added */ - public void addArrayModifier( IASTArrayModifier arrayModifier ); - + public void addArrayModifier(IASTArrayModifier arrayModifier); + } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTArrayModifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTArrayModifier.java index 84873468493..ce2743b64fb 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTArrayModifier.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTArrayModifier.java @@ -10,32 +10,38 @@ package org.eclipse.cdt.core.dom.ast; /** - * This is the portion of the node that represents the portions when someone declares a - * variable/type which is an array. + * This is the portion of the node that represents the portions when someone + * declares a variable/type which is an array. * * @author jcamelon */ public interface IASTArrayModifier extends IASTNode { - - /** - * Node property that describes the relationship between an IASTArrayModifier and an IASTExpression. - */ - public static final ASTNodeProperty CONSTANT_EXPRESSION = new ASTNodeProperty( "Constant Expression"); //$NON-NLS-1$ - /** - * EMPTY_ARRAY is referred to in implementations - */ - public static final IASTArrayModifier[] EMPTY_ARRAY = new IASTArrayModifier[0]; - /** - * Get the constant expression that represents the size of the array. - * - * @return IASTExpression - */ - public IASTExpression getConstantExpression(); - /** - * Set the constant expression that represents the size of the array. - * - * @param expression IASTExpression - */ - public void setConstantExpression( IASTExpression expression ); + + /** + * Node property that describes the relationship between an + * IASTArrayModifier and an IASTExpression. + */ + public static final ASTNodeProperty CONSTANT_EXPRESSION = new ASTNodeProperty( + "Constant Expression"); //$NON-NLS-1$ + + /** + * EMPTY_ARRAY is referred to in implementations + */ + public static final IASTArrayModifier[] EMPTY_ARRAY = new IASTArrayModifier[0]; + + /** + * Get the constant expression that represents the size of the array. + * + * @return IASTExpression + */ + public IASTExpression getConstantExpression(); + + /** + * Set the constant expression that represents the size of the array. + * + * @param expression + * IASTExpression + */ + public void setConstantExpression(IASTExpression expression); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTArraySubscriptExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTArraySubscriptExpression.java index 39d7cee9d14..48419ef4bda 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTArraySubscriptExpression.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTArraySubscriptExpression.java @@ -10,41 +10,56 @@ package org.eclipse.cdt.core.dom.ast; /** - * This interface represents a postfix array subscript expression. - * x[ 10 ] + * This interface represents a postfix array subscript expression. x[ 10 ] * y.z()[ t * t ] * * @author jcamelon */ public interface IASTArraySubscriptExpression extends IASTExpression { - /** - * Node property that describes the relationship between an IASTArraySubscriptExpression and an IASTExpression representing the subscript. - */ - public static final ASTNodeProperty ARRAY = new ASTNodeProperty( "Array"); //$NON-NLS-1$ - /** - * Get the expression that represents the array. - * @return IASTExpression that represents the array. - */ - public IASTExpression getArrayExpression(); - /** - * Set the expression that represents the array. - * @param expression IASTExpression to be set. - */ - public void setArrayExpression( IASTExpression expression ); - /** - * Node property that describes the relationship between an IASTArraySubscriptExpression and an IASTExpression representing the array. - */ - public static final ASTNodeProperty SUBSCRIPT = new ASTNodeProperty( "Subscript"); //$NON-NLS-1$ - /** - * Get the subscript expression. - * @return IASTExpression that represents the subscript. - */ - public IASTExpression getSubscriptExpression(); - /** - * Set the subscript expression. - * @param expression IASTExpression to be set. - */ - public void setSubscriptExpression( IASTExpression expression ); - + /** + * Node property that describes the relationship between an + * IASTArraySubscriptExpression and an + * IASTExpression representing the subscript. + */ + public static final ASTNodeProperty ARRAY = new ASTNodeProperty("Array"); //$NON-NLS-1$ + + /** + * Get the expression that represents the array. + * + * @return IASTExpression that represents the array. + */ + public IASTExpression getArrayExpression(); + + /** + * Set the expression that represents the array. + * + * @param expression + * IASTExpression to be set. + */ + public void setArrayExpression(IASTExpression expression); + + /** + * Node property that describes the relationship between an + * IASTArraySubscriptExpression and an + * IASTExpression representing the array. + */ + public static final ASTNodeProperty SUBSCRIPT = new ASTNodeProperty( + "Subscript"); //$NON-NLS-1$ + + /** + * Get the subscript expression. + * + * @return IASTExpression that represents the subscript. + */ + public IASTExpression getSubscriptExpression(); + + /** + * Set the subscript expression. + * + * @param expression + * IASTExpression to be set. + */ + public void setSubscriptExpression(IASTExpression expression); + } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTBinaryExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTBinaryExpression.java index b7da6a282cd..d43ba6cf7ab 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTBinaryExpression.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTBinaryExpression.java @@ -11,203 +11,219 @@ package org.eclipse.cdt.core.dom.ast; /** - * This interface represents a binary expression. + * This interface represents a binary expression. * * @author Doug Schaefer */ public interface IASTBinaryExpression extends IASTExpression { - /** - * Node property that describes the relationship between an IASTBinaryExpression and an IASTExpression representing the lhs. - */ - public static final ASTNodeProperty OPERAND_ONE = new ASTNodeProperty( "Operand 1"); //$NON-NLS-1$ - /** - * Node property that describes the relationship between an IASTBinaryExpression and an IASTExpression representing the rhs. - */ - public static final ASTNodeProperty OPERAND_TWO = new ASTNodeProperty( "Operand 2"); //$NON-NLS-1$ - - /** - * Set the operator. - * @param op Value to set. - */ - public void setOperator( int op ); /** - * Get the operator. + * Node property that describes the relationship between an + * IASTBinaryExpression and an IASTExpression + * representing the lhs. + */ + public static final ASTNodeProperty OPERAND_ONE = new ASTNodeProperty( + "Operand 1"); //$NON-NLS-1$ + + /** + * Node property that describes the relationship between an + * IASTBinaryExpression and an IASTExpression + * representing the rhs. + */ + public static final ASTNodeProperty OPERAND_TWO = new ASTNodeProperty( + "Operand 2"); //$NON-NLS-1$ + + /** + * Set the operator. + * + * @param op + * Value to set. + */ + public void setOperator(int op); + + /** + * Get the operator. + * * @return int value as operator */ public int getOperator(); - - + /** * multiply * */ public static final int op_multiply = 1; + /** * divide / */ public static final int op_divide = 2; - + /** * modulo % */ public static final int op_modulo = 3; - + /** * plus + */ public static final int op_plus = 4; - + /** * minus - */ public static final int op_minus = 5; - + /** * shift left << */ public static final int op_shiftLeft = 6; - + /** * shift right >> */ public static final int op_shiftRight = 7; - + /** - * less than < + * less than < */ public static final int op_lessThan = 8; - + /** * greater than > */ public static final int op_greaterThan = 9; - + /** * less than or equals <= */ public static final int op_lessEqual = 10; - + /** * greater than or equals >= */ public static final int op_greaterEqual = 11; - + /** * binary and & */ public static final int op_binaryAnd = 12; - + /** * binary Xor ^ */ public static final int op_binaryXor = 13; - + /** * binary Or | */ public static final int op_binaryOr = 14; - + /** * logical and && */ public static final int op_logicalAnd = 15; - + /** - * logical or || + * logical or || */ public static final int op_logicalOr = 16; - + /** - * assignment = + * assignment = */ public static final int op_assign = 17; - + /** * multiply assignment *= */ public static final int op_multiplyAssign = 18; - + /** * divide assignemnt /= */ public static final int op_divideAssign = 19; - + /** * modulo assignment %= */ public static final int op_moduloAssign = 20; - + /** * plus assignment += */ public static final int op_plusAssign = 21; - + /** * minus assignment -= */ public static final int op_minusAssign = 22; - + /** * shift left assignment <<= */ public static final int op_shiftLeftAssign = 23; - + /** * shift right assign >>= */ public static final int op_shiftRightAssign = 24; - + /** * binary and assign &= */ public static final int op_binaryAndAssign = 25; - + /** * binary Xor assign ^= */ public static final int op_binaryXorAssign = 26; - + /** * binary Or assign |= */ public static final int op_binaryOrAssign = 27; - + /** - * equals == + * equals == */ public static final int op_equals = 28; - + /** * not equals != */ public static final int op_notequals = 29; - + /** * op_last is the field used in subinterfaces to start their operators at */ public static final int op_last = op_notequals; - + /** * Get the first operand. * * @return IASTExpression representing operand 1. */ public IASTExpression getOperand1(); + /** - * Set the first operand. + * Set the first operand. * - * @param expression IASTExpression value. + * @param expression + * IASTExpression value. */ - - public void setOperand1( IASTExpression expression ); + + public void setOperand1(IASTExpression expression); + /** * Get the second operand. * * @return IASTExpression representing operand 2. */ public IASTExpression getOperand2(); + /** - * @param expression IASTExpression value + * @param expression + * IASTExpression value */ - public void setOperand2( IASTExpression expression ); + public void setOperand2(IASTExpression expression); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTCaseStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTCaseStatement.java index 9a6460eeb92..2f8f26350a0 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTCaseStatement.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTCaseStatement.java @@ -11,31 +11,34 @@ package org.eclipse.cdt.core.dom.ast; /** - * This is a case in a switch statement. Note that in the grammar, - * a statement is part of the clause. For the AST, just go on to the - * next statement to find it. It's really only there to ensure that there - * is at least one statement following this clause. + * This is a case in a switch statement. Note that in the grammar, a statement + * is part of the clause. For the AST, just go on to the next statement to find + * it. It's really only there to ensure that there is at least one statement + * following this clause. * * @author Doug Schaefer */ public interface IASTCaseStatement extends IASTStatement { - /** - * ASTNodeProperty that represents the relationship between a case statement and the expression it contains. - */ - public static final ASTNodeProperty EXPRESSION = new ASTNodeProperty("expression"); //$NON-NLS-1$ - /** - * The expression that determines whether this case should be - * taken. + * ASTNodeProperty that represents the relationship between a + * case statement and the expression it contains. + */ + public static final ASTNodeProperty EXPRESSION = new ASTNodeProperty( + "expression"); //$NON-NLS-1$ + + /** + * The expression that determines whether this case should be taken. + * * @return */ public IASTExpression getExpression(); /** * Set the expression. + * * @param expression */ public void setExpression(IASTExpression expression); - + } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTCastExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTCastExpression.java index 7e650015a62..30e9d8a2bbc 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTCastExpression.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTCastExpression.java @@ -19,56 +19,67 @@ public interface IASTCastExpression extends IASTExpression { /** * op_cast represents a traditional cast. */ - public static final int op_cast = 0; + public static final int op_cast = 0; + /** - * op_last for subinterfaces + * op_last for subinterfaces */ - public static final int op_last = op_cast; - + public static final int op_last = op_cast; + /** - * Get the type of cast (as an operator). + * Get the type of cast (as an operator). * * @return operator */ - public int getOperator(); - + public int getOperator(); + /** - * Set the operator (type of cast). + * Set the operator (type of cast). * * @param value */ - public void setOperator( int value ); - + public void setOperator(int value); + /** - * OPERAND represents the relationship between a cast expression and the expression it is casting (operand). + * OPERAND 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 IASTExpression the expression being cast */ - public IASTExpression getOperand(); + public IASTExpression getOperand(); + /** - * Set the expression being cast. - * @param expression IASTExpression the expression to be cast + * Set the expression being cast. + * + * @param expression + * IASTExpression the expression to be cast */ - public void setOperand( IASTExpression expression ); - - /** - * TYPE_ID represents the relationship between a cast expression and the type cast to. - */ - public static final ASTNodeProperty TYPE_ID = new ASTNodeProperty( "Type Id"); //$NON-NLS-1$ - - /** - * Set the typeId. - * @param typeId IASTTypeId to be set. - */ - public void setTypeId( IASTTypeId typeId ); - /** - * Get the typeId. - * @return IASTTypeId representing type being casted to. - */ - public IASTTypeId getTypeId(); - + public void setOperand(IASTExpression expression); + + /** + * TYPE_ID represents the relationship between a cast + * expression and the type cast to. + */ + public static final ASTNodeProperty TYPE_ID = new ASTNodeProperty("Type Id"); //$NON-NLS-1$ + + /** + * Set the typeId. + * + * @param typeId + * IASTTypeId to be set. + */ + public void setTypeId(IASTTypeId typeId); + + /** + * Get the typeId. + * + * @return IASTTypeId representing type being casted to. + */ + public IASTTypeId getTypeId(); + } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTCompositeTypeSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTCompositeTypeSpecifier.java index 5ccdf8604da..647ae3d7315 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTCompositeTypeSpecifier.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTCompositeTypeSpecifier.java @@ -10,82 +10,87 @@ **********************************************************************/ package org.eclipse.cdt.core.dom.ast; - /** - * A composite type specifier represents a ocmposite structure (contains declarations). + * A composite type specifier represents a ocmposite structure (contains + * declarations). * * @author Doug Schaefer */ public interface IASTCompositeTypeSpecifier extends IASTDeclSpecifier { - /** - * TYPE_NAME represents the relationship between an IASTCompositeTypeSpecifier and its IASTName. - */ - public static final ASTNodeProperty TYPE_NAME = new ASTNodeProperty( "Type Name"); //$NON-NLS-1$ + /** + * TYPE_NAME represents the relationship between an + * IASTCompositeTypeSpecifier and its IASTName. + */ + public static final ASTNodeProperty TYPE_NAME = new ASTNodeProperty( + "Type Name"); //$NON-NLS-1$ /** - * MEMBER_DECLARATION represents the relationship between an IASTCompositeTypeSpecifier and its nestedIASTDeclarations. - */ - public static final ASTNodeProperty MEMBER_DECLARATION = new ASTNodeProperty( "Member Declaration"); //$NON-NLS-1$ + * MEMBER_DECLARATION represents the relationship between an + * IASTCompositeTypeSpecifier and its nestedIASTDeclarations. + */ + 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. * * @return key for this type */ public int getKey(); - - + /** * k_struct represents 'struct' in C & C++ */ public static final int k_struct = 1; + /** * k_union represents 'union' in C & C++ */ public static final int k_union = 2; + /** - * k_last allows for subinterfaces to continue enumerating keys + * k_last allows for subinterfaces to continue enumerating + * keys */ public static final int k_last = k_union; - - + /** - * Set the type (key) of this composite specifier. + * Set the type (key) of this composite specifier. * * @param key */ - public void setKey( int key ); + public void setKey(int key); /** - * Return the name for this composite type. If this is an anonymous - * type, this will return an empty name. + * Return the name for this composite type. If this is an anonymous type, + * this will return an empty name. * * @return the name of the type */ public IASTName getName(); - + /** - * Set the name for this composite type. + * Set the name for this composite type. * * @param name */ - public void setName( IASTName name ); - + public void setName(IASTName name); + /** * Returns a list of member declarations. * * @return List of IASTDeclaration */ public IASTDeclaration[] getMembers(); - + /** - * Add a member declaration. + * Add a member declaration. * * @param declaration */ - public void addMemberDeclaration( IASTDeclaration declaration ); - + public void addMemberDeclaration(IASTDeclaration declaration); + /** * Get the scope that this interface eludes to in the logical tree. * diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTCompoundStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTCompoundStatement.java index ad3f96b8f4e..1873ebd52cc 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTCompoundStatement.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTCompoundStatement.java @@ -10,7 +10,6 @@ **********************************************************************/ package org.eclipse.cdt.core.dom.ast; - /** * This represents a block of statements. * @@ -19,28 +18,33 @@ package org.eclipse.cdt.core.dom.ast; public interface IASTCompoundStatement extends IASTStatement { /** - * NESTED_STATEMENT represents the relationship between an IASTCompoundStatement and its nested IASTStatement + * NESTED_STATEMENT represents the relationship between an + * IASTCompoundStatement and its nested + * IASTStatement */ - public static final ASTNodeProperty NESTED_STATEMENT = new ASTNodeProperty( "Nested Statement" ); //$NON-NLS-1$ + public static final ASTNodeProperty NESTED_STATEMENT = new ASTNodeProperty( + "Nested Statement"); //$NON-NLS-1$ - /** + /** * Gets the statements in this block. * * @return Array of IASTStatement */ public IASTStatement[] getStatements(); - + /** - * 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 IScope node that this node eludes to in the logical tree. + * Get IScope node that this node eludes to in the logical + * tree. * - * @return the IScope + * @return the IScope */ public IScope getScope(); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTConditionalExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTConditionalExpression.java index 775d7dbfc4f..721fc5f234b 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTConditionalExpression.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTConditionalExpression.java @@ -16,57 +16,73 @@ package org.eclipse.cdt.core.dom.ast; */ public interface IASTConditionalExpression extends IASTExpression { - /** - * LOGICAL_CONDITION represents the relationship between an IASTConditionalExpression and its condition IASTExpression. - */ - public static final ASTNodeProperty LOGICAL_CONDITION = new ASTNodeProperty( "Logical Condition"); //$NON-NLS-1$ - /** - * POSITIVE_RESULT represents the relationship between an IASTConditionalExpression and its positive result IASTExpression. - */ - public static final ASTNodeProperty POSITIVE_RESULT = new ASTNodeProperty( "Positive Result" ); //$NON-NLS-1$ - /** - * NEGATIVE_RESULT represents the relationship between an IASTConditionalExpression and its positive result IASTExpression. - */ - public static final ASTNodeProperty NEGATIVE_RESULT = new ASTNodeProperty( "Negative Result" ); //$NON-NLS-1$ - - /** - * Get the logical condition expression. - * - * @return IASTExpression representing the logical condition. - */ - - public IASTExpression getLogicalConditionExpression(); - /** - * Set the logical condition expression. - * - * @param expression condition to be set - */ - public void setLogicalConditionExpression( IASTExpression expression ); - - /** - * Get the positive result expression. - * - * @return IASTExpression - */ - public IASTExpression getPositiveResultExpression(); - /** - * Set positive result expression. - * - * @param expression - */ - public void setPositiveResultExpression(IASTExpression expression); - - /** - * Get the negative result expression. - * @return IASTExpression - */ - public IASTExpression getNegativeResultExpression(); - /** - * Set negative result expression. - * - * @param expression IASTExpression - */ - public void setNegativeResultExpression(IASTExpression expression); - + * LOGICAL_CONDITION represents the relationship between an + * IASTConditionalExpression and its condition + * IASTExpression. + */ + public static final ASTNodeProperty LOGICAL_CONDITION = new ASTNodeProperty( + "Logical Condition"); //$NON-NLS-1$ + + /** + * POSITIVE_RESULT represents the relationship between an + * IASTConditionalExpression and its positive result + * IASTExpression. + */ + public static final ASTNodeProperty POSITIVE_RESULT = new ASTNodeProperty( + "Positive Result"); //$NON-NLS-1$ + + /** + * NEGATIVE_RESULT represents the relationship between an + * IASTConditionalExpression and its positive result + * IASTExpression. + */ + public static final ASTNodeProperty NEGATIVE_RESULT = new ASTNodeProperty( + "Negative Result"); //$NON-NLS-1$ + + /** + * Get the logical condition expression. + * + * @return IASTExpression representing the logical condition. + */ + + public IASTExpression getLogicalConditionExpression(); + + /** + * Set the logical condition expression. + * + * @param expression + * condition to be set + */ + public void setLogicalConditionExpression(IASTExpression expression); + + /** + * Get the positive result expression. + * + * @return IASTExpression + */ + public IASTExpression getPositiveResultExpression(); + + /** + * Set positive result expression. + * + * @param expression + */ + public void setPositiveResultExpression(IASTExpression expression); + + /** + * Get the negative result expression. + * + * @return IASTExpression + */ + public IASTExpression getNegativeResultExpression(); + + /** + * Set negative result expression. + * + * @param expression + * IASTExpression + */ + public void setNegativeResultExpression(IASTExpression expression); + } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTContinueStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTContinueStatement.java index fb7ea99bd8b..ad697bc8e4f 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTContinueStatement.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTContinueStatement.java @@ -15,6 +15,6 @@ package org.eclipse.cdt.core.dom.ast; * * @author Doug Schaefer */ -public interface IASTContinueStatement extends IASTStatement { +public interface IASTContinueStatement extends IASTStatement { } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDeclSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDeclSpecifier.java index fcecc93b488..08766584aa2 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDeclSpecifier.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDeclSpecifier.java @@ -16,25 +16,29 @@ package org.eclipse.cdt.core.dom.ast; * @author Doug Schaefer */ public interface IASTDeclSpecifier extends IASTNode { - + /** * sc_unspecified undefined storage class */ public static final int sc_unspecified = 0; + /** * sc_typedef typedef */ public static final int sc_typedef = 1; + /** * sc_externextern */ public static final int sc_extern = 2; + /** * sc_staticstatic */ public static final int sc_static = 3; + /** * sc_autoauto */ @@ -52,55 +56,73 @@ public interface IASTDeclSpecifier extends IASTNode { public static final int sc_last = sc_register; /** - * Set the storage class. - * @param storageClass int + * Set the storage class. + * + * @param storageClass + * int */ - public void setStorageClass( int storageClass ); + public void setStorageClass(int storageClass); + /** * Get the storage class. + * * @return int */ public int getStorageClass(); - + // Type qualifier /** * Is const modifier used? + * * @return boolean */ public boolean isConst(); + /** * Set const modifier used. - * @param value boolean + * + * @param value + * boolean */ - public void setConst( boolean value ); - + public void setConst(boolean value); + /** * Is volatile modifier used? + * * @return boolean */ public boolean isVolatile(); + /** * Set volatile modifier used. - * @param value boolean + * + * @param value + * boolean */ - public void setVolatile( boolean value ); - + public void setVolatile(boolean value); + // Function specifier /** * Is inline modifier used? + * * @return boolean */ public boolean isInline(); + /** * Set inline modifier used. - * @param value boolean + * + * @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 */ public String getUnpreprocessedSignature(); - + } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDeclaration.java index 080ae8ce70b..f9d9068b9ed 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDeclaration.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDeclaration.java @@ -16,6 +16,6 @@ package org.eclipse.cdt.core.dom.ast; * @author Doug Schaefer */ public interface IASTDeclaration extends IASTNode { - public static final IASTDeclaration [] EMPTY_DECLARATION_ARRAY = new IASTDeclaration[0]; + public static final IASTDeclaration[] EMPTY_DECLARATION_ARRAY = new IASTDeclaration[0]; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDeclarationStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDeclarationStatement.java index 38c602f29a6..2687407ed93 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDeclarationStatement.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDeclarationStatement.java @@ -18,22 +18,24 @@ package org.eclipse.cdt.core.dom.ast; public interface IASTDeclarationStatement extends IASTStatement { /** - * DECLARATION represents the relationship between a declaration statement and the declaration it wraps. + * DECLARATION represents the relationship between a + * declaration statement and the declaration it wraps. */ - public static final ASTNodeProperty DECLARATION = new ASTNodeProperty( "Declaration"); //$NON-NLS-1$ + public static final ASTNodeProperty DECLARATION = new ASTNodeProperty( + "Declaration"); //$NON-NLS-1$ - /** + /** * Gets the declaration introduced by this statement. * * @return the declaration */ public IASTDeclaration getDeclaration(); - + /** - * Set the declaration for this statement. + * Set the declaration for this statement. * * @param declaration */ - public void setDeclaration( IASTDeclaration declaration ); - + public void setDeclaration(IASTDeclaration declaration); + } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDeclarator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDeclarator.java index fb165a3335a..a0ae526d75e 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDeclarator.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDeclarator.java @@ -10,61 +10,72 @@ **********************************************************************/ package org.eclipse.cdt.core.dom.ast; - /** * Base interface for a declarator. * * @author Doug Schaefer */ public interface IASTDeclarator extends IASTNode { - - /** - * Constant - empty declarator array - */ - public static final IASTDeclarator[] EMPTY_DECLARATOR_ARRAY = new IASTDeclarator[0]; /** - * POINTER_OPERATOR represents the relationship between an IASTDeclarator and an IASTPointerOperator. + * Constant - empty declarator array */ - public static final ASTNodeProperty POINTER_OPERATOR = new ASTNodeProperty( "Pointer Operator"); //$NON-NLS-1$ - /** - * INITIALIZER represents the relationship between an IASTDeclarator and an IASTInitializer. - */ - public static final ASTNodeProperty INITIALIZER = new ASTNodeProperty( "Initializer"); //$NON-NLS-1$ - /** - * NESTED_DECLARATOR represents the relationship between an IASTDeclarator and a nested IASTDeclarator. - */ - public static final ASTNodeProperty NESTED_DECLARATOR = new ASTNodeProperty( "Nested Declarator"); //$NON-NLS-1$ - /** - * DECLARATOR_NAME represents the relationship between an IASTDeclarator and an IASTName. - */ - public static final ASTNodeProperty DECLARATOR_NAME = new ASTNodeProperty( "Declarator Name"); //$NON-NLS-1$ + public static final IASTDeclarator[] EMPTY_DECLARATOR_ARRAY = new IASTDeclarator[0]; - /** - * This is the list of pointer operators applied to the type for - * the declarator. + /** + * POINTER_OPERATOR represents the relationship between an + * IASTDeclarator and an IASTPointerOperator. + */ + public static final ASTNodeProperty POINTER_OPERATOR = new ASTNodeProperty( + "Pointer Operator"); //$NON-NLS-1$ + + /** + * INITIALIZER represents the relationship between an + * IASTDeclarator and an IASTInitializer. + */ + public static final ASTNodeProperty INITIALIZER = new ASTNodeProperty( + "Initializer"); //$NON-NLS-1$ + + /** + * NESTED_DECLARATOR represents the relationship between an + * IASTDeclarator and a nested IASTDeclarator. + */ + public static final ASTNodeProperty NESTED_DECLARATOR = new ASTNodeProperty( + "Nested Declarator"); //$NON-NLS-1$ + + /** + * DECLARATOR_NAME represents the relationship between an + * IASTDeclarator and an IASTName. + */ + 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 */ public IASTPointerOperator[] getPointerOperators(); - - /** - * Adds a pointer operator to the declarator. - * - * @param operator IASTPointerOperator to be added. - */ - public void addPointerOperator( IASTPointerOperator operator ); /** - * If the declarator is nested in parenthesis, this returns the - * declarator as found in those parenethesis. + * Adds a pointer operator to the declarator. + * + * @param operator + * IASTPointerOperator to be added. + */ + public void addPointerOperator(IASTPointerOperator operator); + + /** + * If the declarator is nested in parenthesis, this returns the declarator + * as found in those parenethesis. * * @return the nested declarator or null */ public IASTDeclarator getNestedDeclarator(); - - public void setNestedDeclarator( IASTDeclarator nested ); - + + public void setNestedDeclarator(IASTDeclarator nested); + /** * This returns the name of the declarator. If this is an abstract * declarator, this will return an empty name. @@ -72,26 +83,28 @@ public interface IASTDeclarator extends IASTNode { * @return the name of the declarator */ public IASTName getName(); - + /** * Set the name of he declarator. * - * @param name IASTName + * @param name + * IASTName */ - public void setName( IASTName name ); - + public void setName(IASTName name); + /** * This is the optional initializer for this declarator. * * @return the initializer expression or null */ public IASTInitializer getInitializer(); - + /** - * Set the optional initializer. + * Set the optional initializer. * - * @param initializer IASTInitializer + * @param initializer + * IASTInitializer */ - public void setInitializer( IASTInitializer initializer ); - + public void setInitializer(IASTInitializer initializer); + } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDefaultStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDefaultStatement.java index 4ad8f717956..1793f018942 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDefaultStatement.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDefaultStatement.java @@ -12,9 +12,9 @@ package org.eclipse.cdt.core.dom.ast; /** * This is the default clause in the switch statement. Note that in the grammar, - * a statement is part of the clause. For the AST, just go on to the - * next statement to find it. It's really only there to ensure that there - * is at least one statement following this clause. + * a statement is part of the clause. For the AST, just go on to the next + * statement to find it. It's really only there to ensure that there is at least + * one statement following this clause. * * @author Doug Schaefer */ diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDoStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDoStatement.java index da60a2a7322..ef4c4e09400 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDoStatement.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDoStatement.java @@ -17,14 +17,20 @@ package org.eclipse.cdt.core.dom.ast; */ public interface IASTDoStatement extends IASTStatement { - /** - * BODY represents the relationship between a IASTDoStatement and its nested body IASTStatement. - */ - public static final ASTNodeProperty BODY = new ASTNodeProperty("body"); //$NON-NLS-1$ - /** - * CONDITION represents the relationship between a IASTDoStatement and its condition IASTExpression. - */ - public static final ASTNodeProperty CONDITION = new ASTNodeProperty("condition"); //$NON-NLS-1$ + /** + * BODY represents the relationship between a + * IASTDoStatement and its nested body + * IASTStatement. + */ + public static final ASTNodeProperty BODY = new ASTNodeProperty("body"); //$NON-NLS-1$ + + /** + * CONDITION represents the relationship between a + * IASTDoStatement and its condition + * IASTExpression. + */ + public static final ASTNodeProperty CONDITION = new ASTNodeProperty( + "condition"); //$NON-NLS-1$ /** * Get the body of the loop. @@ -32,24 +38,28 @@ public interface IASTDoStatement extends IASTStatement { * @return IASTStatement loop code body */ public IASTStatement getBody(); - + /** * Set the body of the loop. - * @param body an IASTStatement + * + * @param body + * an IASTStatement */ public void setBody(IASTStatement body); - + /** * The condition on the loop. * * @return the expression for the condition */ public IASTExpression getCondition(); - + /** * Set the condition for the loop. - * @param condition an IASTExpression + * + * @param condition + * an IASTExpression */ public void setCondition(IASTExpression condition); - + } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTElaboratedTypeSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTElaboratedTypeSpecifier.java index 27a294e2632..397f64ee5f2 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTElaboratedTypeSpecifier.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTElaboratedTypeSpecifier.java @@ -16,51 +16,61 @@ package org.eclipse.cdt.core.dom.ast; */ public interface IASTElaboratedTypeSpecifier extends IASTDeclSpecifier { - /** * Enumeration. */ - public static final int k_enum = 0; - /** - * Structure. - */ - public static final int k_struct = 1; - /** - * Union. - */ - public static final int k_union = 2; - /** - * Constant for extensibility in sub-interfaces. - */ - public static final int k_last = k_union; - - /** - * Get the kind. - * - * @return int (kind). - */ - public int getKind(); - /** - * Set the kind. - * @param value int (kind) - */ - public void setKind( int value ); - - /** - * TYPE_NAME describes the relationship between IASTElaboratedTypeSpecifier and IASTName. - */ - public static final ASTNodeProperty TYPE_NAME = new ASTNodeProperty( "Type Name"); //$NON-NLS-1$ - /** - * Get the name. - * - * @return IASTName - */ - public IASTName getName(); - /** - * Set the name. - * - * @param name IASTName - */ - public void setName( IASTName name ); - + public static final int k_enum = 0; + + /** + * Structure. + */ + public static final int k_struct = 1; + + /** + * Union. + */ + public static final int k_union = 2; + + /** + * Constant for extensibility in sub-interfaces. + */ + public static final int k_last = k_union; + + /** + * Get the kind. + * + * @return int (kind). + */ + public int getKind(); + + /** + * Set the kind. + * + * @param value + * int (kind) + */ + public void setKind(int value); + + /** + * TYPE_NAME describes the relationship between + * IASTElaboratedTypeSpecifier and IASTName. + */ + public static final ASTNodeProperty TYPE_NAME = new ASTNodeProperty( + "Type Name"); //$NON-NLS-1$ + + /** + * Get the name. + * + * @return IASTName + */ + public IASTName getName(); + + /** + * Set the name. + * + * @param name + * IASTName + */ + public void setName(IASTName name); + } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTEnumerationSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTEnumerationSpecifier.java index d02934932ec..234607ab19d 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTEnumerationSpecifier.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTEnumerationSpecifier.java @@ -9,92 +9,110 @@ * IBM Rational Software - Initial API and implementation */ package org.eclipse.cdt.core.dom.ast; - /** - * This interface represents enumerations in C and C++. + * This interface represents enumerations in C and C++. * * @author jcamelon */ public interface IASTEnumerationSpecifier extends IASTDeclSpecifier { - /** - * This interface represents an enumerator member of an enum specifier. - * @author jcamelon - */ - public interface IASTEnumerator extends IASTNode { - /** - * Empty array (constant). - */ - public static final IASTEnumerator[] EMPTY_ENUMERATOR_ARRAY = new IASTEnumerator[0]; + /** + * This interface represents an enumerator member of an enum specifier. + * + * @author jcamelon + */ + public interface IASTEnumerator extends IASTNode { + /** + * Empty array (constant). + */ + public static final IASTEnumerator[] EMPTY_ENUMERATOR_ARRAY = new IASTEnumerator[0]; - /** - * ENUMERATOR_NAME describes the relationship between IASTEnumerator and IASTName. - */ - public static final ASTNodeProperty ENUMERATOR_NAME = new ASTNodeProperty( "Enumerator Name"); //$NON-NLS-1$ - /** - * Set the enumerator's name. - * - * @param name - */ - public void setName( IASTName name ); - /** - * Get the enumerator's name. - * - * @return IASTName - */ - public IASTName getName(); - - /** - * ENUMERATOR_VALUE describes the relationship between IASTEnumerator and IASTExpression. - */ - public static final ASTNodeProperty ENUMERATOR_VALUE = new ASTNodeProperty( "Enumerator Value"); //$NON-NLS-1$ - /** - * Set enumerator value. - * - * @param expression - */ - public void setValue( IASTExpression expression ); - /** - * Get enumerator value. - * - * @return IASTExpression value - */ - public IASTExpression getValue(); + /** + * ENUMERATOR_NAME describes the relationship between + * IASTEnumerator and IASTName. + */ + public static final ASTNodeProperty ENUMERATOR_NAME = new ASTNodeProperty( + "Enumerator Name"); //$NON-NLS-1$ + + /** + * Set the enumerator's name. + * + * @param name + */ + public void setName(IASTName name); + + /** + * Get the enumerator's name. + * + * @return IASTName + */ + public IASTName getName(); + + /** + * ENUMERATOR_VALUE describes the relationship between + * IASTEnumerator and IASTExpression. + */ + public static final ASTNodeProperty ENUMERATOR_VALUE = new ASTNodeProperty( + "Enumerator Value"); //$NON-NLS-1$ + + /** + * Set enumerator value. + * + * @param expression + */ + public void setValue(IASTExpression expression); + + /** + * Get enumerator value. + * + * @return IASTExpression value + */ + public IASTExpression getValue(); + + } + + /** + * ENUMERATOR describes the relationship between + * IASTEnumerationSpecifier and the nested + * IASTEnumerators. + */ + public static final ASTNodeProperty ENUMERATOR = new ASTNodeProperty( + "Enumerator"); //$NON-NLS-1$ + + /** + * Add an enumerator. + * + * @param enumerator + * IASTEnumerator + */ + public void addEnumerator(IASTEnumerator enumerator); + + /** + * Get enumerators. + * + * @return IASTEnumerator [] array + */ + public IASTEnumerator[] getEnumerators(); + + /** + * ENUMERATION_NAME describes the relationship between + * IASTEnumerationSpecifier and its IASTName. + */ + public static final ASTNodeProperty ENUMERATION_NAME = new ASTNodeProperty( + "Enum Name"); //$NON-NLS-1$ + + /** + * Set the enum's name. + * + * @param name + */ + public void setName(IASTName name); + + /** + * Get the enum's name. + * + * @return + */ + public IASTName getName(); - } - - - /** - * ENUMERATOR describes the relationship between IASTEnumerationSpecifier and the nested IASTEnumerators. - */ - public static final ASTNodeProperty ENUMERATOR = new ASTNodeProperty( "Enumerator" ); //$NON-NLS-1$ - /** - * Add an enumerator. - * - * @param enumerator IASTEnumerator - */ - public void addEnumerator( IASTEnumerator enumerator ); - /** - * Get enumerators. - * @return IASTEnumerator [] array - */ - public IASTEnumerator[] getEnumerators(); - - /** - * ENUMERATION_NAME describes the relationship between IASTEnumerationSpecifier and its IASTName. - */ - public static final ASTNodeProperty ENUMERATION_NAME = new ASTNodeProperty( "Enum Name"); //$NON-NLS-1$ - /** - * Set the enum's name. - * - * @param name - */ - public void setName( IASTName name ); - /** - * Get the enum's name. - * - * @return - */ - public IASTName getName(); - } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTExpression.java index c5539b56afb..7107b5dbf7b 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTExpression.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTExpression.java @@ -16,8 +16,8 @@ package org.eclipse.cdt.core.dom.ast; * @author Doug Schaefer */ public interface IASTExpression extends IASTNode { - /** - * Empty expression array. - */ - public static final IASTExpression [] EMPTY_EXPRESSION_ARRAY = new IASTExpression[0]; + /** + * Empty expression array. + */ + public static final IASTExpression[] EMPTY_EXPRESSION_ARRAY = new IASTExpression[0]; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTExpressionList.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTExpressionList.java index 056f2117662..f283ea666df 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTExpressionList.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTExpressionList.java @@ -9,7 +9,6 @@ * IBM Rational Software - Initial API and implementation */ package org.eclipse.cdt.core.dom.ast; - /** * Expression List (Comma separated list of expressions). * @@ -17,22 +16,26 @@ package org.eclipse.cdt.core.dom.ast; */ public interface IASTExpressionList extends IASTExpression { - /** - * NESTED_EXPRESSION describes the relationship between IASTExpressionList and the nested IASTExpressions. - */ - public static final ASTNodeProperty NESTED_EXPRESSION = new ASTNodeProperty( "Nested Expression"); //$NON-NLS-1$ + /** + * NESTED_EXPRESSION describes the relationship between + * IASTExpressionList and the nested + * IASTExpressions. + */ + public static final ASTNodeProperty NESTED_EXPRESSION = new ASTNodeProperty( + "Nested Expression"); //$NON-NLS-1$ - /** - * Get nested expressions. - * - * @return IASTExpression [] nested expressions - */ - public IASTExpression [] getExpressions(); - - /** - * Add nested expression. - * - * @param expression IASTExpression value to be added. - */ - public void addExpression( IASTExpression expression ); + /** + * Get nested expressions. + * + * @return IASTExpression [] nested expressions + */ + public IASTExpression[] getExpressions(); + + /** + * Add nested expression. + * + * @param expression + * IASTExpression value to be added. + */ + public void addExpression(IASTExpression expression); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTExpressionStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTExpressionStatement.java index e74b523d1c3..298a000c278 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTExpressionStatement.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTExpressionStatement.java @@ -10,7 +10,6 @@ **********************************************************************/ package org.eclipse.cdt.core.dom.ast; - /** * Expression statement. * @@ -18,21 +17,24 @@ package org.eclipse.cdt.core.dom.ast; */ public interface IASTExpressionStatement extends IASTStatement { - /** - * EXPRESSION is the relationship between an IASTExpressionStatement and an IASTExpression. - */ - public static final ASTNodeProperty EXPFRESSION = new ASTNodeProperty( "Expression"); //$NON-NLS-1$ + /** + * EXPRESSION is the relationship between an + * IASTExpressionStatement and an IASTExpression. + */ + public static final ASTNodeProperty EXPFRESSION = new ASTNodeProperty( + "Expression"); //$NON-NLS-1$ + /** * Get the expression in this statement. * * @return the expression */ public IASTExpression getExpression(); - + /** * Set the expression statement. * * @param expression */ - public void setExpression( IASTExpression expression ); + public void setExpression(IASTExpression expression); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFieldDeclarator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFieldDeclarator.java index cc9ac041405..0950b37881d 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFieldDeclarator.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFieldDeclarator.java @@ -18,23 +18,27 @@ package org.eclipse.cdt.core.dom.ast; */ public interface IASTFieldDeclarator extends IASTDeclarator { - /** - * FIELD_SIZE represents the relationship between a IASTFieldDeclarator and its IASTExpression. - */ - public static final ASTNodeProperty FIELD_SIZE = new ASTNodeProperty( "BitField Size"); //$NON-NLS-1$ - /** - * This returns the number of bits if this is a bit field. - * If it is not a bit field, it returns null. + * FIELD_SIZE represents the relationship between a + * IASTFieldDeclarator and its IASTExpression. + */ + public static final ASTNodeProperty FIELD_SIZE = new ASTNodeProperty( + "BitField Size"); //$NON-NLS-1$ + + /** + * This returns the number of bits if this is a bit field. If it is not a + * bit field, it returns null. * * @return size of bit field or null. */ public IASTExpression getBitFieldSize(); - + /** * Set the bitfield size. - * @param size IASTExpression + * + * @param size + * IASTExpression */ - public void setBitFieldSize( IASTExpression size ); - + public void setBitFieldSize(IASTExpression size); + } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFieldReference.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFieldReference.java index 5df642b5029..ab8854e661d 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFieldReference.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFieldReference.java @@ -11,63 +11,72 @@ package org.eclipse.cdt.core.dom.ast; /** - * This interface represents expressions that access a field reference. - * e.g. a.b => a is the expression, b is the field name. - * e.g. a()->def => a() is the expression, def is the field name. + * This interface represents expressions that access a field reference. e.g. a.b => + * a is the expression, b is the field name. e.g. a()->def => a() is the + * expression, def is the field name. * * @author Doug Schaefer */ public interface IASTFieldReference extends IASTExpression { - /** - * FIELD_OWNER represents the relationship between a IASTFieldReference and its IASTExpression field owner. - */ - public static final ASTNodeProperty FIELD_OWNER = new ASTNodeProperty( "Field Owner"); //$NON-NLS-1$ - /** - * FIELD_NAME represents the relationship between a IASTFieldReference and its IASTName field name. - */ - public static final ASTNodeProperty FIELD_NAME = new ASTNodeProperty( "Field Name"); //$NON-NLS-1$ - + /** + * FIELD_OWNER represents the relationship between a + * IASTFieldReference and its IASTExpression + * field owner. + */ + public static final ASTNodeProperty FIELD_OWNER = new ASTNodeProperty( + "Field Owner"); //$NON-NLS-1$ + + /** + * FIELD_NAME represents the relationship between a + * IASTFieldReference and its IASTName field + * name. + */ + public static final ASTNodeProperty FIELD_NAME = new ASTNodeProperty( + "Field Name"); //$NON-NLS-1$ + /** * This returns an expression for the object containing the field. * * @return the field owner */ public IASTExpression getFieldOwner(); - + /** - * Set the expression for the object containing the field. + * Set the expression for the object containing the field. * * @param expression */ - public void setFieldOwner( IASTExpression expression ); - + public void setFieldOwner(IASTExpression expression); + /** * This returns the name of the field being dereferenced. * * @return the name of the field (IASTName) */ public IASTName getFieldName(); - + /** - * Set the name of the field. + * Set the name of the field. * - * @param name IASTName + * @param name + * IASTName */ - public void setFieldName( IASTName name ); - + public void setFieldName(IASTName name); + /** - * This returns true of this is the arrow operator and not the - * dot operator. + * This returns true of this is the arrow operator and not the dot operator. * * @return is this a pointer dereference */ public boolean isPointerDereference(); - + /** - * Set whether or not this is a pointer dereference (default == no). - * @param value boolean + * Set whether or not this is a pointer dereference (default == no). + * + * @param value + * boolean */ - public void setIsPointerDereference( boolean value ); - + public void setIsPointerDereference(boolean value); + } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTForStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTForStatement.java index 57d73f1871b..94fad7f39ac 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTForStatement.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTForStatement.java @@ -11,62 +11,81 @@ package org.eclipse.cdt.core.dom.ast; /** - * The for statement. The initialization clause can be an expression or - * a declaration but not both. + * The for statement. The initialization clause can be an expression or a + * declaration but not both. * * @author Doug Schaefer */ public interface IASTForStatement extends IASTStatement { - /** - * INITEXPRESSION represents the relationship between a IASTForStatement and its IASTExpression initializer. - */ - public static final ASTNodeProperty INITEXPRESSION = new ASTNodeProperty("initExpression"); //$NON-NLS-1$ - /** - * INITDECLARATION represents the relationship between a IASTForStatement and its IASTDeclaration initializer. - */ - public static final ASTNodeProperty INITDECLARATION = new ASTNodeProperty("initDeclaration"); //$NON-NLS-1$ - /** - * CONDITION represents the relationship between a IASTForStatement and its IASTExpression condition. - */ - public static final ASTNodeProperty CONDITION = new ASTNodeProperty("condition"); //$NON-NLS-1$ - /** - * ITERATION represents the relationship between a IASTForStatement and its IASTExpression iteration expression. - */ - public static final ASTNodeProperty ITERATION = new ASTNodeProperty("iteration"); //$NON-NLS-1$ - /** - * BODY represents the relationship between a IASTForStatement and its IASTStatement body. - */ - public static final ASTNodeProperty BODY = new ASTNodeProperty("body"); //$NON-NLS-1$ + /** + * INITEXPRESSION represents the relationship between a + * IASTForStatement and its IASTExpression + * initializer. + */ + public static final ASTNodeProperty INITEXPRESSION = new ASTNodeProperty( + "initExpression"); //$NON-NLS-1$ /** - * Get the initial expression for the loop. Returns null if there is - * none. You can not have both an initial expression and an initial - * declaration. + * INITDECLARATION represents the relationship between a + * IASTForStatement and its IASTDeclaration + * initializer. + */ + public static final ASTNodeProperty INITDECLARATION = new ASTNodeProperty( + "initDeclaration"); //$NON-NLS-1$ + + /** + * CONDITION represents the relationship between a + * IASTForStatement and its IASTExpression + * condition. + */ + public static final ASTNodeProperty CONDITION = new ASTNodeProperty( + "condition"); //$NON-NLS-1$ + + /** + * ITERATION represents the relationship between a + * IASTForStatement and its IASTExpression + * iteration expression. + */ + public static final ASTNodeProperty ITERATION = new ASTNodeProperty( + "iteration"); //$NON-NLS-1$ + + /** + * BODY represents the relationship between a + * IASTForStatement and its IASTStatement + * body. + */ + public static final ASTNodeProperty BODY = new ASTNodeProperty("body"); //$NON-NLS-1$ + + /** + * Get the initial expression for the loop. Returns null if there is none. + * You can not have both an initial expression and an initial declaration. * * @return IASTExpression */ public IASTExpression getInitExpression(); - + /** * Set the initial expression for the loop. * - * @param expression IASTExpression + * @param expression + * IASTExpression */ public void setInit(IASTExpression expression); /** - * Get the initial declaration for the loop. Returns null if there is - * none. You can not have both an initial declaration and an initial - * declaration. + * Get the initial declaration for the loop. Returns null if there is none. + * You can not have both an initial declaration and an initial declaration. * * @return IASTDeclaration */ - public IASTDeclaration getInitDeclaration(); + public IASTDeclaration getInitDeclaration(); + /** - * Set the intiial declaration for the loop. + * Set the intiial declaration for the loop. * - * @param declaration IASTDeclaration + * @param declaration + * IASTDeclaration */ public void setInit(IASTDeclaration declaration); @@ -76,11 +95,12 @@ public interface IASTForStatement extends IASTStatement { * @return IASTExpression */ public IASTExpression getCondition(); - + /** * Set the condition expression for the loop. * - * @param condition IASTExpression + * @param condition + * IASTExpression */ public void setCondition(IASTExpression condition); @@ -93,28 +113,33 @@ public interface IASTForStatement extends IASTStatement { public IASTExpression getIterationExpression(); /** - * Set the expression that is evaluated after the completion of an iteration of the loop. + * Set the expression that is evaluated after the completion of an iteration + * of the loop. * - * @param iterator IASTExpression + * @param iterator + * IASTExpression */ public void setIterationExpression(IASTExpression iterator); - + /** - * Get the statements that this for loop controls. + * Get the statements that this for loop controls. * * @return IASTStatement */ public IASTStatement getBody(); + /** - * Set the body of the for loop. + * Set the body of the for loop. * - * @param statement IASTStatement + * @param statement + * IASTStatement */ - public void setBody( IASTStatement statement ); - + public void setBody(IASTStatement statement); + /** * Get the IScope represented by this for loop. + * * @return IScope */ - public IScope getScope(); + public IScope getScope(); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFunctionCallExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFunctionCallExpression.java index 664b91dd347..a3445933182 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFunctionCallExpression.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFunctionCallExpression.java @@ -10,42 +10,57 @@ package org.eclipse.cdt.core.dom.ast; /** - * This interface represents a function call expression. - * f( x ) : f is the function name expression, x is the parameter expression. + * This interface represents a function call expression. f( x ) : f is the + * function name expression, x is the parameter expression. * * @author jcamelon */ -public interface IASTFunctionCallExpression extends IASTExpression { - - - /** - * FUNCTION_NAME represents the relationship between a IASTFunctionCallExpression and its IASTExpression (function name). - */ - public static final ASTNodeProperty FUNCTION_NAME = new ASTNodeProperty( "Function Name"); //$NON-NLS-1$ - /** - * Set the function name expression. - * @param expression IASTExpression representing the function name - */ - public void setFunctionNameExpression( IASTExpression expression ); - /** - * Get the function name expression. - * @return IASTExpression representing the function name - */ - public IASTExpression getFunctionNameExpression(); - - /** - * PARAMETERS represents the relationship between a IASTFunctionCallExpression and its IASTExpression (parameters). - */ - public static final ASTNodeProperty PARAMETERS = new ASTNodeProperty( "Parameters"); //$NON-NLS-1$ - /** - * Set the parameters expression. - * @param expression IASTExpression representing the parameters - */ - public void setParameterExpression( IASTExpression expression ); - /** - * Get the parameter expression. - * @return IASTExpression representing the parameters - */ - public IASTExpression getParameterExpression(); - +public interface IASTFunctionCallExpression extends IASTExpression { + + /** + * FUNCTION_NAME represents the relationship between a + * IASTFunctionCallExpression and its + * IASTExpression (function name). + */ + public static final ASTNodeProperty FUNCTION_NAME = new ASTNodeProperty( + "Function Name"); //$NON-NLS-1$ + + /** + * Set the function name expression. + * + * @param expression + * IASTExpression representing the function name + */ + public void setFunctionNameExpression(IASTExpression expression); + + /** + * Get the function name expression. + * + * @return IASTExpression representing the function name + */ + public IASTExpression getFunctionNameExpression(); + + /** + * PARAMETERS represents the relationship between a + * IASTFunctionCallExpression and its + * IASTExpression (parameters). + */ + public static final ASTNodeProperty PARAMETERS = new ASTNodeProperty( + "Parameters"); //$NON-NLS-1$ + + /** + * Set the parameters expression. + * + * @param expression + * IASTExpression representing the parameters + */ + public void setParameterExpression(IASTExpression expression); + + /** + * Get the parameter expression. + * + * @return IASTExpression representing the parameters + */ + public IASTExpression getParameterExpression(); + } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFunctionDeclarator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFunctionDeclarator.java index 480e7af4c63..e833dbfc7c1 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFunctionDeclarator.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFunctionDeclarator.java @@ -10,7 +10,6 @@ **********************************************************************/ package org.eclipse.cdt.core.dom.ast; - /** * This is a declarator for a function. * diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFunctionDefinition.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFunctionDefinition.java index c0171e2b829..99d252e791f 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFunctionDefinition.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFunctionDefinition.java @@ -18,19 +18,29 @@ package org.eclipse.cdt.core.dom.ast; public interface IASTFunctionDefinition extends IASTDeclaration { /** - * DECL_SPECIFIER represents the relationship between a IASTFunctionDefinition and its IASTDeclSpecifier. + * DECL_SPECIFIER represents the relationship between a + * IASTFunctionDefinition and its + * IASTDeclSpecifier. */ - public static final ASTNodeProperty DECL_SPECIFIER = new ASTNodeProperty( "Decl Specifier"); //$NON-NLS-1$ - /** - * DECLARATOR represents the relationship between a IASTFunctionDefinition and its IASTFunctionDeclarator. - */ - public static final ASTNodeProperty DECLARATOR = new ASTNodeProperty( "Declarator"); //$NON-NLS-1$ - /** - * FUNCTION_BODY represents the relationship between a IASTFunctionDefinition and its IASTStatement. - */ - public static final ASTNodeProperty FUNCTION_BODY = new ASTNodeProperty( "Function Body"); //$NON-NLS-1$ + public static final ASTNodeProperty DECL_SPECIFIER = new ASTNodeProperty( + "Decl Specifier"); //$NON-NLS-1$ - /** + /** + * DECLARATOR represents the relationship between a + * IASTFunctionDefinition and its + * IASTFunctionDeclarator. + */ + public static final ASTNodeProperty DECLARATOR = new ASTNodeProperty( + "Declarator"); //$NON-NLS-1$ + + /** + * FUNCTION_BODY represents the relationship between a + * IASTFunctionDefinition and its IASTStatement. + */ + public static final ASTNodeProperty FUNCTION_BODY = new ASTNodeProperty( + "Function Body"); //$NON-NLS-1$ + + /** * Get the decl specifier for the function. * * @return @@ -42,40 +52,42 @@ public interface IASTFunctionDefinition extends IASTDeclaration { * * @param declSpec */ - public void setDeclSpecifier( IASTDeclSpecifier declSpec ); - + public void setDeclSpecifier(IASTDeclSpecifier declSpec); + /** * Get the declarator for the function. * * @return */ public IASTFunctionDeclarator getDeclarator(); - + /** - * Set the declarator for the function. + * Set the declarator for the function. * * @param declarator */ - public void setDeclarator( IASTFunctionDeclarator declarator ); - + public void setDeclarator(IASTFunctionDeclarator declarator); + /** - * Get the body of the function. This is usually a compound statement - * but C++ also has a function try block. + * Get the body of the function. This is usually a compound statement but + * C++ also has a function try block. * * @return */ public IASTStatement getBody(); - + /** - * Set the body of the function. + * Set the body of the function. + * * @param statement */ - public void setBody( IASTStatement statement ); - + public void setBody(IASTStatement statement); + /** * Get the logical IScope that the function definition body represents. + * * @return IScope representing function body. */ public IScope getScope(); - + } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFunctionStyleMacroParameter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFunctionStyleMacroParameter.java index c1ea4f437bd..259e586f3df 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFunctionStyleMacroParameter.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFunctionStyleMacroParameter.java @@ -11,20 +11,21 @@ package org.eclipse.cdt.core.dom.ast; /** - * This interface represents the name of a function style macro parameter. - * This is not an IASTName, as there are not any bindings for + * This interface represents the name of a function style macro parameter. This + * is not an IASTName, as there are not any bindings for * * @author jcamelon */ public interface IASTFunctionStyleMacroParameter extends IASTNode { /** - * Constant EMPTY_PARAMETER_ARRAY is used to return anempty array. + * Constant EMPTY_PARAMETER_ARRAY is used to return anempty + * array. */ public static final IASTFunctionStyleMacroParameter[] EMPTY_PARAMETER_ARRAY = new IASTFunctionStyleMacroParameter[0]; /** - * Get the parameter name. + * Get the parameter name. * * @return String name */ @@ -33,7 +34,8 @@ public interface IASTFunctionStyleMacroParameter extends IASTNode { /** * Set the parameter name. * - * @param value String + * @param value + * String */ public void setParameter(String value); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTGotoStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTGotoStatement.java index 2470e72471d..675057c89e9 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTGotoStatement.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTGotoStatement.java @@ -17,7 +17,7 @@ package org.eclipse.cdt.core.dom.ast; */ public interface IASTGotoStatement extends IASTStatement { - public static final ASTNodeProperty NAME = new ASTNodeProperty("name"); //$NON-NLS-1$ + public static final ASTNodeProperty NAME = new ASTNodeProperty("name"); //$NON-NLS-1$ /** * Returns the name of the label. The name resolves to a ILabel binding. @@ -25,12 +25,13 @@ public interface IASTGotoStatement extends IASTStatement { * @return IASTName */ public IASTName getName(); - + /** - * Set the name for a goto statement label. + * Set the name for a goto statement label. * - * @param name IASTName + * @param name + * IASTName */ public void setName(IASTName name); - + } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTIdExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTIdExpression.java index 0894f373db9..eb2912dcadf 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTIdExpression.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTIdExpression.java @@ -17,21 +17,24 @@ package org.eclipse.cdt.core.dom.ast; */ public interface IASTIdExpression extends IASTExpression { - /** - * ID_NAME represents the relationship between an IASTIdExpression and a IASTName. - */ - public static final ASTNodeProperty ID_NAME = new ASTNodeProperty( "IdExpression Name"); //$NON-NLS-1$ + /** + * ID_NAME represents the relationship between an + * IASTIdExpression and a IASTName. + */ + public static final ASTNodeProperty ID_NAME = new ASTNodeProperty( + "IdExpression Name"); //$NON-NLS-1$ + /** * Returns the name used in the expression. * * @return the name */ public IASTName getName(); - + /** * Set the name to be used inthe expression. * * @param name */ - public void setName( IASTName name ); + public void setName(IASTName name); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTIfStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTIfStatement.java index 52de688b3d9..d0dd99c8553 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTIfStatement.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTIfStatement.java @@ -17,18 +17,26 @@ package org.eclipse.cdt.core.dom.ast; */ public interface IASTIfStatement extends IASTStatement { - /** - * CONDITION represents the relationship between an IASTIfStatement and its nested IASTExpression. - */ - public static final ASTNodeProperty CONDITION = new ASTNodeProperty("condition"); //$NON-NLS-1$ - /** - * THEN represents the relationship between an IASTIfStatement and its nested IASTStatement (then). - */ - public static final ASTNodeProperty THEN = new ASTNodeProperty("then"); //$NON-NLS-1$ - /** - * ELSE represents the relationship between an IASTIfStatement and its nested IASTStatement (else). - */ - public static final ASTNodeProperty ELSE = new ASTNodeProperty("else"); //$NON-NLS-1$ + /** + * CONDITION represents the relationship between an + * IASTIfStatement and its nested IASTExpression. + */ + public static final ASTNodeProperty CONDITION = new ASTNodeProperty( + "condition"); //$NON-NLS-1$ + + /** + * THEN represents the relationship between an + * IASTIfStatement and its nested IASTStatement + * (then). + */ + public static final ASTNodeProperty THEN = new ASTNodeProperty("then"); //$NON-NLS-1$ + + /** + * ELSE represents the relationship between an + * IASTIfStatement and its nested IASTStatement + * (else). + */ + public static final ASTNodeProperty ELSE = new ASTNodeProperty("else"); //$NON-NLS-1$ /** * Get the condition in the if statement. @@ -36,40 +44,44 @@ public interface IASTIfStatement extends IASTStatement { * @return the condition IASTExpression */ public IASTExpression getCondition(); - + /** * Set the condition in the if statement. - * @param condition IASTExpression + * + * @param condition + * IASTExpression */ public void setCondition(IASTExpression condition); - + /** * Get the statement that is executed if the condition is true. * * @return the then clause IASTStatement */ public IASTStatement getThenClause(); - + /** - * Set the statement that is executed if the condition is true. + * Set the statement that is executed if the condition is true. * - * @param thenClause IASTStatement + * @param thenClause + * IASTStatement */ public void setThenClause(IASTStatement thenClause); - + /** - * Get the statement that is executed if the condition is false. This - * clause is optional and returns null if there is none. + * Get the statement that is executed if the condition is false. This clause + * is optional and returns null if there is none. * * @return the else clause or null IASTStatement */ public IASTStatement getElseClause(); /** - * Set the else clause. + * Set the else clause. * - * @param elseClause IASTStatement + * @param elseClause + * IASTStatement */ public void setElseClause(IASTStatement elseClause); - + } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTInitializer.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTInitializer.java index ea89836342d..a1acd5a0644 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTInitializer.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTInitializer.java @@ -16,10 +16,10 @@ package org.eclipse.cdt.core.dom.ast; * @author Doug Schaefer */ public interface IASTInitializer extends IASTNode { - + /** * Constant. */ - public final static IASTInitializer[] EMPTY_INITIALIZER_ARRAY = new IASTInitializer[0]; + public final static IASTInitializer[] EMPTY_INITIALIZER_ARRAY = new IASTInitializer[0]; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTInitializerExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTInitializerExpression.java index e335173670a..c5401ee2bd9 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTInitializerExpression.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTInitializerExpression.java @@ -17,21 +17,25 @@ package org.eclipse.cdt.core.dom.ast; */ public interface IASTInitializerExpression extends IASTInitializer { - /** - * INITIALIZER_EXPRESSION represents the relationship between an IASTInitializerExpression. and its IASTExpression. - */ - public static final ASTNodeProperty INITIALIZER_EXPRESSION = new ASTNodeProperty( "Initializer Expression"); //$NON-NLS-1$ + /** + * INITIALIZER_EXPRESSION represents the relationship between + * an IASTInitializerExpression. and its IASTExpression. + */ + public static final ASTNodeProperty INITIALIZER_EXPRESSION = new ASTNodeProperty( + "Initializer Expression"); //$NON-NLS-1$ + /** * Get the expression for the initializer. * * @return IASTExpression */ public IASTExpression getExpression(); - + /** - * Set the initializer's expression. + * Set the initializer's expression. * - * @param expression IASTExpression + * @param expression + * IASTExpression */ - public void setExpression( IASTExpression expression ); + public void setExpression(IASTExpression expression); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTInitializerList.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTInitializerList.java index 7020f91ea78..d78a1112205 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTInitializerList.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTInitializerList.java @@ -10,7 +10,6 @@ **********************************************************************/ package org.eclipse.cdt.core.dom.ast; - /** * This is an an initializer that is a list of initializers. * @@ -18,10 +17,12 @@ package org.eclipse.cdt.core.dom.ast; */ public interface IASTInitializerList extends IASTInitializer { - /** - * NESTED_INITIALIZER describes the relationship between an IASTInitializerList and its sub-IASTInitializers. - */ - public static final ASTNodeProperty NESTED_INITIALIZER = new ASTNodeProperty( "Nested Initializer" ); //$NON-NLS-1$ + /** + * NESTED_INITIALIZER describes the relationship between an + * IASTInitializerList and its sub-IASTInitializers. + */ + public static final ASTNodeProperty NESTED_INITIALIZER = new ASTNodeProperty( + "Nested Initializer"); //$NON-NLS-1$ /** * Get the list of initializers. @@ -29,11 +30,12 @@ public interface IASTInitializerList extends IASTInitializer { * @return IASTInitializer[] array of initializers */ public IASTInitializer[] getInitializers(); - + /** * Add an initializer to the initializer list. * - * @param initializer IASTInitializer + * @param initializer + * IASTInitializer */ - public void addInitializer( IASTInitializer initializer ); + public void addInitializer(IASTInitializer initializer); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTLabelStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTLabelStatement.java index 2a70e3fab63..9828164b1ff 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTLabelStatement.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTLabelStatement.java @@ -17,7 +17,7 @@ package org.eclipse.cdt.core.dom.ast; */ public interface IASTLabelStatement extends IASTStatement { - public static final ASTNodeProperty NAME = new ASTNodeProperty("name"); //$NON-NLS-1$ + public static final ASTNodeProperty NAME = new ASTNodeProperty("name"); //$NON-NLS-1$ /** * The name for the label. The name resolves to an ILabel binding. @@ -32,5 +32,5 @@ public interface IASTLabelStatement extends IASTStatement { * @param name */ public void setName(IASTName name); - + } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTLiteralExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTLiteralExpression.java index 73a291b9e9b..c3d2afb9577 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTLiteralExpression.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTLiteralExpression.java @@ -17,45 +17,51 @@ package org.eclipse.cdt.core.dom.ast; */ public interface IASTLiteralExpression extends IASTExpression { - /** - * An integer literal e.g. 5 - */ - public static final int lk_integer_constant = 0; - /** - * A floating point literal e.g. 6.0 - */ - public static final int lk_float_constant = 1; - /** - * A char literal e.g. 'abc' - */ - public static final int lk_char_constant = 2; - /** - * A string literal e.g. "abcdefg" - */ - public static final int lk_string_literal = 3; - /** - * A constant defined for subclasses to extend from. - */ - public static final int lk_last = lk_string_literal; - - /** - * Get the literal expression kind. - * - * @return int - */ - public int getKind(); - /** - * Set the literal expression kind. - * - * @param value int - */ - public void setKind( int value ); - - /** - * Set the value of the literal expression. - * - * @param value - */ - public void setValue( String value ); - + /** + * An integer literal e.g. 5 + */ + public static final int lk_integer_constant = 0; + + /** + * A floating point literal e.g. 6.0 + */ + public static final int lk_float_constant = 1; + + /** + * A char literal e.g. 'abc' + */ + public static final int lk_char_constant = 2; + + /** + * A string literal e.g. "abcdefg" + */ + public static final int lk_string_literal = 3; + + /** + * A constant defined for subclasses to extend from. + */ + public static final int lk_last = lk_string_literal; + + /** + * Get the literal expression kind. + * + * @return int + */ + public int getKind(); + + /** + * Set the literal expression kind. + * + * @param value + * int + */ + public void setKind(int value); + + /** + * Set the value of the literal expression. + * + * @param value + */ + public void setValue(String value); + } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTMacroExpansion.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTMacroExpansion.java index 02c7a943ef6..3f5a45913ad 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTMacroExpansion.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTMacroExpansion.java @@ -11,9 +11,9 @@ package org.eclipse.cdt.core.dom.ast; /** - * A Macro expansion is a node location. - * Nodes that have locations that arrive through the expansion of preprocessor macros - * will refer to these type of objects. + * A Macro expansion is a node location. Nodes that have locations that arrive + * through the expansion of preprocessor macros will refer to these type of + * objects. * * @author Doug Schaefer */ @@ -33,5 +33,5 @@ public interface IASTMacroExpansion extends IASTNodeLocation { * @return */ public IASTNodeLocation[] getExpansionLocations(); - + } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTName.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTName.java index e7f86e40b4d..eaec685b3e0 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTName.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTName.java @@ -11,8 +11,8 @@ package org.eclipse.cdt.core.dom.ast; /** - * This class represents a name in the program that represents a semantic - * object in the program. + * This class represents a name in the program that represents a semantic object + * in the program. * * The toString method produces a string representation of the name as * appropriate for the language. @@ -20,9 +20,9 @@ package org.eclipse.cdt.core.dom.ast; * @author Doug Schaefer */ public interface IASTName extends IASTNode { - + /** - * Constant sentinel. + * Constant sentinel. */ public static final IASTName[] EMPTY_NAME_ARRAY = new IASTName[0]; @@ -32,15 +32,15 @@ public interface IASTName extends IASTNode { * @return IBinding binding */ public IBinding resolveBinding(); - + /** - * Return a list of bindings in the scope of the name that have the - * name as a prefix. + * Return a list of bindings in the scope of the name that have the name as + * a prefix. * * @return IBinding [] bindings that start with this name */ public IBinding[] resolvePrefix(); - + /** * Return a char array representation of the name. * diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTNamedTypeSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTNamedTypeSpecifier.java index 77409d866a0..6edc9090447 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTNamedTypeSpecifier.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTNamedTypeSpecifier.java @@ -11,30 +11,32 @@ package org.eclipse.cdt.core.dom.ast; /** - * Represents the use of a typedef name in an decl specifier in C. - * Also used for class/struct/union names in C. + * Represents the use of a typedef name in an decl specifier in C. Also used for + * class/struct/union names in C. * * @author Doug Schaefer */ public interface IASTNamedTypeSpecifier extends IASTDeclSpecifier { /** - * NAME describes the relationship between an IASTNamedTypeSpecifier and its nested IASTName. + * NAME describes the relationship between an + * IASTNamedTypeSpecifier and its nested + * IASTName. */ - public static final ASTNodeProperty NAME = new ASTNodeProperty( "Name"); //$NON-NLS-1$ + public static final ASTNodeProperty NAME = new ASTNodeProperty("Name"); //$NON-NLS-1$ - /** - * Get the name. - * + /** + * Get the name. + * * @return the typedef name. */ public IASTName getName(); - + /** * Set the name. * * @param name */ - public void setName( IASTName name ); - + public void setName(IASTName name); + } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTNode.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTNode.java index f057c9f8db4..94fdedb9a27 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTNode.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTNode.java @@ -52,9 +52,10 @@ public interface IASTNode { public IASTNode getParent(); /** - * Set the parent node of this node in the tree. + * Set the parent node of this node in the tree. * - * @param node IASTNode + * @param node + * IASTNode */ public void setParent(IASTNode node); @@ -67,15 +68,15 @@ public interface IASTNode { public ASTNodeProperty getPropertyInParent(); /** - * Set the parent property of the node. + * Set the parent property of the node. * * @param property */ public void setPropertyInParent(ASTNodeProperty property); /** - * Abstract method to be overriden by all subclasses. - * Necessary for visitation of the tree using an ASTVisitor. + * Abstract method to be overriden by all subclasses. Necessary for + * visitation of the tree using an ASTVisitor. * * @param visitor * @return continue on (true) or quit( false ) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTNodeLocation.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTNodeLocation.java index fd1ffe9eaf7..2c471aa68f4 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTNodeLocation.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTNodeLocation.java @@ -11,22 +11,21 @@ package org.eclipse.cdt.core.dom.ast; /** - * A NodeLocation represents the source location of a given node. Most - * often this is a file it may be other fancy things like macro - * expansions. + * A NodeLocation represents the source location of a given node. Most often + * this is a file it may be other fancy things like macro expansions. * * @author Doug Schaefer */ public interface IASTNodeLocation { /** - * This is the offset into the actual source location that this node - * starts at. + * This is the offset into the actual source location that this node starts + * at. * * @return */ public int getNodeOffset(); - + /** * This is the length of the node contained in this location. * diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTNullStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTNullStatement.java index cc5835a835b..60fc797f0f6 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTNullStatement.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTNullStatement.java @@ -9,10 +9,8 @@ * IBM Rational Software - Initial API and implementation */ package org.eclipse.cdt.core.dom.ast; - /** - * This node represents a null statement. - * ';' + * This node represents a null statement. ';' * * @author jcamelon */ diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTParameterDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTParameterDeclaration.java index 3dff0968a54..af998cee283 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTParameterDeclaration.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTParameterDeclaration.java @@ -16,46 +16,55 @@ package org.eclipse.cdt.core.dom.ast; * @author Doug Schaefer */ public interface IASTParameterDeclaration extends IASTNode { - /** - * Constant/sentinel. - */ - public static final IASTParameterDeclaration [] EMPTY_PARAMETERDECLARATION_ARRAY = new IASTParameterDeclaration[0]; - /** - * DECL_SPECIFIER represents the relationship between an IASTParameterDeclaration and its nested IASTDeclSpecifier. + * Constant/sentinel. */ - public static final ASTNodeProperty DECL_SPECIFIER = new ASTNodeProperty( "Decl Specifier"); //$NON-NLS-1$ - /** - * DECLARATOR represents the relationship between an IASTParameterDeclaration and its nested IASTDeclarator. - */ - public static final ASTNodeProperty DECLARATOR = new ASTNodeProperty( "Declarator"); //$NON-NLS-1$ + public static final IASTParameterDeclaration[] EMPTY_PARAMETERDECLARATION_ARRAY = new IASTParameterDeclaration[0]; - /** - * Get the decl specifier. - * - * @return IASTDeclSpecifier - */ - public IASTDeclSpecifier getDeclSpecifier(); - /** - * Get the declarator. + * DECL_SPECIFIER represents the relationship between an + * IASTParameterDeclaration and its nested + * IASTDeclSpecifier. + */ + public static final ASTNodeProperty DECL_SPECIFIER = new ASTNodeProperty( + "Decl Specifier"); //$NON-NLS-1$ + + /** + * DECLARATOR represents the relationship between an + * IASTParameterDeclaration and its nested + * IASTDeclarator. + */ + public static final ASTNodeProperty DECLARATOR = new ASTNodeProperty( + "Declarator"); //$NON-NLS-1$ + + /** + * Get the decl specifier. + * + * @return IASTDeclSpecifier + */ + public IASTDeclSpecifier getDeclSpecifier(); + + /** + * Get the declarator. * * @return IASTDeclarator */ public IASTDeclarator getDeclarator(); - /** - * Set the decl specifier. - * - * @param declSpec IASTDeclSpecifier. - */ - public void setDeclSpecifier(IASTDeclSpecifier declSpec); + /** + * Set the decl specifier. + * + * @param declSpec + * IASTDeclSpecifier. + */ + public void setDeclSpecifier(IASTDeclSpecifier declSpec); + + /** + * Set the declarator. + * + * @param declarator + * IASTDeclarator + */ + public void setDeclarator(IASTDeclarator declarator); - /** - * Set the declarator. - * - * @param declarator IASTDeclarator - */ - public void setDeclarator(IASTDeclarator declarator); - } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPointer.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPointer.java index b68d4f71be0..7cb1b65a0d7 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPointer.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPointer.java @@ -24,24 +24,28 @@ public interface IASTPointer extends IASTPointerOperator { * @return boolean */ public boolean isConst(); + /** - * Is this a volatile pointer? + * Is this a volatile pointer? * * @return boolean */ public boolean isVolatile(); - + /** * Set this to be a const pointer (true/false). * - * @param value - the value + * @param value - + * the value */ - public void setConst( boolean value ); + public void setConst(boolean value); + /** * Set this to be a volatile pointer (true/false). * - * @param value - the value + * @param value - + * the value */ - public void setVolatile( boolean value ); + public void setVolatile(boolean value); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPointerOperator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPointerOperator.java index a5631c9d051..c8d164f3957 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPointerOperator.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPointerOperator.java @@ -15,9 +15,9 @@ package org.eclipse.cdt.core.dom.ast; */ public interface IASTPointerOperator extends IASTNode { - /** - * Constant/sentinel. - */ - public static final IASTPointerOperator[] EMPTY_ARRAY = new IASTPointerOperator[0]; + /** + * Constant/sentinel. + */ + public static final IASTPointerOperator[] EMPTY_ARRAY = new IASTPointerOperator[0]; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorElifStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorElifStatement.java index fcaa2f17aec..74ac6d49774 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorElifStatement.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorElifStatement.java @@ -15,13 +15,14 @@ package org.eclipse.cdt.core.dom.ast; * * @author jcamelon */ -public interface IASTPreprocessorElifStatement extends IASTPreprocessorStatement { +public interface IASTPreprocessorElifStatement extends + IASTPreprocessorStatement { + + /** + * Was this #elif branch taken? + * + * @return boolean + */ + public boolean taken(); - /** - * Was this #elif branch taken? - * - * @return boolean - */ - public boolean taken(); - } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorElseStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorElseStatement.java index 40824eb2ada..a194ab8b344 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorElseStatement.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorElseStatement.java @@ -15,11 +15,13 @@ package org.eclipse.cdt.core.dom.ast; * * @author jcamelon */ -public interface IASTPreprocessorElseStatement extends IASTPreprocessorStatement { +public interface IASTPreprocessorElseStatement extends + IASTPreprocessorStatement { - /** - * Was this #else branch taken? - * @return boolean - */ - public boolean taken(); + /** + * Was this #else branch taken? + * + * @return boolean + */ + public boolean taken(); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorEndifStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorEndifStatement.java index 8093a62bedb..9ac5c0c263d 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorEndifStatement.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorEndifStatement.java @@ -12,8 +12,10 @@ package org.eclipse.cdt.core.dom.ast; /** * This interface represent a preprocessor #endif statement. + * * @author jcamelon */ -public interface IASTPreprocessorEndifStatement extends IASTPreprocessorStatement{ - +public interface IASTPreprocessorEndifStatement extends + IASTPreprocessorStatement { + } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorErrorStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorErrorStatement.java index 09e734042db..e9e2f2cfb95 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorErrorStatement.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorErrorStatement.java @@ -16,6 +16,6 @@ package org.eclipse.cdt.core.dom.ast; * @author jcamelon */ public interface IASTPreprocessorErrorStatement extends - IASTPreprocessorStatement { + IASTPreprocessorStatement { } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorFunctionStyleMacroDefinition.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorFunctionStyleMacroDefinition.java index 69a50c20f33..2f44f283d94 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorFunctionStyleMacroDefinition.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorFunctionStyleMacroDefinition.java @@ -20,22 +20,24 @@ public interface IASTPreprocessorFunctionStyleMacroDefinition extends IASTPreprocessorMacroDefinition { /** - * This property represents the relationship between a function style macro definition and one of its parameters. + * This property represents the relationship between a function style macro + * definition and one of its parameters. */ public static final ASTNodeProperty PARAMETER = new ASTNodeProperty( "Function Macro Parameter"); //$NON-NLS-1$ /** - * Get the macro parameters. + * Get the macro parameters. * - * @return IASTFunctionStyleMacroParameter[] parameters + * @return IASTFunctionStyleMacroParameter[] parameters */ public IASTFunctionStyleMacroParameter[] getParameters(); /** - * Add a function-style macro parameter. + * Add a function-style macro parameter. * - * @param parm IASTFunctionStyleMacroParameter + * @param parm + * IASTFunctionStyleMacroParameter */ public void addParameter(IASTFunctionStyleMacroParameter parm); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorIfStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorIfStatement.java index a72149e5ae5..f4fc1cb53c6 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorIfStatement.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorIfStatement.java @@ -12,14 +12,15 @@ package org.eclipse.cdt.core.dom.ast; /** * This interface represent a preprocessor #if statement. + * * @author jcamelon */ public interface IASTPreprocessorIfStatement extends IASTPreprocessorStatement { - /** - * Was this branch taken? - * - * @return boolean - */ - public boolean taken(); + /** + * Was this branch taken? + * + * @return boolean + */ + public boolean taken(); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorIfdefStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorIfdefStatement.java index 3838a52f264..0549d1e713f 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorIfdefStatement.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorIfdefStatement.java @@ -12,13 +12,16 @@ package org.eclipse.cdt.core.dom.ast; /** * This interface represent a preprocessor #ifdef statement. + * * @author jcamelon */ -public interface IASTPreprocessorIfdefStatement extends IASTPreprocessorStatement { +public interface IASTPreprocessorIfdefStatement extends + IASTPreprocessorStatement { - /** - * Was this #ifdef branch taken? - * @return - */ - public boolean taken(); + /** + * Was this #ifdef branch taken? + * + * @return + */ + public boolean taken(); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorIfndefStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorIfndefStatement.java index 5cf34550b07..021421c490a 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorIfndefStatement.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorIfndefStatement.java @@ -16,11 +16,12 @@ package org.eclipse.cdt.core.dom.ast; * @author jcamelon */ public interface IASTPreprocessorIfndefStatement extends - IASTPreprocessorStatement { + IASTPreprocessorStatement { - /** - * Was this branch taken? - * @return - */ - public boolean taken(); + /** + * Was this branch taken? + * + * @return + */ + public boolean taken(); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorIncludeStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorIncludeStatement.java index 1973cdffb1a..c0fffcac469 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorIncludeStatement.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorIncludeStatement.java @@ -12,6 +12,7 @@ package org.eclipse.cdt.core.dom.ast; /** * This interface represent a preprocessor #include statement. + * * @author jcamelon */ public interface IASTPreprocessorIncludeStatement extends @@ -19,6 +20,7 @@ public interface IASTPreprocessorIncludeStatement extends /** * Get the full path filename of the file found through #include. + * * @return */ public String getPath(); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorMacroDefinition.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorMacroDefinition.java index fc75a9b2d35..c7053c8f88c 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorMacroDefinition.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorMacroDefinition.java @@ -15,35 +15,42 @@ package org.eclipse.cdt.core.dom.ast; * * @author Doug Schaefer */ -public interface IASTPreprocessorMacroDefinition extends IASTPreprocessorStatement { +public interface IASTPreprocessorMacroDefinition extends + IASTPreprocessorStatement { - /** - * MACRO_NAME describes the relationship between a macro definition and it's name. - */ - public static final ASTNodeProperty MACRO_NAME = new ASTNodeProperty( "Macro Name"); //$NON-NLS-1$ - /** - * Get the macro name. - * - * @return IASTName - */ - public IASTName getName(); - /** - * Set the macro name. - * - * @param name - */ - public void setName( IASTName name ); - - /** - * Get the macro expansion. - * - * @return String - */ - public String getExpansion(); - /** - * Set the macro expansion. - * - * @param exp String - */ - public void setExpansion( String exp ); + /** + * MACRO_NAME describes the relationship between a macro + * definition and it's name. + */ + public static final ASTNodeProperty MACRO_NAME = new ASTNodeProperty( + "Macro Name"); //$NON-NLS-1$ + + /** + * Get the macro name. + * + * @return IASTName + */ + public IASTName getName(); + + /** + * Set the macro name. + * + * @param name + */ + public void setName(IASTName name); + + /** + * Get the macro expansion. + * + * @return String + */ + public String getExpansion(); + + /** + * Set the macro expansion. + * + * @param exp + * String + */ + public void setExpansion(String exp); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorObjectStyleMacroDefinition.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorObjectStyleMacroDefinition.java index fb748fb7cef..5b3d1750a2a 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorObjectStyleMacroDefinition.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorObjectStyleMacroDefinition.java @@ -11,11 +11,12 @@ package org.eclipse.cdt.core.dom.ast; /** - * This interface represents an object-style macro definition. - * e.g. #define ONE_TWO_THREE 123 + * This interface represents an object-style macro definition. e.g. #define + * ONE_TWO_THREE 123 * * @author jcamelon */ -public interface IASTPreprocessorObjectStyleMacroDefinition extends IASTPreprocessorMacroDefinition { +public interface IASTPreprocessorObjectStyleMacroDefinition extends + IASTPreprocessorMacroDefinition { } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorPragmaStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorPragmaStatement.java index 7f6bc226ef4..f08ee492f40 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorPragmaStatement.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorPragmaStatement.java @@ -16,6 +16,6 @@ package org.eclipse.cdt.core.dom.ast; * @author jcamelon */ public interface IASTPreprocessorPragmaStatement extends - IASTPreprocessorStatement { + IASTPreprocessorStatement { } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorUndefStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorUndefStatement.java index 207cfd45160..2442cfae821 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorUndefStatement.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPreprocessorUndefStatement.java @@ -11,10 +11,11 @@ package org.eclipse.cdt.core.dom.ast; /** - * This interface represents a preprocessor #undef statement. + * This interface represents a preprocessor #undef statement. * * @author jcamelon */ -public interface IASTPreprocessorUndefStatement extends IASTPreprocessorStatement { +public interface IASTPreprocessorUndefStatement extends + IASTPreprocessorStatement { } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblem.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblem.java index 0db59161865..363733ce431 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblem.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblem.java @@ -15,377 +15,394 @@ import org.eclipse.cdt.internal.core.parser.ParserMessages; /** * @author jcamelon * - * Description of a C/C++ parse/compilation problem, as detected by the parser or some of the underlying - * clients of the parser. + * Description of a C/C++ parse/compilation problem, as detected by the parser + * or some of the underlying clients of the parser. * * A problem provides access to: * */ public interface IASTProblem extends IASTNode { - /** - * Returns the problem id - * - * @return the problem id - */ - int getID(); + /** + * Returns the problem id + * + * @return the problem id + */ + int getID(); - /** - * Answer a localized, human-readable message string which describes the problem. - * - * @return a localized, human-readable message string which describes the problem - */ - String getMessage(); + /** + * Answer a localized, human-readable message string which describes the + * problem. + * + * @return a localized, human-readable message string which describes the + * problem + */ + String getMessage(); - /** - * Return to the client a map between parameter names and values. - * - * The keys and values are all Strings. - * - * - * @return a map between parameter names and values. - */ - String getArguments(); + /** + * Return to the client a map between parameter names and values. + * + * The keys and values are all Strings. + * + * + * @return a map between parameter names and values. + */ + String getArguments(); - /** - * Checks the severity to see if the Error bit is set. - * - * @return true if the Error bit is set for the severity, false otherwise - */ - boolean isError(); + /** + * Checks the severity to see if the Error bit is set. + * + * @return true if the Error bit is set for the severity, false otherwise + */ + boolean isError(); - /** - * Checks the severity to see if the Warning bit is not set. - * - * @return true if the Warning bit is not set for the severity, false otherwise - */ - boolean isWarning(); + /** + * Checks the severity to see if the Warning bit is not set. + * + * @return true if the Warning bit is not set for the severity, false + * otherwise + */ + boolean isWarning(); - /** - * Unknown Numeric Value for line numbers and offsets; use this constant - */ - public final static int INT_VALUE_NOT_PROVIDED = -1; - - /** - * Unknown filename sentinel value - */ - public final static String FILENAME_NOT_PROVIDED = ParserMessages.getString("IProblem.unknownFileName"); //$NON-NLS-1$ + /** + * Unknown Numeric Value for line numbers and offsets; use this constant + */ + public final static int INT_VALUE_NOT_PROVIDED = -1; - /** - * Problem Categories - * The high bits of a problem ID contains information about the category of a problem. - * For example, (problemID & TypeRelated) != 0, indicates that this problem is type related. - * - * A problem category can help to implement custom problem filters. Indeed, when numerous problems - * are listed, focusing on import related problems first might be relevant. - * - * When a problem is tagged as Internal, it means that no change other than a local source code change - * can fix the corresponding problem. - */ - - /** - * IProblem relates to a valid error on the Scanner - */ - public final static int SCANNER_RELATED = 0x01000000; - - /** - * IProblem relates to a valid error on the preprocessor - */ - public final static int PREPROCESSOR_RELATED = 0x02000000; - - /** - * IProblem relates to a valid syntax error in the parser - */ - public final static int SYNTAX_RELATED = 0x04000000; - - /** - * IProblem relates to a valid semantical error in the parser - */ - public final static int SEMANTICS_RELATED = 0x08000000; - - /** - * IProblem relates to an implementation of design limitation - */ - public final static int INTERNAL_RELATED = 0x10000000; + /** + * Unknown filename sentinel value + */ + public final static String FILENAME_NOT_PROVIDED = ParserMessages + .getString("IProblem.unknownFileName"); //$NON-NLS-1$ + /** + * Problem Categories The high bits of a problem ID contains information + * about the category of a problem. For example, (problemID & TypeRelated) != + * 0, indicates that this problem is type related. + * + * A problem category can help to implement custom problem filters. Indeed, + * when numerous problems are listed, focusing on import related problems + * first might be relevant. + * + * When a problem is tagged as Internal, it means that no change other than + * a local source code change can fix the corresponding problem. + */ - /** - * Check the parameter bitmask against an IProblem's ID to broadly segregate the - * types of problems. - * - * @param bitmask - * @return true if ( (id & bitmask ) != 0 ) - */ - public boolean checkCategory(int bitmask); + /** + * IProblem relates to a valid error on the Scanner + */ + public final static int SCANNER_RELATED = 0x01000000; - /** - * Mask to use in order to filter out the category portion of the problem ID. - */ - public final static int IGNORE_CATEGORIES_MASK = 0xFFFFFF; + /** + * IProblem relates to a valid error on the preprocessor + */ + public final static int PREPROCESSOR_RELATED = 0x02000000; - /** - * Below are listed all available problem attributes. The JavaDoc for each problem ID indicates - * when they should be contributed to creating a problem of that type. - */ + /** + * IProblem relates to a valid syntax error in the parser + */ + public final static int SYNTAX_RELATED = 0x04000000; - // Preprocessor IProblem attributes - /** - * The text that follows a #error preprocessor directive - */ - public final static String A_PREPROC_POUND_ERROR = ParserMessages.getString("IProblem.preproc.poundError"); //$NON-NLS-1$ + /** + * IProblem relates to a valid semantical error in the parser + */ + public final static int SEMANTICS_RELATED = 0x08000000; - /** - * 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$ + /** + * IProblem relates to an implementation of design limitation + */ + public final static int INTERNAL_RELATED = 0x10000000; - /** - * A preprocessor macro name - */ - public final static String A_PREPROC_MACRO_NAME = ParserMessages.getString("IProblem.preproc.macro"); //$NON-NLS-1$ + /** + * Check the parameter bitmask against an IProblem's ID to broadly segregate + * the types of problems. + * + * @param bitmask + * @return true if ( (id & bitmask ) != 0 ) + */ + public boolean checkCategory(int bitmask); - /** - * A preprocessor conditional that could not be evaluated - * - * #if X + Y == Z <== that one, if X, Y or Z are not defined - * #endif - */ - public final static String A_PREPROC_CONDITION = ParserMessages.getString("IProblem.preproc.condition"); //$NON-NLS-1$ + /** + * Mask to use in order to filter out the category portion of the problem + * ID. + */ + public final static int IGNORE_CATEGORIES_MASK = 0xFFFFFF; - /** - * A preprocessor directive that could not be interpretted - * - * e.g. #blah - */ - public final static String A_PREPROC_UNKNOWN_DIRECTIVE = ParserMessages.getString("IProblem.preproc.unknownDirective"); //$NON-NLS-1$ + /** + * Below are listed all available problem attributes. The JavaDoc for each + * problem ID indicates when they should be contributed to creating a + * problem of that type. + */ - /** - * The preprocessor conditional statement that caused an unbalanced mismatch. - * - * #if X - * #else - * #else <=== that one - * #endif - */ - public final static String A_PREPROC_CONDITIONAL_MISMATCH = ParserMessages.getString("IProblem.preproc.conditionalMismatch"); //$NON-NLS-1$ + // Preprocessor IProblem attributes + /** + * The text that follows a #error preprocessor directive + */ + public final static String A_PREPROC_POUND_ERROR = ParserMessages + .getString("IProblem.preproc.poundError"); //$NON-NLS-1$ - /** - * The Bad character encountered in scanner - */ - public static final String A_SCANNER_BADCHAR = null; + /** + * The filename that failed somehow in an preprocessor include directive + */ + public final static String A_PREPROC_INCLUDE_FILENAME = ParserMessages + .getString("IProblem.preproc.include"); //$NON-NLS-1$ - /** - * A_SYMBOL_NAME - symbol name - */ - public static final String A_SYMBOL_NAME = ParserMessages.getString("IProblem.symbolName"); //$NON-NLS-1$ - - /** - * A_NAMESPACE_NAME = namespace name - */ - public static final String A_NAMESPACE_NAME = ParserMessages.getString("IProblem.namespaceName"); //$NON-NLS-1$ - - /** - * A_TYPE_NAME - type name - */ - public static final String A_TYPE_NAME = ParserMessages.getString("IProblem.typeName"); //$NON-NLS-1$ - - /** - * Below are listed all available problem IDs. Note that this list could be augmented in the future, - * as new features are added to the C/C++ core implementation. - */ + /** + * A preprocessor macro name + */ + public final static String A_PREPROC_MACRO_NAME = ParserMessages + .getString("IProblem.preproc.macro"); //$NON-NLS-1$ - /* - * Scanner Problems - */ - - /** - * Bad character encountered by Scanner. - * Required attributes: A_SCANNER_BADCHAR - * @see #A_SCANNER_BADCHAR - */ - public final static int SCANNER_BAD_CHARACTER = SCANNER_RELATED | 0x001; - - /** - * Unbounded literal string encountered by Scanner. - * Required attributes: none. - */ - public final static int SCANNER_UNBOUNDED_STRING = SCANNER_RELATED | 0x002; - - /** - * Invalid escape sequence encountered by Scanner. - * Required attributes: none. - */ - public final static int SCANNER_INVALID_ESCAPECHAR = SCANNER_RELATED | 0x003; - - /** - * Bad floating point encountered by Scanner. - * Required attributes: none. - */ - public final static int SCANNER_BAD_FLOATING_POINT = SCANNER_RELATED | 0x004; - - /** - * Bad hexidecimal encountered by Scanner. - * Required attributes: none. - */ - public final static int SCANNER_BAD_HEX_FORMAT = SCANNER_RELATED | 0x005; - - /** - * Unexpected EOF encountered by Scanner. - * Required attributes: none. - */ - public final static int SCANNER_UNEXPECTED_EOF = SCANNER_RELATED | 0x006; - - /** - * Bad octal encountered by Scanner. - * Required attributes: none. - */ - public final static int SCANNER_BAD_OCTAL_FORMAT = SCANNER_RELATED | 0x007; + /** + * A preprocessor conditional that could not be evaluated + * + * #if X + Y == Z <== that one, if X, Y or Z are not defined #endif + */ + public final static String A_PREPROC_CONDITION = ParserMessages + .getString("IProblem.preproc.condition"); //$NON-NLS-1$ - /** - * Bad decimal encountered by Scanner. - * Required attributes: none. - */ - public final static int SCANNER_BAD_DECIMAL_FORMAT = SCANNER_RELATED | 0x008; + /** + * A preprocessor directive that could not be interpretted + * + * e.g. #blah + */ + public final static String A_PREPROC_UNKNOWN_DIRECTIVE = ParserMessages + .getString("IProblem.preproc.unknownDirective"); //$NON-NLS-1$ - /** - * Assignment '=' encountered in macro by Scanner. - * Required attributes: none. - */ - public final static int SCANNER_ASSIGNMENT_NOT_ALLOWED = SCANNER_RELATED | 0x009; + /** + * The preprocessor conditional statement that caused an unbalanced + * mismatch. + * + * #if X #else #else <=== that one #endif + */ + public final static String A_PREPROC_CONDITIONAL_MISMATCH = ParserMessages + .getString("IProblem.preproc.conditionalMismatch"); //$NON-NLS-1$ - /** - * Division by 0 encountered in macro by Scanner. - * Required attributes: none. - */ - public final static int SCANNER_DIVIDE_BY_ZERO = SCANNER_RELATED | 0x00A; - - /** - * Missing ')' encountered in macro by Scanner. - * Required attributes: none. - */ - public final static int SCANNER_MISSING_R_PAREN = SCANNER_RELATED | 0x00B; + /** + * The Bad character encountered in scanner + */ + public static final String A_SCANNER_BADCHAR = null; - /** - * Expression syntax error encountered in macro by Scanner. - * Required attributes: none. - */ - public final static int SCANNER_EXPRESSION_SYNTAX_ERROR = SCANNER_RELATED | 0x00C; - - /** - * Expression syntax error encountered in macro by Scanner. - * Required attributes: none. - */ - public final static int SCANNER_ILLEGAL_IDENTIFIER = SCANNER_RELATED | 0x00D; + /** + * A_SYMBOL_NAME - symbol name + */ + public static final String A_SYMBOL_NAME = ParserMessages + .getString("IProblem.symbolName"); //$NON-NLS-1$ - /** - * Division by 0 encountered in macro by Scanner. - * Required attributes: none. - */ - public final static int SCANNER_BAD_CONDITIONAL_EXPRESSION = SCANNER_RELATED | 0x00E; - + /** + * A_NAMESPACE_NAME = namespace name + */ + public static final String A_NAMESPACE_NAME = ParserMessages + .getString("IProblem.namespaceName"); //$NON-NLS-1$ - /* - * Preprocessor Problems - */ - - /** - * #error encountered by Preprocessor. - * Required attributes: A_PREPROC_POUND_ERROR - * @see #A_PREPROC_POUND_ERROR - */ - public final static int PREPROCESSOR_POUND_ERROR = PREPROCESSOR_RELATED | 0x001; - - /** - * Inclusion not found by Preprocessor. - * Required attributes: A_PREPROC_INCLUDE_FILENAME - * @see #A_PREPROC_INCLUDE_FILENAME - */ - public final static int PREPROCESSOR_INCLUSION_NOT_FOUND = PREPROCESSOR_RELATED | 0x002; - - /** - * Macro definition not found by Preprocessor. - * Required attributes: A_PREPROC_MACRO_NAME - * @see #A_PREPROC_MACRO_NAME - */ - public final static int PREPROCESSOR_DEFINITION_NOT_FOUND = PREPROCESSOR_RELATED | 0x003; - - /** - * Preprocessor conditionals seem unbalanced. - * Required attributes: A_PREPROC_CONDITIONAL_MISMATCH - * @see #A_PREPROC_CONDITIONAL_MISMATCH - */ - - public final static int PREPROCESSOR_UNBALANCE_CONDITION = PREPROCESSOR_RELATED | 0x004; - - /** - * Invalid format to Macro definition. - * Required attributes: A_PREPROC_MACRO_NAME - * @see #A_PREPROC_MACRO_NAME - */ - public final static int PREPROCESSOR_INVALID_MACRO_DEFN = PREPROCESSOR_RELATED | 0x005; - - /** - * Invalid or unknown preprocessor directive encountered by Preprocessor. - * Required attributes: A_PREPROC_UNKNOWN_DIRECTIVE - * @see #A_PREPROC_UNKNOWN_DIRECTIVE - */ - public final static int PREPROCESSOR_INVALID_DIRECTIVE = PREPROCESSOR_RELATED | 0x006; - - /** - * Invalid macro redefinition encountered by Preprocessor. - * Required attributes: A_PREPROC_MACRO_NAME - * @see #A_PREPROC_MACRO_NAME - */ - public final static int PREPROCESSOR_INVALID_MACRO_REDEFN = PREPROCESSOR_RELATED | 0x007; - - /** - * Preprocessor Conditional cannot not be evaluated due. - * Required attributes: A_PREPROC_CONDITION - * @see #A_PREPROC_CONDITION - */ - public final static int PREPROCESSOR_CONDITIONAL_EVAL_ERROR = PREPROCESSOR_RELATED | 0x008; - - /** - * Invalid macro usage encountered by Preprocessor. - * Required attributes: A_PREPROC_MACRO_NAME - * @see #A_PREPROC_MACRO_NAME - */ - public final static int PREPROCESSOR_MACRO_USAGE_ERROR = PREPROCESSOR_RELATED | 0x009; - - /** - * Invalid Macro Pasting encountered by Preprocessor. - * Required attributes: A_PREPROC_MACRO_NAME - * @see #A_PREPROC_MACRO_NAME - */ - public final static int PREPROCESSOR_MACRO_PASTING_ERROR = PREPROCESSOR_RELATED | 0x00A; - - /** - * Circular inclusion encountered by Preprocessor. - * Required attributes: A_PREPROC_INCLUDE_FILENAME - * @see #A_PREPROC_INCLUDE_FILENAME - */ - public final static int PREPROCESSOR_CIRCULAR_INCLUSION = PREPROCESSOR_RELATED | 0x00B; - - /** - * macro argument "..." encountered without the required ')' i.e. must be last argument if used - * Required attributes: none - */ - public final static int PREPROCESSOR_MISSING_RPAREN_PARMLIST = PREPROCESSOR_RELATED | 0x00C; + /** + * A_TYPE_NAME - type name + */ + public static final String A_TYPE_NAME = ParserMessages + .getString("IProblem.typeName"); //$NON-NLS-1$ - /** - * __VA_ARGS__ encountered in macro definition without the required '...' parameter - * Required attributes: none - */ - public final static int PREPROCESSOR_INVALID_VA_ARGS = PREPROCESSOR_RELATED | 0x00D; - - /* - * Parser Syntactic Problems - */ - public final static int SYNTAX_ERROR = SYNTAX_RELATED | 0x001; + /** + * Below are listed all available problem IDs. Note that this list could be + * augmented in the future, as new features are added to the C/C++ core + * implementation. + */ + /* + * Scanner Problems + */ + + /** + * Bad character encountered by Scanner. Required attributes: + * A_SCANNER_BADCHAR + * + * @see #A_SCANNER_BADCHAR + */ + public final static int SCANNER_BAD_CHARACTER = SCANNER_RELATED | 0x001; + + /** + * Unbounded literal string encountered by Scanner. Required attributes: + * none. + */ + public final static int SCANNER_UNBOUNDED_STRING = SCANNER_RELATED | 0x002; + + /** + * Invalid escape sequence encountered by Scanner. Required attributes: + * none. + */ + public final static int SCANNER_INVALID_ESCAPECHAR = SCANNER_RELATED | 0x003; + + /** + * Bad floating point encountered by Scanner. Required attributes: none. + */ + public final static int SCANNER_BAD_FLOATING_POINT = SCANNER_RELATED | 0x004; + + /** + * Bad hexidecimal encountered by Scanner. Required attributes: none. + */ + public final static int SCANNER_BAD_HEX_FORMAT = SCANNER_RELATED | 0x005; + + /** + * Unexpected EOF encountered by Scanner. Required attributes: none. + */ + public final static int SCANNER_UNEXPECTED_EOF = SCANNER_RELATED | 0x006; + + /** + * Bad octal encountered by Scanner. Required attributes: none. + */ + public final static int SCANNER_BAD_OCTAL_FORMAT = SCANNER_RELATED | 0x007; + + /** + * Bad decimal encountered by Scanner. Required attributes: none. + */ + public final static int SCANNER_BAD_DECIMAL_FORMAT = SCANNER_RELATED | 0x008; + + /** + * Assignment '=' encountered in macro by Scanner. Required attributes: + * none. + */ + public final static int SCANNER_ASSIGNMENT_NOT_ALLOWED = SCANNER_RELATED | 0x009; + + /** + * Division by 0 encountered in macro by Scanner. Required attributes: none. + */ + public final static int SCANNER_DIVIDE_BY_ZERO = SCANNER_RELATED | 0x00A; + + /** + * Missing ')' encountered in macro by Scanner. Required attributes: none. + */ + public final static int SCANNER_MISSING_R_PAREN = SCANNER_RELATED | 0x00B; + + /** + * Expression syntax error encountered in macro by Scanner. Required + * attributes: none. + */ + public final static int SCANNER_EXPRESSION_SYNTAX_ERROR = SCANNER_RELATED | 0x00C; + + /** + * Expression syntax error encountered in macro by Scanner. Required + * attributes: none. + */ + public final static int SCANNER_ILLEGAL_IDENTIFIER = SCANNER_RELATED | 0x00D; + + /** + * Division by 0 encountered in macro by Scanner. Required attributes: none. + */ + public final static int SCANNER_BAD_CONDITIONAL_EXPRESSION = SCANNER_RELATED | 0x00E; + + /* + * Preprocessor Problems + */ + + /** + * #error encountered by Preprocessor. Required attributes: + * A_PREPROC_POUND_ERROR + * + * @see #A_PREPROC_POUND_ERROR + */ + public final static int PREPROCESSOR_POUND_ERROR = PREPROCESSOR_RELATED | 0x001; + + /** + * Inclusion not found by Preprocessor. Required attributes: + * A_PREPROC_INCLUDE_FILENAME + * + * @see #A_PREPROC_INCLUDE_FILENAME + */ + public final static int PREPROCESSOR_INCLUSION_NOT_FOUND = PREPROCESSOR_RELATED | 0x002; + + /** + * Macro definition not found by Preprocessor. Required attributes: + * A_PREPROC_MACRO_NAME + * + * @see #A_PREPROC_MACRO_NAME + */ + public final static int PREPROCESSOR_DEFINITION_NOT_FOUND = PREPROCESSOR_RELATED | 0x003; + + /** + * Preprocessor conditionals seem unbalanced. Required attributes: + * A_PREPROC_CONDITIONAL_MISMATCH + * + * @see #A_PREPROC_CONDITIONAL_MISMATCH + */ + + public final static int PREPROCESSOR_UNBALANCE_CONDITION = PREPROCESSOR_RELATED | 0x004; + + /** + * Invalid format to Macro definition. Required attributes: + * A_PREPROC_MACRO_NAME + * + * @see #A_PREPROC_MACRO_NAME + */ + public final static int PREPROCESSOR_INVALID_MACRO_DEFN = PREPROCESSOR_RELATED | 0x005; + + /** + * Invalid or unknown preprocessor directive encountered by Preprocessor. + * Required attributes: A_PREPROC_UNKNOWN_DIRECTIVE + * + * @see #A_PREPROC_UNKNOWN_DIRECTIVE + */ + public final static int PREPROCESSOR_INVALID_DIRECTIVE = PREPROCESSOR_RELATED | 0x006; + + /** + * Invalid macro redefinition encountered by Preprocessor. Required + * attributes: A_PREPROC_MACRO_NAME + * + * @see #A_PREPROC_MACRO_NAME + */ + public final static int PREPROCESSOR_INVALID_MACRO_REDEFN = PREPROCESSOR_RELATED | 0x007; + + /** + * Preprocessor Conditional cannot not be evaluated due. Required + * attributes: A_PREPROC_CONDITION + * + * @see #A_PREPROC_CONDITION + */ + public final static int PREPROCESSOR_CONDITIONAL_EVAL_ERROR = PREPROCESSOR_RELATED | 0x008; + + /** + * Invalid macro usage encountered by Preprocessor. Required attributes: + * A_PREPROC_MACRO_NAME + * + * @see #A_PREPROC_MACRO_NAME + */ + public final static int PREPROCESSOR_MACRO_USAGE_ERROR = PREPROCESSOR_RELATED | 0x009; + + /** + * Invalid Macro Pasting encountered by Preprocessor. Required attributes: + * A_PREPROC_MACRO_NAME + * + * @see #A_PREPROC_MACRO_NAME + */ + public final static int PREPROCESSOR_MACRO_PASTING_ERROR = PREPROCESSOR_RELATED | 0x00A; + + /** + * Circular inclusion encountered by Preprocessor. Required attributes: + * A_PREPROC_INCLUDE_FILENAME + * + * @see #A_PREPROC_INCLUDE_FILENAME + */ + public final static int PREPROCESSOR_CIRCULAR_INCLUSION = PREPROCESSOR_RELATED | 0x00B; + + /** + * macro argument "..." encountered without the required ')' i.e. must be + * last argument if used Required attributes: none + */ + public final static int PREPROCESSOR_MISSING_RPAREN_PARMLIST = PREPROCESSOR_RELATED | 0x00C; + + /** + * __VA_ARGS__ encountered in macro definition without the required '...' + * parameter Required attributes: none + */ + public final static int PREPROCESSOR_INVALID_VA_ARGS = PREPROCESSOR_RELATED | 0x00D; + + /* + * Parser Syntactic Problems + */ + public final static int SYNTAX_ERROR = SYNTAX_RELATED | 0x001; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblemDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblemDeclaration.java index fda77f28796..a1d72ddb653 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblemDeclaration.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblemDeclaration.java @@ -11,11 +11,12 @@ package org.eclipse.cdt.core.dom.ast; /** - * This interface represents a parse problem where we tried to match against a declaration. + * This interface represents a parse problem where we tried to match against a + * declaration. * * @author jcamelon */ -public interface IASTProblemDeclaration extends IASTDeclaration, IASTProblemHolder { - +public interface IASTProblemDeclaration extends IASTDeclaration, + IASTProblemHolder { } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblemExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblemExpression.java index 6f300a6a987..cdd03edc382 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblemExpression.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblemExpression.java @@ -10,12 +10,13 @@ **********************************************************************/ package org.eclipse.cdt.core.dom.ast; - /** - * This interface represents a parse problem where we tried to match against a expression. + * This interface represents a parse problem where we tried to match against a + * expression. * * @author jcamelon */ -public interface IASTProblemExpression extends IASTExpression, IASTProblemHolder { +public interface IASTProblemExpression extends IASTExpression, + IASTProblemHolder { } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblemHolder.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblemHolder.java index 327a77fd947..8b99c3c8686 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblemHolder.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblemHolder.java @@ -11,25 +11,30 @@ package org.eclipse.cdt.core.dom.ast; /** - * This interface represents a base interface to represent a problem owner or holder. + * This interface represents a base interface to represent a problem owner or + * holder. * * @author jcamelon */ public interface IASTProblemHolder { - /** - * PROBLEM represents the relationship between a IASTProblemHolder and its IASTProblem. - */ - public static final ASTNodeProperty PROBLEM = new ASTNodeProperty( "Problem"); //$NON-NLS-1$ - /** - * Get the problem. - * - * @return IASTProblem - */ - public IASTProblem getProblem(); - /** - * Set the problem. - * - * @param p IASTProblem - */ - public void setProblem(IASTProblem p); + /** + * PROBLEM represents the relationship between a + * IASTProblemHolder and its IASTProblem. + */ + public static final ASTNodeProperty PROBLEM = new ASTNodeProperty("Problem"); //$NON-NLS-1$ + + /** + * Get the problem. + * + * @return IASTProblem + */ + public IASTProblem getProblem(); + + /** + * Set the problem. + * + * @param p + * IASTProblem + */ + public void setProblem(IASTProblem p); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblemStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblemStatement.java index f6cae07be91..e09b82ac670 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblemStatement.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblemStatement.java @@ -11,10 +11,11 @@ package org.eclipse.cdt.core.dom.ast; /** - * This interface represents a parse problem where we tried to match against a statement. + * This interface represents a parse problem where we tried to match against a + * statement. + * * @author jcamelon */ public interface IASTProblemStatement extends IASTStatement, IASTProblemHolder { - } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblemTypeId.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblemTypeId.java index d9441fa763e..eb68ad6c3ec 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblemTypeId.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblemTypeId.java @@ -11,7 +11,8 @@ package org.eclipse.cdt.core.dom.ast; /** - * This interface represents a parse problem where we tried to match against a type-id. + * This interface represents a parse problem where we tried to match against a + * type-id. * * @author jcamelon */ diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTReturnStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTReturnStatement.java index 6bf91a646cd..83a9b84435f 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTReturnStatement.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTReturnStatement.java @@ -15,7 +15,13 @@ package org.eclipse.cdt.core.dom.ast; */ public interface IASTReturnStatement extends IASTStatement { - public static final ASTNodeProperty RETURNVALUE = new ASTNodeProperty("returnValue"); //$NON-NLS-1$ + /** + * RETURNVALUE represents the relationship between an + * IASTReturnStatement and it's nested + * IASTExpression. + */ + public static final ASTNodeProperty RETURNVALUE = new ASTNodeProperty( + "returnValue"); //$NON-NLS-1$ /** * This is the optional return value for this function. @@ -23,7 +29,13 @@ public interface IASTReturnStatement extends IASTStatement { * @return the return expression or null. */ public IASTExpression getReturnValue(); - + + /** + * Set the return value. + * + * @param returnValue + * IASTExpression + */ public void setReturnValue(IASTExpression returnValue); - + } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTSimpleDeclSpecifier.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTSimpleDeclSpecifier.java index 4287f143c2d..e03d94fdf5a 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTSimpleDeclSpecifier.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTSimpleDeclSpecifier.java @@ -18,32 +18,117 @@ package org.eclipse.cdt.core.dom.ast; public interface IASTSimpleDeclSpecifier extends IASTDeclSpecifier { /** - * This returns the built-in type for the declaration. The type is - * then refined by qualifiers for signed/unsigned and short/long. - * The type could also be unspecified which usually means int. + * This returns the built-in type for the declaration. The type is then + * refined by qualifiers for signed/unsigned and short/long. The type could + * also be unspecified which usually means int. * * @return */ public int getType(); - + + /** + * t_unspecified implies an unspecified type. .e.g x = 5; // + * declaration w/t_unspecified type logically defaults to integer. + */ public static final int t_unspecified = 0; + + /** + * t_void implies void type e.g. void x(); + */ public static final int t_void = 1; + + /** + * t_char implies char type e.g. char y; + */ public static final int t_char = 2; + + /** + * t_int implies int type e.g. int x; + */ public static final int t_int = 3; + + /** + * t_float implies floating point type. e.g. float yy; + */ public static final int t_float = 4; + + /** + * t_double implies double floating point type. e.g. double + * d; + */ public static final int t_double = 5; + + /** + * t_last specified for subinterface definition. + */ public static final int t_last = t_double; // used only in subclasses - - public void setType( int type ); - + + /** + * Set this decl specifier type to type. + * + * @param type + * (int) + */ + public void setType(int type); + + /** + * Is the type modified by the signed keyword? + * + * @return boolean + */ public boolean isSigned(); + + /** + * Is the type modified by the unsigned keyword? + * + * @return boolean + */ public boolean isUnsigned(); + + /** + * Is the type modified by the short keyword? + * + * @return boolean + */ public boolean isShort(); + + /** + * Is the type modified by the long keyword? + * + * @return boolean + */ public boolean isLong(); - - public void setSigned( boolean value ); - public void setUnsigned( boolean value ); - public void setLong( boolean value ); - public void setShort( boolean value ); - + + /** + * Change as to if the type is modified by the keyword signed. + * + * @param value + * boolean + */ + public void setSigned(boolean value); + + /** + * Change as to if the type is modified by the keyword unsigned. + * + * @param value + * boolean + */ + public void setUnsigned(boolean value); + + /** + * Change as to if the type is modified by the keyword long. + * + * @param value + * boolean + */ + public void setLong(boolean value); + + /** + * Change as to if the type is modified by the keyword short. + * + * @param value + * boolean + */ + public void setShort(boolean value); + } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTSimpleDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTSimpleDeclaration.java index 1b082417310..5d6e0aecd26 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTSimpleDeclaration.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTSimpleDeclaration.java @@ -10,7 +10,6 @@ **********************************************************************/ package org.eclipse.cdt.core.dom.ast; - /** * This is a simple declaration which contains a sequence of declSpecifiers * followed by a list of declarators. @@ -19,26 +18,51 @@ package org.eclipse.cdt.core.dom.ast; */ public interface IASTSimpleDeclaration extends IASTDeclaration, IASTNode { - ASTNodeProperty DECL_SPECIFIER = new ASTNodeProperty( "Decl Specifier"); //$NON-NLS-1$ - ASTNodeProperty DECLARATOR = new ASTNodeProperty( "Declarator"); //$NON-NLS-1$ + /** + * DECL_SPECIFIER represents the relationship between an + * IASTSimpleDeclaration and it's nested + * IASTDeclSpecifier. + */ + public static final ASTNodeProperty DECL_SPECIFIER = new ASTNodeProperty( + "Decl Specifier"); //$NON-NLS-1$ - /** + /** + * DECLARATOR represents the relationship between an + * IASTSimpleDeclaration and it's nested + * IASTDeclarators. + */ + public static final ASTNodeProperty DECLARATOR = new ASTNodeProperty( + "Declarator"); //$NON-NLS-1$ + + /** * This returns the object representing the declSpecifiers for this * declaration. * * @return the declSpecifier object */ public IASTDeclSpecifier getDeclSpecifier(); - - public void setDeclSpecifier( IASTDeclSpecifier declSpec ); + + /** + * Set the decl specifier. + * + * @param declSpec + * IASTDeclSpecifier + */ + public void setDeclSpecifier(IASTDeclSpecifier declSpec); /** * This returns the list of declarators in this declaration. * - * @return list of IASTDeclarator + * @return IASTDeclarator [] */ public IASTDeclarator[] getDeclarators(); - - public void addDeclarator( IASTDeclarator declarator ); - + + /** + * Add a declarator. + * + * @param declarator + * IASTDeclarator + */ + public void addDeclarator(IASTDeclarator declarator); + } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTStandardFunctionDeclarator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTStandardFunctionDeclarator.java index 128e44e4a93..5407a493651 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTStandardFunctionDeclarator.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTStandardFunctionDeclarator.java @@ -10,7 +10,6 @@ **********************************************************************/ package org.eclipse.cdt.core.dom.ast; - /** * This is a declarator for a non K&R C function. * @@ -18,17 +17,41 @@ package org.eclipse.cdt.core.dom.ast; */ public interface IASTStandardFunctionDeclarator extends IASTFunctionDeclarator { - public final static ASTNodeProperty FUNCTION_PARAMETER = new ASTNodeProperty( "Parameter"); //$NON-NLS-1$ + /** + * FUNCTION_PARAMETER represents the relationship between an + * IASTStandardFunctionDeclarator and it's nested + * IASTParameterDeclaration. + */ + public final static ASTNodeProperty FUNCTION_PARAMETER = new ASTNodeProperty( + "Parameter"); //$NON-NLS-1$ + /** * Gets the parameter declarations for the function * - * @return List of IASTParameterDeclaration + * @return array of IASTParameterDeclaration */ public IASTParameterDeclaration[] getParameters(); - - public void addParameterDeclaration( IASTParameterDeclaration parameter ); - + + /** + * Add a parameter. + * + * @param parameter + * IASTParameterDeclaration + */ + public void addParameterDeclaration(IASTParameterDeclaration parameter); + + /** + * Does this function take a variable number of arguments? + * + * @return boolean + */ public boolean takesVarArgs(); - - public void setVarArgs( boolean value ); + + /** + * Set whether or not this function takes a variable number or arguments. + * + * @param value + * boolean + */ + public void setVarArgs(boolean value); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTStatement.java index 84f29b04ee8..3fe68a14f34 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTStatement.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTStatement.java @@ -1,5 +1,5 @@ /********************************************************************** - * Copyright (c) 2004 IBM Corporation and others. + Z * Copyright (c) 2004 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Common Public License v1.0 * which accompanies this distribution, and is available at @@ -16,6 +16,9 @@ package org.eclipse.cdt.core.dom.ast; * @author Doug Schaefer */ public interface IASTStatement extends IASTNode { - public static final IASTStatement[] EMPTY_STATEMENT_ARRAY = new IASTStatement[0]; + /** + * Constant. + */ + public static final IASTStatement[] EMPTY_STATEMENT_ARRAY = new IASTStatement[0]; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTSwitchStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTSwitchStatement.java index 7e6bebce78e..be1d91d92c2 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTSwitchStatement.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTSwitchStatement.java @@ -17,8 +17,20 @@ package org.eclipse.cdt.core.dom.ast; */ public interface IASTSwitchStatement extends IASTStatement { - public static final ASTNodeProperty CONTROLLER = new ASTNodeProperty("controller"); //$NON-NLS-1$ - public static final ASTNodeProperty BODY = new ASTNodeProperty("body"); //$NON-NLS-1$ + /** + * CONTROLLER represents the relationship between an + * IASTSwitchStatement and it's nested + * IASTExpression. + */ + public static final ASTNodeProperty CONTROLLER = new ASTNodeProperty( + "controller"); //$NON-NLS-1$ + + /** + * BODY represents the relationship between an + * IASTSwitchStatement and it's nested + * IASTStatement. + */ + public static final ASTNodeProperty BODY = new ASTNodeProperty("body"); //$NON-NLS-1$ /** * This returns the expression which determines which case to take. @@ -26,18 +38,30 @@ public interface IASTSwitchStatement extends IASTStatement { * @return the controller expression */ public IASTExpression getController(); - - public void setController(IASTExpression controller); - + /** - * The body of the switch statement. + * Set the controlling expression for the switch. + * + * @param controller + * IASTExpression + */ + public void setController(IASTExpression controller); + + /** + * Returns the body of the switch statement. * * TODO - finding the cases could be a logical thing * - * @return + * @return IASTStatement */ public IASTStatement getBody(); + /** + * Set the body for the switch statement. + * + * @param body + * IASTStatement + */ public void setBody(IASTStatement body); - + } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTranslationUnit.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTranslationUnit.java index df08ce22b59..dc5cdc5b3c7 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTranslationUnit.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTranslationUnit.java @@ -17,61 +17,121 @@ package org.eclipse.cdt.core.dom.ast; */ public interface IASTTranslationUnit extends IASTNode { - public static final ASTNodeProperty OWNED_DECLARATION = new ASTNodeProperty( - "Owned"); //$NON-NLS-1$ - public static final ASTNodeProperty SCANNER_PROBLEM = new ASTNodeProperty( - "Scanner Problem"); //$NON-NLS-1$ - public static final ASTNodeProperty PREPROCESSOR_STATEMENT = new ASTNodeProperty( - "Inclusion"); //$NON-NLS-1$ + /** + * OWNED_DECLARATION represents the relationship between an IASTTranslationUnit and + * it's nested IASTDeclaration's. + */ + public static final ASTNodeProperty OWNED_DECLARATION = new ASTNodeProperty( + "Owned"); //$NON-NLS-1$ - /** - * A translation unit contains an ordered sequence of declarations. - * - * @return List of IASTDeclaration - */ - public IASTDeclaration[] getDeclarations(); + /** + * SCANNER_PROBLEM represents the relationship between an IASTTranslationUnit and + * it's nested IASTProblem. + */ + public static final ASTNodeProperty SCANNER_PROBLEM = new ASTNodeProperty( + "Scanner Problem"); //$NON-NLS-1$ - public void addDeclaration(IASTDeclaration declaration); + /** + * PREPROCESSOR_STATEMENT represents the relationship between an IASTTranslationUnit and + * it's nested IASTPreprocessorStatement. + */ + public static final ASTNodeProperty PREPROCESSOR_STATEMENT = new ASTNodeProperty( + "PP Statement"); //$NON-NLS-1$ - /** - * This returns the global scope for the translation unit. - * - * @return the global scope - */ - public IScope getScope(); + /** + * A translation unit contains an ordered sequence of declarations. + * + * @return List of IASTDeclaration + */ + public IASTDeclaration[] getDeclarations(); - /** - * Returns the list of declarations in this translation unit for the given - * binding. The list contains the IASTName nodes that declare the binding. - * - * @param binding - * @return List of IASTName nodes for the binding's declaration - */ - public IASTName[] getDeclarations(IBinding binding); + /** + * Add declaration to translation unit. + * + * @param declaration IASTDeclaration + */ + public void addDeclaration(IASTDeclaration declaration); - /** - * Returns the list of references in this translation unit to the given - * binding. This list contains the IASTName nodes that represent a use of the - * binding. - * - * @param binding - * @return List of IASTName nodes representing uses of the binding - */ - public IASTName[] getReferences(IBinding binding); + /** + * This returns the global scope for the translation unit. + * + * @return the global scope + */ + public IScope getScope(); - public IASTNodeLocation[] getLocationInfo(int offset, int length); + /** + * Returns the list of declarations in this translation unit for the given + * binding. The list contains the IASTName nodes that declare the binding. + * + * @param binding + * @return List of IASTName nodes for the binding's declaration + */ + public IASTName[] getDeclarations(IBinding binding); - public IASTNode selectNodeForLocation(String path, int offset, int length); + /** + * Returns the list of references in this translation unit to the given + * binding. This list contains the IASTName nodes that represent a use of + * the binding. + * + * @param binding + * @return List of IASTName nodes representing uses of the binding + */ + public IASTName[] getReferences(IBinding binding); - public IASTPreprocessorMacroDefinition[] getMacroDefinitions(); + /** + * @param offset + * @param length + * @return + */ + public IASTNodeLocation[] getLocationInfo(int offset, int length); - public IASTPreprocessorIncludeStatement[] getIncludeDirectives(); + /** + * Select the node in the treet that best fits the offset/length/file path. + * + * @param path - file name specified through path + * @param offset - location in the file as an offset + * @param length - length of selection + * @return IASTNode that best fits + */ + public IASTNode selectNodeForLocation(String path, int offset, int length); - public IASTPreprocessorStatement[] getAllPreprocessorStatements(); + /** + * Get the macro definitions encountered in parsing this translation unit. + * + * @return IASTPreprocessorMacroDefinition[] + */ + public IASTPreprocessorMacroDefinition[] getMacroDefinitions(); - public IASTProblem[] getPreprocesorProblems(); - - public String getUnpreprocessedSignature( IASTNodeLocation [] locations ); - - public String getFilePath(); + /** + * Get the #include directives encountered in parsing this translation unit. + * @return IASTPreprocessorIncludeStatement[] + */ + public IASTPreprocessorIncludeStatement[] getIncludeDirectives(); + + /** + * Get all preprocessor statements. + * + * @return IASTPreprocessorStatement[] + */ + public IASTPreprocessorStatement[] getAllPreprocessorStatements(); + + /** + * Get all preprocessor and scanner problems. + * @return IASTProblem[] + */ + public IASTProblem[] getPreprocessorProblems(); + + /** + * For a given range of locations, return a String that represents what is there underneath the range. + * + * @param locations A range of node locations + * @return A String signature. + */ + public String getUnpreprocessedSignature(IASTNodeLocation[] locations); + + /** + * Get the translation unit's full path. + * @return String representation of path. + */ + public String getFilePath(); } \ No newline at end of file diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTypeId.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTypeId.java index 7b3bb32e525..014b7308779 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTypeId.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTypeId.java @@ -13,14 +13,48 @@ package org.eclipse.cdt.core.dom.ast; * @author jcamelon */ public interface IASTTypeId extends IASTNode { - - 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$ - - public IASTDeclSpecifier getDeclSpecifier(); - public void setDeclSpecifier( IASTDeclSpecifier declSpec ); - public IASTDeclarator getAbstractDeclarator(); - public void setAbstractDeclarator( IASTDeclarator abstractDeclarator ); + + /** + * Constant. + */ + public static final IASTTypeId[] EMPTY_TYPEID_ARRAY = new IASTTypeId[0]; + + /** + * DECL_SPECIFIER represents the relationship between an IASTTypeId and + * it's nested IASTDeclSpecifier. + */ + public static final ASTNodeProperty DECL_SPECIFIER = new ASTNodeProperty( + "Decl Specifier"); //$NON-NLS-1$ + + /** + * ABSTRACT_DECLARATOR represents the relationship between an IASTTypeId and + * it's nested IASTDeclarator. + */ + public static final ASTNodeProperty ABSTRACT_DECLARATOR = new ASTNodeProperty( + "Abstract Declarator"); //$NON-NLS-1$ + + /** + * Get the decl specifier. + * @return IASTDeclSpecifier + */ + public IASTDeclSpecifier getDeclSpecifier(); + + /** + * Set the decl specifier. + * @param declSpec IASTDeclSpecifier + */ + public void setDeclSpecifier(IASTDeclSpecifier declSpec); + + /** + * Get the abstract declarator. + * + * @return IASTDeclarator + */ + public IASTDeclarator getAbstractDeclarator(); + + /** + * Set the abstract declarator. + * @param abstractDeclarator IASTDeclarator + */ + public void setAbstractDeclarator(IASTDeclarator abstractDeclarator); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTypeIdExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTypeIdExpression.java index 9162bbb7eca..fd2810ba3ee 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTypeIdExpression.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTypeIdExpression.java @@ -14,14 +14,46 @@ package org.eclipse.cdt.core.dom.ast; */ public interface IASTTypeIdExpression extends IASTExpression { - public static final int op_sizeof = 0; - public static final int op_last = op_sizeof; - - public int getOperator(); - public void setOperator( int value ); - - public static final ASTNodeProperty TYPE_ID = new ASTNodeProperty( "Type Id"); //$NON-NLS-1$ - public void setTypeId( IASTTypeId typeId ); - public IASTTypeId getTypeId(); + /** + * op_sizeof sizeof( typeId ) expression + */ + public static final int op_sizeof = 0; + + /** + * op_last defined for sub-interfaces to extend. + */ + public static final int op_last = op_sizeof; + + /** + * Get the operator for the expression. + * + * @return int + */ + public int getOperator(); + + /** + * Set the operator for the expression. + * @param value int + */ + public void setOperator(int value); + + /** + * TYPEID represents the relationship between an IASTTypeIdExpression and + * it's nested IASTTypeId. + */ + public static final ASTNodeProperty TYPE_ID = new ASTNodeProperty("Type Id"); //$NON-NLS-1$ + + /** + * Set the type Id. + * @param typeId + */ + public void setTypeId(IASTTypeId typeId); + + /** + * Get the type Id. + * + * @return + */ + public IASTTypeId getTypeId(); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTUnaryExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTUnaryExpression.java index 517b5161557..37cfb259b7e 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTUnaryExpression.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTUnaryExpression.java @@ -10,31 +10,121 @@ package org.eclipse.cdt.core.dom.ast; /** + * This interface is used to represent a unary expression in the AST. + * * @author jcamelon */ public interface IASTUnaryExpression extends IASTExpression { - public static final int op_prefixIncr = 0; - public static final int op_prefixDecr = 1; - public static final int op_plus = 2; - public static final int op_minus = 3; - public static final int op_star = 4; - public static final int op_amper = 5; - public static final int op_tilde = 6; - public static final int op_not = 7; - public static final int op_sizeof = 8; - public static final int op_postFixIncr = 9; - public static final int op_postFixDecr = 10; - public static final int op_bracketedPrimary = 11; - public static final int op_last = op_bracketedPrimary; - - public int getOperator(); - public void setOperator( int value ); - - public static final ASTNodeProperty OPERAND = new ASTNodeProperty( "Operand" ); //$NON-NLS-1$ - - - public IASTExpression getOperand(); - public void setOperand( IASTExpression expression ); - + /** + * Prefix increment. + * op_prefixIncr ++exp + */ + public static final int op_prefixIncr = 0; + + /** + * Prefix decrement. + * op_prefixDecr --exp + */ + public static final int op_prefixDecr = 1; + + /** + * Operator plus. + * op_plus ==> + exp + */ + public static final int op_plus = 2; + + /** + * Operator minus. + * op_minux ==> -exp + */ + public static final int op_minus = 3; + + /** + * Operator star. + * op_star ==> *exp + */ + public static final int op_star = 4; + + /** + * Operator ampersand. + * op_amper ==> &exp + */ + public static final int op_amper = 5; + + /** + * Operator tilde. + * op_tilde ==> ~exp + */ + public static final int op_tilde = 6; + + /** + * not. + * op_not ==> ! exp + */ + public static final int op_not = 7; + + /** + * sizeof. + * op_sizeof ==> sizeof exp + */ + public static final int op_sizeof = 8; + + /** + * Postfix increment. + * op_postFixIncr ==> exp++ + */ + public static final int op_postFixIncr = 9; + + /** + * Postfix decrement. + * op_bracketedPrimary ==> exp-- + */ + public static final int op_postFixDecr = 10; + + /** + * A bracketed expression. + * op_bracketedPrimary ==> ( exp ) + */ + public static final int op_bracketedPrimary = 11; + + /** + * op_last is made available for subclasses. + */ + public static final int op_last = op_bracketedPrimary; + + /** + * Get the operator/kind. + * + * @return (int) + */ + public int getOperator(); + + /** + * Set the operator/kind. + * + * @param value (int) value + */ + public void setOperator(int value); + + /** + * OPERAND represents the relationship between an IASTUnaryExpression and + * it's nested IASTExpression. + */ + public static final ASTNodeProperty OPERAND = new ASTNodeProperty("Operand"); //$NON-NLS-1$ + + /** + * Get the operand. + * + * @return IASTExpression + */ + public IASTExpression getOperand(); + + /** + * Set the operand. + * + * @param expression IASTExpression + */ + public void setOperand(IASTExpression expression); + } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTWhileStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTWhileStatement.java index 9bfe98b3996..f37daa6d978 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTWhileStatement.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTWhileStatement.java @@ -17,17 +17,33 @@ package org.eclipse.cdt.core.dom.ast; */ public interface IASTWhileStatement extends IASTStatement { - public static final ASTNodeProperty CONDITIONEXPRESSION = new ASTNodeProperty("condition"); //$NON-NLS-1$ - public static final ASTNodeProperty BODY = new ASTNodeProperty("body"); //$NON-NLS-1$ + /** + * CONDITIONEXPRESSION represents the relationship between an IASTWhileStatement and + * it's nested IASTExpression. + */ + public static final ASTNodeProperty CONDITIONEXPRESSION = new ASTNodeProperty( + "condition"); //$NON-NLS-1$ /** - * The condition on the while loop + * BODY represents the relationship between an IASTWhileStatement and + * it's nested IASTStatement. + */ + public static final ASTNodeProperty BODY = new ASTNodeProperty("body"); //$NON-NLS-1$ + + /** + * Get the condition on the while loop * * @return expression for the condition */ public IASTExpression getCondition(); + + /** + * Set the condition of the while loop. + * + * @param condition + */ public void setCondition(IASTExpression condition); - + /** * The body of the loop. * @@ -35,6 +51,11 @@ public interface IASTWhileStatement extends IASTStatement { */ public IASTStatement getBody(); + /** + * Set the body of the while loop. + * + * @param body + */ public void setBody(IASTStatement body); - + } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTTranslationUnit.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTTranslationUnit.java index 63f3b0db044..4e16677473f 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTTranslationUnit.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTTranslationUnit.java @@ -447,7 +447,7 @@ public class CASTTranslationUnit extends CASTNode implements * * @see org.eclipse.cdt.core.dom.ast.IASTTranslationUnit#getPreprocesorProblems() */ - public IASTProblem[] getPreprocesorProblems() { + public IASTProblem[] getPreprocessorProblems() { if (resolver == null) return EMPTY_PROBLEM_ARRAY; IASTProblem[] result = resolver.getScannerProblems(); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTTranslationUnit.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTTranslationUnit.java index 8979ac1c8de..ea53ebfea22 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTTranslationUnit.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTTranslationUnit.java @@ -432,7 +432,7 @@ public class CPPASTTranslationUnit extends CPPASTNode implements * * @see org.eclipse.cdt.core.dom.ast.IASTTranslationUnit#getPreprocesorProblems() */ - public IASTProblem[] getPreprocesorProblems() { + public IASTProblem[] getPreprocessorProblems() { if (resolver == null) return EMPTY_PROBLEM_ARRAY; IASTProblem[] result = resolver.getScannerProblems(); diff --git a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/DOMAST.java b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/DOMAST.java index 4e6eccba8ed..aa79371910f 100644 --- a/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/DOMAST.java +++ b/core/org.eclipse.cdt.ui.tests/src/org/eclipse/cdt/ui/tests/DOMAST/DOMAST.java @@ -384,7 +384,7 @@ public class DOMAST extends ViewPart { if (monitor.isCanceled()) return Status.CANCEL_STATUS; monitor.subTask(RETRIEVING_PREPROCESSOR_PROBLEMS); start=System.currentTimeMillis(); - IASTProblem[] problems = tu.getPreprocesorProblems(); + IASTProblem[] problems = tu.getPreprocessorProblems(); monitor.worked(5); System.out.println("[DOM AST View] done " + RETRIEVING_PREPROCESSOR_PROBLEMS + ": " + (System.currentTimeMillis()- start) );