mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 17:26:01 +02:00
Removed 3 deprecated methods.
Change-Id: I75ea53a574817c0c91161a38d4209c428a55521b
This commit is contained in:
parent
a913d61e4f
commit
5d40605a40
7 changed files with 28 additions and 102 deletions
|
@ -1091,7 +1091,7 @@ public class AST2Tests extends AST2TestBase {
|
||||||
IASTFunctionCallExpression fcall = (IASTFunctionCallExpression) expStatement.getExpression();
|
IASTFunctionCallExpression fcall = (IASTFunctionCallExpression) expStatement.getExpression();
|
||||||
IASTIdExpression fcall_id = (IASTIdExpression) fcall.getFunctionNameExpression();
|
IASTIdExpression fcall_id = (IASTIdExpression) fcall.getFunctionNameExpression();
|
||||||
IASTName name_fcall = fcall_id.getName();
|
IASTName name_fcall = fcall_id.getName();
|
||||||
assertNull(fcall.getParameterExpression());
|
assertEquals(0, fcall.getArguments().length);
|
||||||
|
|
||||||
// void f() {}
|
// void f() {}
|
||||||
IASTFunctionDefinition fdef = (IASTFunctionDefinition) tu.getDeclarations()[2];
|
IASTFunctionDefinition fdef = (IASTFunctionDefinition) tu.getDeclarations()[2];
|
||||||
|
@ -4955,7 +4955,7 @@ public class AST2Tests extends AST2TestBase {
|
||||||
IASTFunctionDefinition func= (IASTFunctionDefinition) tu.getDeclarations()[0];
|
IASTFunctionDefinition func= (IASTFunctionDefinition) tu.getDeclarations()[0];
|
||||||
|
|
||||||
IASTFunctionCallExpression fcall= (IASTFunctionCallExpression) ((IASTExpressionStatement)((IASTCompoundStatement) func.getBody()).getStatements()[0]).getExpression();
|
IASTFunctionCallExpression fcall= (IASTFunctionCallExpression) ((IASTExpressionStatement)((IASTCompoundStatement) func.getBody()).getStatements()[0]).getExpression();
|
||||||
IASTLiteralExpression lit= (IASTLiteralExpression) fcall.getParameterExpression();
|
IASTLiteralExpression lit= (IASTLiteralExpression) fcall.getArguments()[0];
|
||||||
assertEquals("\"this is a string\"", lit.toString());
|
assertEquals("\"this is a string\"", lit.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5397,8 +5397,11 @@ public class AST2Tests extends AST2TestBase {
|
||||||
IASTFunctionCallExpression f= (IASTFunctionCallExpression) expr;
|
IASTFunctionCallExpression f= (IASTFunctionCallExpression) expr;
|
||||||
polishNotation(f.getFunctionNameExpression(), buf);
|
polishNotation(f.getFunctionNameExpression(), buf);
|
||||||
buf.append(',');
|
buf.append(',');
|
||||||
polishNotation(f.getParameterExpression(), buf);
|
for (IASTInitializerClause arg : f.getArguments()) {
|
||||||
buf.append(",()");
|
polishNotation((IASTExpression) arg, buf);
|
||||||
|
buf.append(',');
|
||||||
|
}
|
||||||
|
buf.append("()");
|
||||||
} else if (expr instanceof IASTArraySubscriptExpression) {
|
} else if (expr instanceof IASTArraySubscriptExpression) {
|
||||||
IASTArraySubscriptExpression f= (IASTArraySubscriptExpression) expr;
|
IASTArraySubscriptExpression f= (IASTArraySubscriptExpression) expr;
|
||||||
polishNotation(f.getArrayExpression(), buf);
|
polishNotation(f.getArrayExpression(), buf);
|
||||||
|
|
|
@ -61,19 +61,4 @@ public interface IASTFunctionCallExpression extends IASTExpression {
|
||||||
* @since 5.2
|
* @since 5.2
|
||||||
*/
|
*/
|
||||||
public void setArguments(IASTInitializerClause[] args);
|
public void setArguments(IASTInitializerClause[] args);
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public static final ASTNodeProperty PARAMETERS = ARGUMENT;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Replaced by {@link #setArguments(IASTInitializerClause[])}.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public void setParameterExpression(IASTExpression expression);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Replaced by {@link #getArguments()}.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public IASTExpression getParameterExpression();
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,6 @@ package org.eclipse.cdt.internal.core.dom.parser.c;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpressionList;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTFunctionCallExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTFunctionCallExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTInitializerClause;
|
import org.eclipse.cdt.core.dom.ast.IASTInitializerClause;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
|
@ -157,40 +156,4 @@ public class CASTFunctionCallExpression extends ASTNode
|
||||||
public final ValueCategory getValueCategory() {
|
public final ValueCategory getValueCategory() {
|
||||||
return ValueCategory.PRVALUE;
|
return ValueCategory.PRVALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@Deprecated
|
|
||||||
public IASTExpression getParameterExpression() {
|
|
||||||
if (fArguments.length == 0)
|
|
||||||
return null;
|
|
||||||
if (fArguments.length == 1) {
|
|
||||||
IASTInitializerClause arg = fArguments[0];
|
|
||||||
if (arg instanceof IASTExpression)
|
|
||||||
return (IASTExpression) arg;
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
CASTExpressionList result= new CASTExpressionList();
|
|
||||||
for (IASTInitializerClause arg : fArguments) {
|
|
||||||
if (arg instanceof IASTExpression) {
|
|
||||||
result.addExpression(((IASTExpression) arg).copy());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
result.setParent(this);
|
|
||||||
result.setPropertyInParent(ARGUMENT);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Deprecated
|
|
||||||
public void setParameterExpression(IASTExpression expression) {
|
|
||||||
assertNotFrozen();
|
|
||||||
if (expression == null) {
|
|
||||||
setArguments(null);
|
|
||||||
} else if (expression instanceof IASTExpressionList) {
|
|
||||||
setArguments(((IASTExpressionList) expression).getExpressions());
|
|
||||||
} else {
|
|
||||||
setArguments(new IASTExpression[] {expression});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -277,7 +277,13 @@ public class CNodeFactory extends NodeFactory implements ICNodeFactory {
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public IASTFunctionCallExpression newFunctionCallExpression(IASTExpression idExpr, IASTExpression argList) {
|
public IASTFunctionCallExpression newFunctionCallExpression(IASTExpression idExpr, IASTExpression argList) {
|
||||||
CASTFunctionCallExpression result = new CASTFunctionCallExpression(idExpr, null);
|
CASTFunctionCallExpression result = new CASTFunctionCallExpression(idExpr, null);
|
||||||
result.setParameterExpression(argList);
|
if (argList == null) {
|
||||||
|
result.setArguments(null);
|
||||||
|
} else if (argList instanceof IASTExpressionList) {
|
||||||
|
result.setArguments(((IASTExpressionList) argList).getExpressions());
|
||||||
|
} else {
|
||||||
|
result.setArguments(new IASTExpression[] {argList});
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,6 @@ import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExpression;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExpressionList;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionCallExpression;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionCallExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTInitializerClause;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTInitializerClause;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
|
@ -240,42 +239,6 @@ public class CPPASTFunctionCallExpression extends ASTNode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
@Override
|
|
||||||
public IASTExpression getParameterExpression() {
|
|
||||||
if (fArguments.length == 0)
|
|
||||||
return null;
|
|
||||||
if (fArguments.length == 1) {
|
|
||||||
IASTInitializerClause arg = fArguments[0];
|
|
||||||
if (arg instanceof IASTExpression)
|
|
||||||
return (IASTExpression) arg;
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
CPPASTExpressionList result= new CPPASTExpressionList();
|
|
||||||
for (IASTInitializerClause arg : fArguments) {
|
|
||||||
if (arg instanceof IASTExpression) {
|
|
||||||
result.addExpression(((IASTExpression) arg).copy());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
result.setParent(this);
|
|
||||||
result.setPropertyInParent(ARGUMENT);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
@Override
|
|
||||||
public void setParameterExpression(IASTExpression expression) {
|
|
||||||
assertNotFrozen();
|
|
||||||
if (expression == null) {
|
|
||||||
setArguments(null);
|
|
||||||
} else if (expression instanceof ICPPASTExpressionList) {
|
|
||||||
setArguments(((ICPPASTExpressionList) expression).getExpressions());
|
|
||||||
} else {
|
|
||||||
setArguments(new IASTExpression[] {expression});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ICPPFunction getOverload() {
|
public ICPPFunction getOverload() {
|
||||||
ICPPEvaluation eval = getEvaluation();
|
ICPPEvaluation eval = getEvaluation();
|
||||||
|
|
|
@ -450,7 +450,13 @@ public class CPPNodeFactory extends NodeFactory implements ICPPNodeFactory {
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public ICPPASTFunctionCallExpression newFunctionCallExpression(IASTExpression idExpr, IASTExpression argList) {
|
public ICPPASTFunctionCallExpression newFunctionCallExpression(IASTExpression idExpr, IASTExpression argList) {
|
||||||
CPPASTFunctionCallExpression result = new CPPASTFunctionCallExpression(idExpr, null);
|
CPPASTFunctionCallExpression result = new CPPASTFunctionCallExpression(idExpr, null);
|
||||||
result.setParameterExpression(argList);
|
if (argList == null) {
|
||||||
|
result.setArguments(null);
|
||||||
|
} else if (argList instanceof ICPPASTExpressionList) {
|
||||||
|
result.setArguments(((ICPPASTExpressionList) argList).getExpressions());
|
||||||
|
} else {
|
||||||
|
result.setArguments(new IASTExpression[] {argList});
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,9 +10,6 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.core.lrparser.tests;
|
package org.eclipse.cdt.core.lrparser.tests;
|
||||||
|
|
||||||
import junit.framework.TestCase;
|
|
||||||
import junit.framework.TestSuite;
|
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTArrayDeclarator;
|
import org.eclipse.cdt.core.dom.ast.IASTArrayDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTArrayModifier;
|
import org.eclipse.cdt.core.dom.ast.IASTArrayModifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTArraySubscriptExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTArraySubscriptExpression;
|
||||||
|
@ -20,11 +17,11 @@ import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclarationStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclarationStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpressionList;
|
import org.eclipse.cdt.core.dom.ast.IASTEqualsInitializer;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpressionStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTExpressionStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTFunctionCallExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTFunctionCallExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
|
import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTEqualsInitializer;
|
import org.eclipse.cdt.core.dom.ast.IASTInitializerClause;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTLiteralExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTLiteralExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTPreprocessorMacroDefinition;
|
import org.eclipse.cdt.core.dom.ast.IASTPreprocessorMacroDefinition;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTPreprocessorStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTPreprocessorStatement;
|
||||||
|
@ -35,6 +32,9 @@ import org.eclipse.cdt.core.dom.ast.IASTUnaryExpression;
|
||||||
import org.eclipse.cdt.core.dom.lrparser.gnu.GCCLanguage;
|
import org.eclipse.cdt.core.dom.lrparser.gnu.GCCLanguage;
|
||||||
import org.eclipse.cdt.core.model.ILanguage;
|
import org.eclipse.cdt.core.model.ILanguage;
|
||||||
|
|
||||||
|
import junit.framework.TestCase;
|
||||||
|
import junit.framework.TestSuite;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO these tests can be moved into the core
|
* TODO these tests can be moved into the core
|
||||||
|
@ -109,8 +109,8 @@ public class LRDigraphTrigraphTests extends TestCase {
|
||||||
|
|
||||||
// printf(\"%c??/n\", arr??(4??));
|
// printf(\"%c??/n\", arr??(4??));
|
||||||
IASTFunctionCallExpression expr2 = (IASTFunctionCallExpression)((IASTExpressionStatement)statements[2]).getExpression();
|
IASTFunctionCallExpression expr2 = (IASTFunctionCallExpression)((IASTExpressionStatement)statements[2]).getExpression();
|
||||||
IASTExpressionList params = (IASTExpressionList) expr2.getParameterExpression();
|
IASTInitializerClause[] args = expr2.getArguments();
|
||||||
IASTArraySubscriptExpression arr_op2 = (IASTArraySubscriptExpression)params.getExpressions()[1];
|
IASTArraySubscriptExpression arr_op2 = (IASTArraySubscriptExpression) args[1];
|
||||||
assertEquals("4", ((IASTLiteralExpression)arr_op2.getSubscriptExpression()).toString());
|
assertEquals("4", ((IASTLiteralExpression)arr_op2.getSubscriptExpression()).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue