Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 253690 | Differences between
and this patch

Collapse All | Expand All

(-)parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTLiteralExpression.java (-7 / +27 lines)
Lines 13-18 Link Here
13
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
13
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
14
import org.eclipse.cdt.core.dom.ast.IType;
14
import org.eclipse.cdt.core.dom.ast.IType;
15
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTLiteralExpression;
15
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTLiteralExpression;
16
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
16
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
17
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
17
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
18
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
18
19
Lines 23-35 Link Here
23
public class CPPASTLiteralExpression extends ASTNode implements ICPPASTLiteralExpression {
24
public class CPPASTLiteralExpression extends ASTNode implements ICPPASTLiteralExpression {
24
25
25
    private int kind;
26
    private int kind;
26
    private String value = "";  //$NON-NLS-1$
27
    private char[] value = CharArrayUtils.EMPTY;
27
28
28
    
29
    public CPPASTLiteralExpression() {
29
    public CPPASTLiteralExpression() {
30
	}
30
	}
31
31
32
	public CPPASTLiteralExpression(int kind, String value) {
32
	public CPPASTLiteralExpression(int kind, char[] value) {
33
		this.kind = kind;
33
		this.kind = kind;
34
		this.value = value;
34
		this.value = value;
35
	}
35
	}
Lines 39-54 Link Here
39
    }
39
    }
40
40
41
    public void setKind(int value) {
41
    public void setKind(int value) {
42
        this.kind = value;
42
        kind = value;
43
    }
43
    }
44
44
45
    public void setValue(String value) {
45
    public char[] getValue() {
46
        this.value = value;
46
    	return value;
47
    }
48
49
    public void setValue(char[] value) {
50
    	this.value= value;
47
    }
51
    }
48
    
52
    
49
    @Override
53
    @Override
50
	public String toString() {
54
	public String toString() {
51
        return value;
55
        return new String(value);
52
    }
56
    }
53
57
54
    @Override
58
    @Override
Lines 74-77 Link Here
74
    	return CPPVisitor.getExpressionType(this);
78
    	return CPPVisitor.getExpressionType(this);
75
    }
79
    }
76
    
80
    
81
    /**
82
     * @deprecated, use {@link #setValue(char[])}, instead.
83
     */
84
    @Deprecated
85
	public void setValue(String value) {
86
        this.value = value.toCharArray();
87
    }
88
    
89
90
    /**
91
     * @deprecated use {@link #CPPASTLiteralExpression(int, char[])}, instead.
92
     */
93
	@Deprecated
94
	public CPPASTLiteralExpression(int kind, String value) {
95
		this(kind, value.toCharArray());
96
	}
77
}
97
}
(-)parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTLiteralExpression.java (-6 / +6 lines)
Lines 1-12 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2004, 2005 IBM Corporation and others.
2
 * Copyright (c) 2004, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 * IBM - Initial API and implementation
9
 *    John Camelon (IBM) - Initial API and implementation
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.cdt.core.dom.ast.cpp;
11
package org.eclipse.cdt.core.dom.ast.cpp;
12
12
Lines 15-38 Link Here
15
/**
15
/**
16
 * C++ adds additional literal types to primary expression.
16
 * C++ adds additional literal types to primary expression.
17
 * 
17
 * 
18
 * @author jcamelon
18
 * @noimplement This interface is not intended to be implemented by clients.
19
 */
19
 */
20
public interface ICPPASTLiteralExpression extends IASTLiteralExpression {
20
public interface ICPPASTLiteralExpression extends IASTLiteralExpression {
21
21
22
	/**
22
	/**
23
	 * <code>lk_this</code> represents the 'this' keyword.
23
	 * <code>lk_this</code> represents the 'this' keyword.
24
	 */
24
	 */
25
	public static final int lk_this = IASTLiteralExpression.lk_last + 1;
25
	public static final int lk_this = IASTLiteralExpression.lk_this;
26
26
27
	/**
27
	/**
28
	 * <code>lk_true</code> represents the 'true' keyword.
28
	 * <code>lk_true</code> represents the 'true' keyword.
29
	 */
29
	 */
30
	public static final int lk_true = IASTLiteralExpression.lk_last + 2;
30
	public static final int lk_true = IASTLiteralExpression.lk_true;
31
31
32
	/**
32
	/**
33
	 * <code>lk_false</code> represents the 'false' keyword.
33
	 * <code>lk_false</code> represents the 'false' keyword.
34
	 */
34
	 */
35
	public static final int lk_false = IASTLiteralExpression.lk_last + 3;
35
	public static final int lk_false = IASTLiteralExpression.lk_false;
36
36
37
	/**
37
	/**
38
	 * <code>lk_last</code> is maintained for future subinterfaces.
38
	 * <code>lk_last</code> is maintained for future subinterfaces.
(-)parser/org/eclipse/cdt/core/dom/ast/IASTLiteralExpression.java (-13 / +45 lines)
Lines 1-19 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2004, 2005 IBM Corporation and others.
2
 * Copyright (c) 2004, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 * IBM - Initial API and implementation
9
 *    Doug Schaefer (IBM) - Initial API and implementation
10
 *    Markus Schorn (Wind River Systems)
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.cdt.core.dom.ast;
12
package org.eclipse.cdt.core.dom.ast;
12
13
13
/**
14
/**
14
 * This expression represents a literal in the program.
15
 * This expression represents a literal in the program.
15
 * 
16
 * 
16
 * @author Doug Schaefer
17
 * @noimplement This interface is not intended to be implemented by clients.
17
 */
18
 */
18
public interface IASTLiteralExpression extends IASTExpression {
19
public interface IASTLiteralExpression extends IASTExpression {
19
20
Lines 28-66 Link Here
28
	public static final int lk_float_constant = 1;
29
	public static final int lk_float_constant = 1;
29
30
30
	/**
31
	/**
31
	 * A char literal e.g. 'abc'
32
	 * A char literal e.g. 'a'
32
	 */
33
	 */
33
	public static final int lk_char_constant = 2;
34
	public static final int lk_char_constant = 2;
34
35
35
	/**
36
	/**
36
	 * A string literal e.g. "abcdefg"
37
	 * A string literal e.g. "a literal"
37
	 */
38
	 */
38
	public static final int lk_string_literal = 3;
39
	public static final int lk_string_literal = 3;
39
40
40
	/**
41
	/**
41
	 * A constant defined for subclasses to extend from.
42
	 * A constant defined for subclasses to extend from.
43
	 * @deprecated all possible values must be defined in {@link IASTLiteralExpression}.
42
	 */
44
	 */
45
	@Deprecated
43
	public static final int lk_last = lk_string_literal;
46
	public static final int lk_last = lk_string_literal;
44
47
45
	/**
48
	/**
49
	 * <code>lk_this</code> represents the 'this' keyword for  c++ only.
50
	 * @since 5.1
51
	 */
52
	public static final int lk_this = 4;
53
54
	/**
55
	 * <code>lk_true</code> represents the 'true' keyword.
56
	 * @since 5.1
57
	 */
58
	public static final int lk_true = 5;
59
60
	/**
61
	 * <code>lk_false</code> represents the 'false' keyword.
62
	 * @since 5.1
63
	 */
64
	public static final int lk_false = 6;
65
66
	/**
46
	 * Get the literal expression kind.
67
	 * Get the literal expression kind.
47
	 * 
48
	 * @return int
49
	 */
68
	 */
50
	public int getKind();
69
	public int getKind();
51
70
52
	/**
71
	/**
72
	 * Returns the value of the literal as char-array.
73
	 * @since 5.1
74
	 */
75
	public char[] getValue();
76
77
	/**
78
	 * Returns the value of the literal as string.
79
	 * @since 5.1
80
	 */
81
	public String toString();
82
	
83
	/**
53
	 * Set the literal expression kind.
84
	 * Set the literal expression kind.
54
	 * 
55
	 * @param value
56
	 *            int
57
	 */
85
	 */
58
	public void setKind(int value);
86
	public void setKind(int value);
59
87
60
	/**
88
	/**
61
	 * Set the value of the literal expression.
89
	 * Provide the value for the expression.
62
	 * 
90
	 * @since 5.1
63
	 * @param value
91
	 */
92
	public void setValue(char[] value);
93
	
94
	/**
95
	 * @deprecated, use {@link #setValue(char[])}, instead. 
64
	 */
96
	 */
65
	public void setValue(String value);
97
	public void setValue(String value);
66
98
(-)parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTLiteralExpression.java (-10 / +29 lines)
Lines 6-35 Link Here
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 * IBM Rational Software - Initial API and implementation
9
 *    John Camelon (IBM Rational Software) - Initial API and implementation
10
 * Yuan Zhang / Beth Tibbitts (IBM Research)
10
 *    Yuan Zhang / Beth Tibbitts (IBM Research)
11
 *    Markus Schorn (Wind River Systems)
11
 *******************************************************************************/
12
 *******************************************************************************/
12
package org.eclipse.cdt.internal.core.dom.parser.c;
13
package org.eclipse.cdt.internal.core.dom.parser.c;
13
14
14
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
15
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
15
import org.eclipse.cdt.core.dom.ast.IASTLiteralExpression;
16
import org.eclipse.cdt.core.dom.ast.IASTLiteralExpression;
16
import org.eclipse.cdt.core.dom.ast.IType;
17
import org.eclipse.cdt.core.dom.ast.IType;
18
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
17
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
19
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
18
20
19
/**
21
/**
20
 * @author jcamelon
22
 * Represents a literal
21
 */
23
 */
22
public class CASTLiteralExpression extends ASTNode implements IASTLiteralExpression {
24
public class CASTLiteralExpression extends ASTNode implements IASTLiteralExpression {
23
25
24
    private int kind;
26
    private int kind;
25
    private String value = ""; //$NON-NLS-1$
27
    private char[] value = CharArrayUtils.EMPTY;
26
28
27
    
28
    
29
    public CASTLiteralExpression() {
29
    public CASTLiteralExpression() {
30
	}
30
	}
31
31
32
	public CASTLiteralExpression(int kind, String value) {
32
	public CASTLiteralExpression(int kind, char[] value) {
33
		this.kind = kind;
33
		this.kind = kind;
34
		this.value = value;
34
		this.value = value;
35
	}
35
	}
Lines 42-54 Link Here
42
        kind = value;
42
        kind = value;
43
    }
43
    }
44
44
45
    public void setValue(String value) {
45
    public char[] getValue() {
46
        this.value = value;
46
    	return value;
47
    }
48
49
    public void setValue(char[] value) {
50
    	this.value= value;
47
    }
51
    }
48
    
52
    
49
    @Override
53
    @Override
50
	public String toString() {
54
	public String toString() {
51
        return value;
55
        return new String(value);
52
    }
56
    }
53
57
54
    @Override
58
    @Override
Lines 74-77 Link Here
74
    	return CVisitor.getExpressionType(this);
78
    	return CVisitor.getExpressionType(this);
75
    }
79
    }
76
    
80
    
81
    /**
82
     * @deprecated, use {@link #setValue(char[])}, instead.
83
     */
84
    @Deprecated
85
	public void setValue(String value) {
86
        this.value = value.toCharArray();
87
    }
88
    
89
    /**
90
     * @deprecated use {@link #CASTLiteralExpression(int, char[])}, instead.
91
     */
92
	@Deprecated
93
	public CASTLiteralExpression(int kind, String value) {
94
		this(kind, value.toCharArray());
95
	}
77
}
96
}
(-)parser/org/eclipse/cdt/internal/core/dom/parser/Value.java (-5 / +4 lines)
Lines 24-30 Link Here
24
import org.eclipse.cdt.core.dom.ast.IEnumerator;
24
import org.eclipse.cdt.core.dom.ast.IEnumerator;
25
import org.eclipse.cdt.core.dom.ast.IValue;
25
import org.eclipse.cdt.core.dom.ast.IValue;
26
import org.eclipse.cdt.core.dom.ast.IVariable;
26
import org.eclipse.cdt.core.dom.ast.IVariable;
27
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTLiteralExpression;
28
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
27
import org.eclipse.cdt.core.dom.ast.cpp.ICPPBinding;
29
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateNonTypeParameter;
28
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateNonTypeParameter;
30
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
29
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
Lines 229-247 Link Here
229
		if (e instanceof IASTLiteralExpression) {
228
		if (e instanceof IASTLiteralExpression) {
230
			IASTLiteralExpression litEx= (IASTLiteralExpression) e;
229
			IASTLiteralExpression litEx= (IASTLiteralExpression) e;
231
			switch (litEx.getKind()) {
230
			switch (litEx.getKind()) {
232
			case ICPPASTLiteralExpression.lk_false:
231
			case IASTLiteralExpression.lk_false:
233
				return "0";
232
				return "0";
234
			case ICPPASTLiteralExpression.lk_true:
233
			case IASTLiteralExpression.lk_true:
235
				return "1";
234
				return "1";
236
			case IASTLiteralExpression.lk_integer_constant:
235
			case IASTLiteralExpression.lk_integer_constant:
237
				try {
236
				try {
238
					return ExpressionEvaluator.getNumber(e.toString().toCharArray());
237
					return ExpressionEvaluator.getNumber(litEx.getValue());
239
				} catch (EvalException e1) {
238
				} catch (EvalException e1) {
240
					throw UNKNOWN_EX;
239
					throw UNKNOWN_EX;
241
				}
240
				}
242
			case IASTLiteralExpression.lk_char_constant:
241
			case IASTLiteralExpression.lk_char_constant:
243
				try {
242
				try {
244
					final char[] image= e.toString().toCharArray();
243
					final char[] image= litEx.getValue();
245
					if (image.length > 1)
244
					if (image.length > 1)
246
						if (image[0] == 'L') 
245
						if (image[0] == 'L') 
247
							return ExpressionEvaluator.getChar(image, 2);
246
							return ExpressionEvaluator.getChar(image, 2);
(-)src/org/eclipse/cdt/internal/ui/refactoring/extractfunction/ExtractExpression.java (-4 / +4 lines)
Lines 29-35 Link Here
29
import org.eclipse.cdt.core.dom.ast.IBinding;
29
import org.eclipse.cdt.core.dom.ast.IBinding;
30
import org.eclipse.cdt.core.dom.ast.IType;
30
import org.eclipse.cdt.core.dom.ast.IType;
31
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTBinaryExpression;
31
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTBinaryExpression;
32
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTLiteralExpression;
33
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNewExpression;
32
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNewExpression;
34
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
33
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTQualifiedName;
35
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTSimpleDeclSpecifier;
34
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTSimpleDeclSpecifier;
Lines 61-73 Link Here
61
 * 
60
 * 
62
 */
61
 */
63
public class ExtractExpression extends ExtractedFunctionConstructionHelper {
62
public class ExtractExpression extends ExtractedFunctionConstructionHelper {
63
	final static char[] ZERO= {'0'};
64
64
65
	@Override
65
	@Override
66
	public void constructMethodBody(IASTCompoundStatement compound,
66
	public void constructMethodBody(IASTCompoundStatement compound,
67
			List<IASTNode> list, ASTRewrite rewrite, TextEditGroup group) {
67
			List<IASTNode> list, ASTRewrite rewrite, TextEditGroup group) {
68
68
69
		CPPASTReturnStatement statement = new CPPASTReturnStatement();
69
		CPPASTReturnStatement statement = new CPPASTReturnStatement();
70
		IASTExpression nullReturnExp = new CPPASTLiteralExpression(IASTLiteralExpression.lk_integer_constant, "0"); //$NON-NLS-1$
70
		IASTExpression nullReturnExp = new CPPASTLiteralExpression(IASTLiteralExpression.lk_integer_constant, ZERO); 
71
		statement.setReturnValue(nullReturnExp);
71
		statement.setReturnValue(nullReturnExp);
72
		ASTRewrite nestedRewrite = rewrite.insertBefore(compound, null, statement, group);
72
		ASTRewrite nestedRewrite = rewrite.insertBefore(compound, null, statement, group);
73
		
73
		
Lines 112-120 Link Here
112
              return createSimpleDeclSpecifier(IASTSimpleDeclSpecifier.t_int);
112
              return createSimpleDeclSpecifier(IASTSimpleDeclSpecifier.t_int);
113
          case IASTLiteralExpression.lk_string_literal:
113
          case IASTLiteralExpression.lk_string_literal:
114
              return createSimpleDeclSpecifier(ICPPASTSimpleDeclSpecifier.t_wchar_t);
114
              return createSimpleDeclSpecifier(ICPPASTSimpleDeclSpecifier.t_wchar_t);
115
          case ICPPASTLiteralExpression.lk_false: 
115
          case IASTLiteralExpression.lk_false: 
116
              //Like lk_true a boolean type
116
              //Like lk_true a boolean type
117
          case ICPPASTLiteralExpression.lk_true:
117
          case IASTLiteralExpression.lk_true:
118
              return createSimpleDeclSpecifier(ICPPASTSimpleDeclSpecifier.t_bool);
118
              return createSimpleDeclSpecifier(ICPPASTSimpleDeclSpecifier.t_bool);
119
          default:
119
          default:
120
              return null;
120
              return null;
(-)src/org/eclipse/cdt/internal/ui/refactoring/extractconstant/ExtractConstantRefactoring.java (-5 / +4 lines)
Lines 43-49 Link Here
43
import org.eclipse.cdt.core.dom.ast.IBinding;
43
import org.eclipse.cdt.core.dom.ast.IBinding;
44
import org.eclipse.cdt.core.dom.ast.cpp.CPPASTVisitor;
44
import org.eclipse.cdt.core.dom.ast.cpp.CPPASTVisitor;
45
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
45
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCompositeTypeSpecifier;
46
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTLiteralExpression;
47
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamespaceDefinition;
46
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamespaceDefinition;
48
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTSimpleDeclSpecifier;
47
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTSimpleDeclSpecifier;
49
import org.eclipse.cdt.core.dom.rewrite.ASTRewrite;
48
import org.eclipse.cdt.core.dom.rewrite.ASTRewrite;
Lines 328-339 Link Here
328
		case IASTLiteralExpression.lk_string_literal:
327
		case IASTLiteralExpression.lk_string_literal:
329
			declSpec.setType(ICPPASTSimpleDeclSpecifier.t_wchar_t);
328
			declSpec.setType(ICPPASTSimpleDeclSpecifier.t_wchar_t);
330
			break;
329
			break;
331
		case ICPPASTLiteralExpression.lk_false: 
330
		case IASTLiteralExpression.lk_false: 
332
			//Like lk_true a boolean type
331
			//Like lk_true a boolean type
333
		case ICPPASTLiteralExpression.lk_true:
332
		case IASTLiteralExpression.lk_true:
334
			declSpec.setType(ICPPASTSimpleDeclSpecifier.t_bool);
333
			declSpec.setType(ICPPASTSimpleDeclSpecifier.t_bool);
335
			break;
334
			break;
336
		case ICPPASTLiteralExpression.lk_this:
335
		case IASTLiteralExpression.lk_this:
337
			break;
336
			break;
338
		}
337
		}
339
338
Lines 348-354 Link Here
348
			IASTUnaryExpression unary = (IASTUnaryExpression) target.getParent();
347
			IASTUnaryExpression unary = (IASTUnaryExpression) target.getParent();
349
			init.setExpression(unary);
348
			init.setExpression(unary);
350
		} else {
349
		} else {
351
			CPPASTLiteralExpression expression = new CPPASTLiteralExpression(target.getKind(), target.toString());
350
			CPPASTLiteralExpression expression = new CPPASTLiteralExpression(target.getKind(), target.getValue());
352
			init.setExpression(expression);
351
			init.setExpression(expression);
353
		}
352
		}
354
		decl.setInitializer(init);
353
		decl.setInitializer(init);
(-)src/org/eclipse/cdt/internal/ui/refactoring/gettersandsetters/FunctionFactory.java (-1 / +2 lines)
Lines 16-21 Link Here
16
import org.eclipse.cdt.core.dom.ast.IASTPointerOperator;
16
import org.eclipse.cdt.core.dom.ast.IASTPointerOperator;
17
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclSpecifier;
17
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclSpecifier;
18
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
18
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
19
import org.eclipse.cdt.core.parser.Keywords;
19
20
20
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTBinaryExpression;
21
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTBinaryExpression;
21
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTCompoundStatement;
22
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTCompoundStatement;
Lines 89-95 Link Here
89
		CPPASTBinaryExpression binExpr = new CPPASTBinaryExpression();
90
		CPPASTBinaryExpression binExpr = new CPPASTBinaryExpression();
90
		CPPASTFieldReference fieldRef = new CPPASTFieldReference();
91
		CPPASTFieldReference fieldRef = new CPPASTFieldReference();
91
		CPPASTLiteralExpression litExpr = new CPPASTLiteralExpression();
92
		CPPASTLiteralExpression litExpr = new CPPASTLiteralExpression();
92
		litExpr.setValue("this"); //$NON-NLS-1$
93
		litExpr.setValue(Keywords.cTHIS); 
93
		fieldRef.setFieldOwner(litExpr);
94
		fieldRef.setFieldOwner(litExpr);
94
		fieldRef.setFieldName(fieldDeclaration.getDeclarators()[0].getName());
95
		fieldRef.setFieldName(fieldDeclaration.getDeclarators()[0].getName());
95
		fieldRef.setIsPointerDereference(true);
96
		fieldRef.setIsPointerDereference(true);

Return to bug 253690