mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-21 21:52:10 +02:00
Cosmetics.
Change-Id: I473deba48684e751905fbfa487df6fe9146781c2 Signed-off-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
This commit is contained in:
parent
bec85475fd
commit
94aa97e0b6
55 changed files with 725 additions and 630 deletions
|
@ -169,7 +169,7 @@ public final class CxxAstUtils {
|
|||
* For any BinaryExpression, guess the type from the other operand. (A good
|
||||
* guess for =, ==; hard to get a better guess for others)
|
||||
*
|
||||
* @return inferred type or null if couldn't infer
|
||||
* @return inferred type or {@code null} if couldn't infer
|
||||
*/
|
||||
private static IType tryInferTypeFromBinaryExpr(IASTName astName) {
|
||||
if (astName.getParent() instanceof IASTIdExpression && astName.getParent().getParent() instanceof IASTBinaryExpression) {
|
||||
|
@ -188,9 +188,8 @@ public final class CxxAstUtils {
|
|||
* For a function call, tries to find a matching function declaration.
|
||||
* Checks the argument count.
|
||||
*
|
||||
* @param index
|
||||
*
|
||||
* @return a generated declaration or null if not suitable
|
||||
* @param index the index
|
||||
* @return a generated declaration or {@code null} if not suitable
|
||||
*/
|
||||
private static IASTSimpleDeclaration tryInferTypeFromFunctionCall(IASTName astName, INodeFactory factory, IIndex index) {
|
||||
if (astName.getParent() instanceof IASTIdExpression && astName.getParent().getParent() instanceof IASTFunctionCallExpression
|
||||
|
@ -303,13 +302,11 @@ public final class CxxAstUtils {
|
|||
|
||||
/**
|
||||
* If the function definition belongs to a class, returns the class.
|
||||
* Otherwise, returns null.
|
||||
* Otherwise, returns {@code null}.
|
||||
*
|
||||
* @param function
|
||||
* the function definition to check
|
||||
* @param index
|
||||
* the index to use for name lookup
|
||||
* @return Either a type specifier or null
|
||||
* @param function the function definition to check
|
||||
* @param index the index to use for name lookup
|
||||
* @return either a type specifier or {@code null}
|
||||
*/
|
||||
public static IASTCompositeTypeSpecifier getCompositeTypeFromFunction(final IASTFunctionDefinition function, final IIndex index) {
|
||||
// Return value to be set via visitor.
|
||||
|
@ -371,19 +368,19 @@ public final class CxxAstUtils {
|
|||
return returnSpecifier[0];
|
||||
}
|
||||
|
||||
public static boolean isThrowStatement(IASTNode body) {
|
||||
if (!(body instanceof IASTExpressionStatement))
|
||||
public static boolean isThrowStatement(IASTNode statement) {
|
||||
if (!(statement instanceof IASTExpressionStatement))
|
||||
return false;
|
||||
IASTExpression expression = ((IASTExpressionStatement) body).getExpression();
|
||||
IASTExpression expression = ((IASTExpressionStatement) statement).getExpression();
|
||||
if (!(expression instanceof IASTUnaryExpression))
|
||||
return false;
|
||||
return ((IASTUnaryExpression) expression).getOperator() == IASTUnaryExpression.op_throw;
|
||||
}
|
||||
|
||||
public static boolean isExitStatement(IASTNode body) {
|
||||
if (!(body instanceof IASTExpressionStatement))
|
||||
public static boolean isExitStatement(IASTNode statement) {
|
||||
if (!(statement instanceof IASTExpressionStatement))
|
||||
return false;
|
||||
IASTExpression expression = ((IASTExpressionStatement) body).getExpression();
|
||||
IASTExpression expression = ((IASTExpressionStatement) statement).getExpression();
|
||||
if (!(expression instanceof IASTFunctionCallExpression))
|
||||
return false;
|
||||
IASTExpression functionNameExpression = ((IASTFunctionCallExpression) expression).getFunctionNameExpression();
|
||||
|
|
|
@ -1,55 +1,55 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2009, 2010 Alena Laskavaia
|
||||
* Copyright (c) 2009, 2010 Alena Laskavaia
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Alena Laskavaia - initial API and implementation
|
||||
* Alena Laskavaia - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.codan.core.model;
|
||||
|
||||
import org.eclipse.core.resources.IResource;
|
||||
|
||||
/**
|
||||
* Interface to describe problem location. Usually contains file and linenumber,
|
||||
* Interface to describe problem location. Usually contains file and line number,
|
||||
* also supports character positions for sophisticated errors.
|
||||
*
|
||||
*
|
||||
* @noextend This interface is not intended to be extended by clients.
|
||||
* @noimplement This interface is not intended to be implemented by clients.
|
||||
*/
|
||||
public interface IProblemLocation {
|
||||
/**
|
||||
*
|
||||
* @return File for the problem - absolute full paths
|
||||
*
|
||||
* @return the file where the problem occurred
|
||||
*/
|
||||
IResource getFile();
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @return Primary line for the problem, lines start with 1 for file. If -1
|
||||
* char position would be used.
|
||||
*/
|
||||
int getLineNumber();
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @return character position where problem starts within file, first char
|
||||
* is 0, inclusive, tab count as one. If unknown return -1.
|
||||
*/
|
||||
int getStartingChar();
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @return character position where problem ends within file, first char is
|
||||
* 0, exclusive, tab count as one. If unknown return -1.
|
||||
*/
|
||||
int getEndingChar();
|
||||
|
||||
/**
|
||||
*
|
||||
* @return extra data for problem location, checker specific, can be
|
||||
*
|
||||
* @return extra data for the problem location, checker specific, can be
|
||||
* backtrace for example
|
||||
*/
|
||||
Object getData();
|
||||
|
|
|
@ -80,6 +80,7 @@ org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
|
|||
org.eclipse.jdt.core.compiler.source=1.7
|
||||
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
|
||||
|
@ -87,18 +88,21 @@ org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_e
|
|||
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
|
||||
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
|
||||
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
|
||||
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_field=0
|
||||
|
@ -118,6 +122,7 @@ org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
|
|||
org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
|
||||
|
@ -133,11 +138,17 @@ org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
|
|||
org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
|
||||
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
|
||||
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
|
||||
org.eclipse.jdt.core.formatter.comment.line_length=110
|
||||
org.eclipse.jdt.core.formatter.comment.line_length=80
|
||||
org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
|
||||
org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
|
||||
org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
|
||||
org.eclipse.jdt.core.formatter.compact_else_if=true
|
||||
org.eclipse.jdt.core.formatter.continuation_indentation=2
|
||||
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
|
||||
org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
|
||||
org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
|
||||
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
|
||||
org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
|
||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
|
||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
|
||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
|
||||
|
@ -155,7 +166,9 @@ org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
|
|||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
|
||||
|
@ -203,6 +216,7 @@ org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=inser
|
|||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
|
||||
|
@ -221,12 +235,14 @@ org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invoca
|
|||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
|
||||
|
@ -250,6 +266,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invoc
|
|||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
|
||||
|
@ -277,6 +294,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do n
|
|||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
|
||||
|
@ -305,6 +323,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invoc
|
|||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
|
||||
|
@ -314,6 +333,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=inser
|
|||
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
|
||||
|
@ -329,7 +349,7 @@ org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
|
|||
org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
|
||||
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
|
||||
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
|
||||
org.eclipse.jdt.core.formatter.lineSplit=100
|
||||
org.eclipse.jdt.core.formatter.lineSplit=110
|
||||
org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
|
||||
org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
|
||||
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
|
||||
|
@ -337,5 +357,8 @@ org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
|
|||
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
|
||||
org.eclipse.jdt.core.formatter.tabulation.char=tab
|
||||
org.eclipse.jdt.core.formatter.tabulation.size=4
|
||||
org.eclipse.jdt.core.formatter.use_on_off_tags=false
|
||||
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
|
||||
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
|
||||
org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
|
||||
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#Wed Jan 28 12:19:26 CET 2009
|
||||
eclipse.preferences.version=1
|
||||
formatter_profile=_CDT
|
||||
formatter_settings_version=11
|
||||
formatter_settings_version=12
|
||||
internal.default.compliance=user
|
||||
|
|
|
@ -18,11 +18,11 @@ import java.util.Arrays;
|
|||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import junit.framework.AssertionFailedError;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
||||
import org.junit.Assert;
|
||||
|
||||
public class ASTComparer extends Assert {
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.core.parser.tests.ast2;
|
||||
|
||||
import junit.framework.TestSuite;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitName;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitNameOwner;
|
||||
|
@ -25,9 +25,13 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
|||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateInstance;
|
||||
import org.eclipse.cdt.core.parser.ParserLanguage;
|
||||
import org.eclipse.cdt.internal.core.parser.ParserException;
|
||||
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
/**
|
||||
* Tests for classes implementing IASTImplicitNameOwner interface.
|
||||
* Tests for classes implementing {@link IASTImplicitNameOwner} and {@link IASTImplicitDestructorNameOwner}
|
||||
* interfaces.
|
||||
*/
|
||||
public class AST2CPPImplicitNameTests extends AST2TestBase {
|
||||
|
||||
|
@ -42,7 +46,12 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
|||
return suite(AST2CPPImplicitNameTests.class);
|
||||
}
|
||||
|
||||
public IASTImplicitName[] getImplicitNames(IASTTranslationUnit tu, String contents, String section, int len) {
|
||||
protected BindingAssertionHelper getAssertionHelper() throws ParserException, IOException {
|
||||
String code= getAboveComment();
|
||||
return new BindingAssertionHelper(code, ParserLanguage.CPP);
|
||||
}
|
||||
|
||||
protected IASTImplicitName[] getImplicitNames(IASTTranslationUnit tu, String contents, String section, int len) {
|
||||
final int offset = contents.indexOf(section);
|
||||
assertTrue(offset >= 0);
|
||||
IASTNodeSelector selector = tu.getNodeSelector(null);
|
||||
|
@ -71,7 +80,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
|||
// +p;
|
||||
// }
|
||||
public void testBinaryExpressions() throws Exception {
|
||||
BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true);
|
||||
BindingAssertionHelper ba= getAssertionHelper();
|
||||
IASTTranslationUnit tu = ba.getTranslationUnit();
|
||||
NameCollector col = new NameCollector();
|
||||
tu.accept(col);
|
||||
|
@ -115,7 +124,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
|||
// *y; //2
|
||||
// }
|
||||
public void testPointerDereference() throws Exception {
|
||||
BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true);
|
||||
BindingAssertionHelper ba= getAssertionHelper();
|
||||
ba.assertImplicitName("*x;", 1, ICPPFunction.class);
|
||||
ba.assertNoImplicitName("*y; //2", 1);
|
||||
}
|
||||
|
@ -133,7 +142,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
|||
// X* px2 = &y; // overloaded
|
||||
// }
|
||||
public void testPointerToMember() throws Exception {
|
||||
BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true);
|
||||
BindingAssertionHelper ba= getAssertionHelper();
|
||||
IASTTranslationUnit tu = ba.getTranslationUnit();
|
||||
NameCollector col = new NameCollector();
|
||||
tu.accept(col);
|
||||
|
@ -194,7 +203,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
|||
// (++p1).x; //2
|
||||
// }
|
||||
public void testUnaryPrefixAndPostfix() throws Exception {
|
||||
BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true);
|
||||
BindingAssertionHelper ba= getAssertionHelper();
|
||||
ba.assertImplicitName("++).x; //1", 2, ICPPFunction.class);
|
||||
ba.assertImplicitName("++p1).x; //2", 2, ICPPMethod.class);
|
||||
}
|
||||
|
@ -220,7 +229,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
|||
// test(a, b, c, d); // func
|
||||
// }
|
||||
public void testCommaOperator1() throws Exception {
|
||||
BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true);
|
||||
BindingAssertionHelper ba= getAssertionHelper();
|
||||
// expression lists are used in function calls but they should not resolve to the comma operator
|
||||
ba.assertNoImplicitName(", b, c, d); // func", 1);
|
||||
ba.assertNoImplicitName(", c, d); // func", 1);
|
||||
|
@ -255,7 +264,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
|||
// (a, b, c, d).ee; // expr
|
||||
// }
|
||||
public void testCommaOperator2() throws Exception {
|
||||
BindingAssertionHelper ba = new BindingAssertionHelper(getAboveComment(), true);
|
||||
BindingAssertionHelper ba = getAssertionHelper();
|
||||
|
||||
IASTImplicitName opAB = ba.assertImplicitName(", b, c, d", 1, ICPPMethod.class);
|
||||
IASTImplicitName opCC = ba.assertImplicitName(", c, d", 1, ICPPFunction.class);
|
||||
|
@ -286,7 +295,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
|||
// x(1, 2); // 3
|
||||
// }
|
||||
public void testFunctionCallOperator() throws Exception {
|
||||
BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true);
|
||||
BindingAssertionHelper ba= getAssertionHelper();
|
||||
IASTTranslationUnit tu = ba.getTranslationUnit();
|
||||
NameCollector col = new NameCollector();
|
||||
tu.accept(col);
|
||||
|
@ -327,7 +336,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
|||
// b = a; // should not resolve
|
||||
// }
|
||||
public void testCopyAssignmentOperator() throws Exception {
|
||||
BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true);
|
||||
BindingAssertionHelper ba= getAssertionHelper();
|
||||
ba.assertNoImplicitName("= a;", 1);
|
||||
}
|
||||
|
||||
|
@ -345,7 +354,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
|||
// func(y[q]); //2
|
||||
// }
|
||||
public void testArraySubscript() throws Exception {
|
||||
BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true);
|
||||
BindingAssertionHelper ba= getAssertionHelper();
|
||||
IASTTranslationUnit tu = ba.getTranslationUnit();
|
||||
NameCollector col = new NameCollector();
|
||||
tu.accept(col);
|
||||
|
@ -380,7 +389,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
|||
// delete 1;
|
||||
// }
|
||||
public void testDelete() throws Exception {
|
||||
BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true);
|
||||
BindingAssertionHelper ba= getAssertionHelper();
|
||||
IASTImplicitName[] names = ba.getImplicitNames("delete x;", 6);
|
||||
assertEquals(2, names.length);
|
||||
IASTImplicitName destructor = names[0];
|
||||
|
@ -414,7 +423,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
|||
// delete b;
|
||||
// }
|
||||
public void testOverloadedDelete_Bug351547() throws Exception {
|
||||
BindingAssertionHelper bh= new BindingAssertionHelper(getAboveComment(), true);
|
||||
BindingAssertionHelper bh= getAssertionHelper();
|
||||
IBinding m= bh.assertNonProblem("operator delete(void * a)", 15);
|
||||
IBinding f= bh.assertNonProblem("operator delete(void * b)", 15);
|
||||
|
||||
|
@ -441,7 +450,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
|||
// B* b = new B;
|
||||
// }
|
||||
public void testOverloadedNew_Bug354585() throws Exception {
|
||||
BindingAssertionHelper bh= new BindingAssertionHelper(getAboveComment(), true);
|
||||
BindingAssertionHelper bh= getAssertionHelper();
|
||||
IBinding m= bh.assertNonProblem("operator new(size_t a)", 12);
|
||||
IBinding f= bh.assertNonProblem("operator new(size_t b)", 12);
|
||||
|
||||
|
@ -460,7 +469,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
|||
// delete[] x;
|
||||
// }
|
||||
public void testImplicitNewAndDelete() throws Exception {
|
||||
BindingAssertionHelper ba = new BindingAssertionHelper(getAboveComment(), true);
|
||||
BindingAssertionHelper ba = getAssertionHelper();
|
||||
ba.assertNoImplicitName("new X", 3);
|
||||
ba.assertNoImplicitName("delete[]", 6);
|
||||
}
|
||||
|
@ -479,7 +488,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
|||
// int* p2 = new (5, 6) int[5];
|
||||
// }
|
||||
public void testNew() throws Exception {
|
||||
BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true);
|
||||
BindingAssertionHelper ba= getAssertionHelper();
|
||||
IASTImplicitName n1 = ba.assertImplicitName("new (nothrow) X", 3, ICPPFunction.class);
|
||||
IASTImplicitName n2 = ba.assertImplicitName("new (nothrow) int", 3, ICPPFunction.class);
|
||||
IASTImplicitName n3 = ba.assertImplicitName("new (5, 6) int", 3, ICPPFunction.class);
|
||||
|
@ -497,7 +506,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
|||
// throw;
|
||||
// }
|
||||
public void testEmptyThrow() throws Exception {
|
||||
BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true);
|
||||
BindingAssertionHelper ba= getAssertionHelper();
|
||||
ba.assertNoImplicitName("throw;", 5);
|
||||
}
|
||||
|
||||
|
@ -526,7 +535,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
|||
// };
|
||||
// B C::t = 1;
|
||||
public void testConstructorCall() throws Exception {
|
||||
BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true);
|
||||
BindingAssertionHelper ba= getAssertionHelper();
|
||||
IASTTranslationUnit tu = ba.getTranslationUnit();
|
||||
ICPPConstructor ctor0 = ba.assertNonProblem("A()", 1, ICPPConstructor.class);
|
||||
ICPPConstructor ctor1 = ba.assertNonProblem("A(int)", 1, ICPPConstructor.class);
|
||||
|
@ -563,7 +572,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
|||
// }
|
||||
// }
|
||||
public void testBuiltinOperators_294543() throws Exception {
|
||||
BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true);
|
||||
BindingAssertionHelper ba= getAssertionHelper();
|
||||
IASTTranslationUnit tu = ba.getTranslationUnit();
|
||||
ICPPFunction op = ba.assertNonProblem("operator==", 0);
|
||||
IASTImplicitName a = ba.assertImplicitName("==b", 2, ICPPFunction.class);
|
||||
|
|
|
@ -24,8 +24,6 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import junit.framework.AssertionFailedError;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.ASTTypeUtil;
|
||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression;
|
||||
|
@ -103,6 +101,8 @@ import org.eclipse.cdt.internal.core.model.ASTStringUtil;
|
|||
import org.eclipse.cdt.internal.core.parser.ParserException;
|
||||
import org.eclipse.cdt.internal.core.parser.scanner.CPreprocessor;
|
||||
|
||||
import junit.framework.AssertionFailedError;
|
||||
|
||||
/**
|
||||
* @author aniefer
|
||||
*/
|
||||
|
@ -696,7 +696,7 @@ public class AST2TestBase extends BaseTestCase {
|
|||
return findName(contents, name);
|
||||
}
|
||||
|
||||
public IASTName findImplicitName(String section, int len) {
|
||||
public IASTImplicitName findImplicitName(String section, int len) {
|
||||
final int offset = contents.indexOf(section);
|
||||
assertTrue(offset >= 0);
|
||||
IASTNodeSelector selector = tu.getNodeSelector(null);
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#Mon Oct 17 17:36:13 PDT 2011
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
||||
|
@ -81,6 +80,7 @@ org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
|
|||
org.eclipse.jdt.core.compiler.source=1.7
|
||||
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
|
||||
|
@ -88,18 +88,21 @@ org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_e
|
|||
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
|
||||
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
|
||||
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
|
||||
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_field=0
|
||||
|
@ -119,6 +122,7 @@ org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
|
|||
org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
|
||||
|
@ -134,11 +138,17 @@ org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
|
|||
org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
|
||||
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
|
||||
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
|
||||
org.eclipse.jdt.core.formatter.comment.line_length=110
|
||||
org.eclipse.jdt.core.formatter.comment.line_length=80
|
||||
org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
|
||||
org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
|
||||
org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
|
||||
org.eclipse.jdt.core.formatter.compact_else_if=true
|
||||
org.eclipse.jdt.core.formatter.continuation_indentation=2
|
||||
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
|
||||
org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
|
||||
org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
|
||||
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
|
||||
org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
|
||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
|
||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
|
||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
|
||||
|
@ -156,7 +166,9 @@ org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
|
|||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
|
||||
|
@ -204,6 +216,7 @@ org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=inser
|
|||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
|
||||
|
@ -222,12 +235,14 @@ org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invoca
|
|||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
|
||||
|
@ -251,6 +266,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invoc
|
|||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
|
||||
|
@ -278,6 +294,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do n
|
|||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
|
||||
|
@ -306,6 +323,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invoc
|
|||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
|
||||
|
@ -315,6 +333,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=inser
|
|||
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
|
||||
|
@ -330,7 +349,7 @@ org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
|
|||
org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
|
||||
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
|
||||
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
|
||||
org.eclipse.jdt.core.formatter.lineSplit=100
|
||||
org.eclipse.jdt.core.formatter.lineSplit=110
|
||||
org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
|
||||
org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
|
||||
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
|
||||
|
@ -338,5 +357,8 @@ org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
|
|||
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
|
||||
org.eclipse.jdt.core.formatter.tabulation.char=tab
|
||||
org.eclipse.jdt.core.formatter.tabulation.size=4
|
||||
org.eclipse.jdt.core.formatter.use_on_off_tags=false
|
||||
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
|
||||
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
|
||||
org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
|
||||
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#Wed Jan 28 12:19:26 CET 2009
|
||||
eclipse.preferences.version=1
|
||||
formatter_profile=_CDT
|
||||
formatter_settings_version=11
|
||||
formatter_settings_version=12
|
||||
internal.default.compliance=user
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Markus Schorn - initial API and implementation
|
||||
* Markus Schorn - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.core.dom.ast;
|
||||
|
||||
|
@ -22,12 +22,11 @@ import org.eclipse.core.runtime.Assert;
|
|||
* @since 5.1
|
||||
*/
|
||||
public final class ASTNameCollector extends ASTVisitor {
|
||||
|
||||
private char[] fName;
|
||||
private ArrayList<IASTName> fFound= new ArrayList<IASTName>(4);
|
||||
private final char[] fName;
|
||||
private final ArrayList<IASTName> fFound= new ArrayList<>(4);
|
||||
|
||||
/**
|
||||
* Construct a name collector for the given name.
|
||||
* Constructs a name collector for the given name.
|
||||
*/
|
||||
public ASTNameCollector(char[] name) {
|
||||
Assert.isNotNull(name);
|
||||
|
@ -36,7 +35,7 @@ public final class ASTNameCollector extends ASTVisitor {
|
|||
}
|
||||
|
||||
/**
|
||||
* Construct a name collector for the given name.
|
||||
* Constructs a name collector for the given name.
|
||||
*/
|
||||
public ASTNameCollector(String name) {
|
||||
this(name.toCharArray());
|
||||
|
@ -53,14 +52,14 @@ public final class ASTNameCollector extends ASTVisitor {
|
|||
}
|
||||
|
||||
/**
|
||||
* Return the array of matching names.
|
||||
* Returns the array of matching names.
|
||||
*/
|
||||
public IASTName[] getNames() {
|
||||
return fFound.toArray(new IASTName[fFound.size()]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear the names found, such that the collector can be reused.
|
||||
* Clears the names found, such that the collector can be reused.
|
||||
*/
|
||||
public void clear() {
|
||||
fFound.clear();
|
||||
|
|
|
@ -172,6 +172,8 @@ public abstract class ASTVisitor {
|
|||
* Implicit names are created to allow implicit bindings to be resolved,
|
||||
* normally they are not visited, set this flag to true to visit them.
|
||||
* @since 5.1
|
||||
* @see #visit(IASTName)
|
||||
* @see IASTImplicitName
|
||||
*/
|
||||
public boolean shouldVisitImplicitNames = false;
|
||||
|
||||
|
@ -179,6 +181,8 @@ public abstract class ASTVisitor {
|
|||
* Sometimes more than one implicit name is created for a binding,
|
||||
* set this flag to true to visit more than one name for an implicit binding.
|
||||
* @since 5.1
|
||||
* @see #visit(IASTName)
|
||||
* @see IASTImplicitName
|
||||
*/
|
||||
public boolean shouldVisitImplicitNameAlternates = false;
|
||||
|
||||
|
|
|
@ -18,33 +18,30 @@ package org.eclipse.cdt.core.dom.ast;
|
|||
*/
|
||||
public interface IASTCompoundStatement extends IASTStatement {
|
||||
/**
|
||||
* <code>NESTED_STATEMENT</code> represents the relationship between an
|
||||
* <code>IASTCompoundStatement</code> and its nested
|
||||
* <code>IASTStatement</code>
|
||||
* {@code NESTED_STATEMENT} represents the relationship between an {@code IASTCompoundStatement}
|
||||
* and its nested {@code IASTStatement}
|
||||
*/
|
||||
public static final ASTNodeProperty NESTED_STATEMENT = new ASTNodeProperty(
|
||||
"IASTCompoundStatement.NESTED_STATEMENT - nested IASTStatement for IASTCompoundStatement"); //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Gets the statements in this block.
|
||||
* Returns the statements in this block.
|
||||
*
|
||||
* @return Array of IASTStatement
|
||||
*/
|
||||
public IASTStatement[] getStatements();
|
||||
|
||||
/**
|
||||
* Add a statement to the compound block.
|
||||
* Adds a statement to the compound block.
|
||||
*
|
||||
* @param statement
|
||||
* statement to be added
|
||||
* @param statement the statement to be added
|
||||
*/
|
||||
public void addStatement(IASTStatement statement);
|
||||
|
||||
/**
|
||||
* Get <code>IScope</code> node that this node eludes to in the logical
|
||||
* tree.
|
||||
* Returns {@code IScope} node that this node eludes to in the logical tree.
|
||||
*
|
||||
* @return the <code>IScope</code>
|
||||
* @return the {@code IScope}
|
||||
*/
|
||||
public IScope getScope();
|
||||
|
||||
|
|
|
@ -18,33 +18,32 @@ package org.eclipse.cdt.core.dom.ast;
|
|||
*/
|
||||
public interface IASTDoStatement extends IASTStatement {
|
||||
/**
|
||||
* <code>BODY</code> represents the relationship between a
|
||||
* <code>IASTDoStatement</code> and its nested body
|
||||
* <code>IASTStatement</code>.
|
||||
* {@code BODY} represents the relationship between a
|
||||
* {@code IASTDoStatement} and its nested body
|
||||
* {@code IASTStatement}.
|
||||
*/
|
||||
public static final ASTNodeProperty BODY =
|
||||
new ASTNodeProperty("IASTDoStatement.BODY - nested body for IASTDoStatement"); //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* <code>CONDITION</code> represents the relationship between a
|
||||
* <code>IASTDoStatement</code> and its condition
|
||||
* <code>IASTExpression</code>.
|
||||
* {@code CONDITION} represents the relationship between a
|
||||
* {@code IASTDoStatement} and its condition
|
||||
* {@code IASTExpression}.
|
||||
*/
|
||||
public static final ASTNodeProperty CONDITION = new ASTNodeProperty(
|
||||
"IASTDoStatement.CONDITION - IASTExpression condition for IASTDoStatement"); //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Get the body of the loop.
|
||||
* Returns the body of the loop.
|
||||
*
|
||||
* @return <code>IASTStatement</code> loop code body
|
||||
* @return {@code IASTStatement} loop code body
|
||||
*/
|
||||
public IASTStatement getBody();
|
||||
|
||||
/**
|
||||
* Set the body of the loop.
|
||||
* Sets the body of the loop.
|
||||
*
|
||||
* @param body
|
||||
* an <code>IASTStatement</code>
|
||||
* @param body an {@code IASTStatement}
|
||||
*/
|
||||
public void setBody(IASTStatement body);
|
||||
|
||||
|
@ -56,10 +55,9 @@ public interface IASTDoStatement extends IASTStatement {
|
|||
public IASTExpression getCondition();
|
||||
|
||||
/**
|
||||
* Set the condition for the loop.
|
||||
* Sets the condition for the loop.
|
||||
*
|
||||
* @param condition
|
||||
* an IASTExpression
|
||||
* @param condition an {@code IASTExpression}
|
||||
*/
|
||||
public void setCondition(IASTExpression condition);
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
package org.eclipse.cdt.core.dom.ast;
|
||||
|
||||
/**
|
||||
* Expression List (Comma separated list of expressions).
|
||||
* Expression list (comma separated list of expressions).
|
||||
*
|
||||
* @noextend This interface is not intended to be extended by clients.
|
||||
* @noimplement This interface is not intended to be implemented by clients.
|
||||
|
@ -26,17 +26,16 @@ public interface IASTExpressionList extends IASTExpression {
|
|||
"IASTExpressionList.NESTED_EXPRESSION - Nested IASTExpression for IASTExpressionList"); //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Get nested expressions.
|
||||
* Returns nested expressions.
|
||||
*
|
||||
* @return <code>IASTExpression[] </code> nested expressions
|
||||
* @return an array of nested expressions
|
||||
*/
|
||||
public IASTExpression[] getExpressions();
|
||||
|
||||
/**
|
||||
* Add nested expression.
|
||||
* Adds nested expression.
|
||||
*
|
||||
* @param expression
|
||||
* <code>IASTExpression</code> value to be added.
|
||||
* @param expression the expression to be added.
|
||||
*/
|
||||
public void addExpression(IASTExpression expression);
|
||||
|
||||
|
|
|
@ -19,96 +19,89 @@ package org.eclipse.cdt.core.dom.ast;
|
|||
*/
|
||||
public interface IASTForStatement extends IASTStatement {
|
||||
/**
|
||||
* <code>CONDITION</code> represents the relationship between a
|
||||
* <code>IASTForStatement</code> and its <code>IASTExpression</code>
|
||||
* condition.
|
||||
* {@code CONDITION} represents the relationship between a {@code IASTForStatement} and
|
||||
* its {@code IASTExpression} condition.
|
||||
*/
|
||||
public static final ASTNodeProperty CONDITION = new ASTNodeProperty(
|
||||
"IASTForStatement.CONDITION - IASTExpression condition of IASTForStatement"); //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* <code>ITERATION</code> represents the relationship between a
|
||||
* <code>IASTForStatement</code> and its <code>IASTExpression</code>
|
||||
* iteration expression.
|
||||
* {@code ITERATION} represents the relationship between a {@code IASTForStatement} and
|
||||
* its {@code IASTExpression} iteration expression.
|
||||
*/
|
||||
public static final ASTNodeProperty ITERATION = new ASTNodeProperty(
|
||||
"IASTForStatement.ITERATION - IASTExpression iteration of IASTForStatement"); //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* <code>BODY</code> represents the relationship between a
|
||||
* <code>IASTForStatement</code> and its <code>IASTStatement</code>
|
||||
* body.
|
||||
* {@code BODY} represents the relationship between a {@code IASTForStatement} and
|
||||
* its {@code IASTStatement} body.
|
||||
*/
|
||||
public static final ASTNodeProperty BODY = new ASTNodeProperty(
|
||||
"IASTForStatement.BODY - IASTStatement body of IASTForStatement"); //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* <code>INITIALIZER</code> represents the relationship between a
|
||||
* <code>IASTForStatement</code> and its <code>IASTDeclaration</code>
|
||||
* initializer.
|
||||
* {@code INITIALIZER} represents the relationship between a {@code IASTForStatement} and
|
||||
* its {@code IASTDeclaration} initializer.
|
||||
*/
|
||||
public static final ASTNodeProperty INITIALIZER = new ASTNodeProperty(
|
||||
"IASTForStatement.INITIALIZER - initializer for IASTForStatement"); //$NON-NLS-1$
|
||||
|
||||
|
||||
/**
|
||||
* Returns the initializer statement.
|
||||
*/
|
||||
public IASTStatement getInitializerStatement();
|
||||
|
||||
/**
|
||||
* @param statement
|
||||
*/
|
||||
public void setInitializerStatement( IASTStatement statement );
|
||||
public void setInitializerStatement(IASTStatement statement);
|
||||
|
||||
/**
|
||||
* Get the condition expression for the loop.
|
||||
* Returns the condition expression for the loop.
|
||||
*
|
||||
* @return <code>IASTExpression</code>
|
||||
* @return {@code IASTExpression}
|
||||
*/
|
||||
public IASTExpression getConditionExpression();
|
||||
|
||||
/**
|
||||
* Set the condition expression for the loop.
|
||||
* Sets the condition expression for the loop.
|
||||
*
|
||||
* @param condition
|
||||
* <code>IASTExpression</code>
|
||||
* @param condition {@code IASTExpression}
|
||||
*/
|
||||
public void setConditionExpression(IASTExpression condition);
|
||||
|
||||
/**
|
||||
* Get the expression that is evaluated after the completion of an iteration
|
||||
* of the loop.
|
||||
* Returns the expression that is evaluated after the completion of an iteration of the loop.
|
||||
*
|
||||
* @return <code>IASTExpression</code>
|
||||
* @return {@code IASTExpression}
|
||||
*/
|
||||
public IASTExpression getIterationExpression();
|
||||
|
||||
/**
|
||||
* Set the expression that is evaluated after the completion of an iteration
|
||||
* of the loop.
|
||||
* Sets the expression that is evaluated after the completion of an iteration of the loop.
|
||||
*
|
||||
* @param iterator
|
||||
* <code>IASTExpression</code>
|
||||
* @param iterator {@code IASTExpression}
|
||||
*/
|
||||
public void setIterationExpression(IASTExpression iterator);
|
||||
|
||||
/**
|
||||
* Get the statements that this for loop controls.
|
||||
* Returns the statements that this for loop controls.
|
||||
*
|
||||
* @return <code>IASTStatement</code>
|
||||
* @return {@code IASTStatement}
|
||||
*/
|
||||
public IASTStatement getBody();
|
||||
|
||||
/**
|
||||
* Set the body of the for loop.
|
||||
* Sets the body of the for loop.
|
||||
*
|
||||
* @param statement
|
||||
* <code>IASTStatement</code>
|
||||
* @param statement {@code IASTStatement}
|
||||
*/
|
||||
public void setBody(IASTStatement statement);
|
||||
|
||||
/**
|
||||
* Get the <code>IScope</code> represented by this for loop.
|
||||
* Returns the {@code IScope} represented by this for loop.
|
||||
*
|
||||
* @return <code>IScope</code>
|
||||
* @return {@code IScope}
|
||||
*/
|
||||
public IScope getScope();
|
||||
|
||||
|
|
|
@ -18,24 +18,24 @@ package org.eclipse.cdt.core.dom.ast;
|
|||
*/
|
||||
public interface IASTFunctionDefinition extends IASTDeclaration {
|
||||
/**
|
||||
* <code>DECL_SPECIFIER</code> represents the relationship between a
|
||||
* <code>IASTFunctionDefinition</code> and its
|
||||
* <code>IASTDeclSpecifier</code>.
|
||||
* {@code DECL_SPECIFIER} represents the relationship between a
|
||||
* {@code IASTFunctionDefinition} and its
|
||||
* {@code IASTDeclSpecifier}.
|
||||
*/
|
||||
public static final ASTNodeProperty DECL_SPECIFIER = new ASTNodeProperty(
|
||||
"IASTFunctionDefinition.DECL_SPECIFIER - IASTDeclSpecifier for IASTFunctionDefinition"); //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* <code>DECLARATOR</code> represents the relationship between a
|
||||
* <code>IASTFunctionDefinition</code> and its
|
||||
* <code>IASTFunctionDeclarator</code>.
|
||||
* {@code DECLARATOR} represents the relationship between a
|
||||
* {@code IASTFunctionDefinition} and its
|
||||
* {@code IASTFunctionDeclarator}.
|
||||
*/
|
||||
public static final ASTNodeProperty DECLARATOR = new ASTNodeProperty(
|
||||
"IASTFunctionDefinition.DECLARATOR - IASTFunctionDeclarator for IASTFunctionDefinition"); //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* <code>FUNCTION_BODY</code> represents the relationship between a
|
||||
* <code>IASTFunctionDefinition</code> and its <code>IASTStatement</code>.
|
||||
* {@code FUNCTION_BODY} represents the relationship between a
|
||||
* {@code IASTFunctionDefinition} and its {@code IASTStatement}.
|
||||
*/
|
||||
public static final ASTNodeProperty FUNCTION_BODY = new ASTNodeProperty(
|
||||
"IASTFunctionDefinition.FUNCTION_BODY - Function Body for IASTFunctionDefinition"); //$NON-NLS-1$
|
||||
|
@ -73,6 +73,7 @@ public interface IASTFunctionDefinition extends IASTDeclaration {
|
|||
* void (f)(int a); // has nested declarator
|
||||
* void (f(int a)); // is nested in another declarator
|
||||
* </pre>
|
||||
*
|
||||
* @param declarator
|
||||
*/
|
||||
public void setDeclarator(IASTFunctionDeclarator declarator);
|
||||
|
@ -80,7 +81,6 @@ public interface IASTFunctionDefinition extends IASTDeclaration {
|
|||
/**
|
||||
* Returns the body of the function. This is usually a compound statement but
|
||||
* C++ also has a function try block.
|
||||
*
|
||||
*/
|
||||
public IASTStatement getBody();
|
||||
|
||||
|
@ -94,7 +94,7 @@ public interface IASTFunctionDefinition extends IASTDeclaration {
|
|||
/**
|
||||
* Get the logical IScope that the function definition body represents.
|
||||
*
|
||||
* @return <code>IScope</code> representing function body.
|
||||
* @return {@code IScope} representing function body.
|
||||
*/
|
||||
public IScope getScope();
|
||||
|
||||
|
|
|
@ -18,22 +18,22 @@ package org.eclipse.cdt.core.dom.ast;
|
|||
*/
|
||||
public interface IASTIfStatement extends IASTStatement {
|
||||
/**
|
||||
* <code>CONDITION</code> represents the relationship between an
|
||||
* <code>IASTIfStatement</code> and its nested <code>IASTExpression</code>.
|
||||
* {@code CONDITION} represents the relationship between an
|
||||
* {@code IASTIfStatement} and its nested {@code IASTExpression}.
|
||||
*/
|
||||
public static final ASTNodeProperty CONDITION = new ASTNodeProperty(
|
||||
"IASTIfStatement.CONDITION - IASTExpression condition for IASTIfStatement"); //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* <code>THEN</code> represents the relationship between an
|
||||
* <code>IASTIfStatement</code> and its nested <code>IASTStatement</code>
|
||||
* {@code THEN} represents the relationship between an
|
||||
* {@code IASTIfStatement} and its nested {@code IASTStatement}
|
||||
* (then).
|
||||
*/
|
||||
public static final ASTNodeProperty THEN = new ASTNodeProperty("IASTIfStatement.THEN - IASTStatement (then) for IASTIfStatement"); //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* <code>ELSE</code> represents the relationship between an
|
||||
* <code>IASTIfStatement</code> and its nested <code>IASTStatement</code>
|
||||
* {@code ELSE} represents the relationship between an
|
||||
* {@code IASTIfStatement} and its nested {@code IASTStatement}
|
||||
* (else).
|
||||
*/
|
||||
public static final ASTNodeProperty ELSE = new ASTNodeProperty("IASTIfStatement.ELSE - IASTStatement (else) for IASTIfStatement"); //$NON-NLS-1$
|
||||
|
@ -41,7 +41,7 @@ public interface IASTIfStatement extends IASTStatement {
|
|||
/**
|
||||
* Returns the condition in the if statement.
|
||||
*
|
||||
* @return the condition <code>IASTExpression</code>. May return <code>null</code> if the 'if'
|
||||
* @return the condition {@code IASTExpression}. May return {@code null} if the 'if'
|
||||
* statement has condition declaration instead of condition expression
|
||||
* (see {@link org.eclipse.cdt.core.dom.ast.cpp.ICPPASTIfStatement}).
|
||||
*/
|
||||
|
@ -50,23 +50,21 @@ public interface IASTIfStatement extends IASTStatement {
|
|||
/**
|
||||
* Sets the condition in the if statement.
|
||||
*
|
||||
* @param condition
|
||||
* <code>IASTExpression</code>
|
||||
* @param condition {@code IASTExpression}
|
||||
*/
|
||||
public void setConditionExpression(IASTExpression condition);
|
||||
|
||||
/**
|
||||
* Returns the statement that is executed if the condition is true.
|
||||
*
|
||||
* @return the then clause <code>IASTStatement</code>
|
||||
* @return the then clause {@code IASTStatement}
|
||||
*/
|
||||
public IASTStatement getThenClause();
|
||||
|
||||
/**
|
||||
* Sets the statement that is executed if the condition is true.
|
||||
*
|
||||
* @param thenClause
|
||||
* <code>IASTStatement</code>
|
||||
* @param thenClause {@code IASTStatement}
|
||||
*/
|
||||
public void setThenClause(IASTStatement thenClause);
|
||||
|
||||
|
@ -74,15 +72,14 @@ public interface IASTIfStatement extends IASTStatement {
|
|||
* Returns the statement that is executed if the condition is false. This clause
|
||||
* is optional and returns null if there is none.
|
||||
*
|
||||
* @return the else clause or null <code>IASTStatement</code>
|
||||
* @return the else clause or {@code null} {@code IASTStatement}
|
||||
*/
|
||||
public IASTStatement getElseClause();
|
||||
|
||||
/**
|
||||
* Sets the else clause.
|
||||
*
|
||||
* @param elseClause
|
||||
* <code>IASTStatement</code>
|
||||
* @param elseClause {@code IASTStatement}
|
||||
*/
|
||||
public void setElseClause(IASTStatement elseClause);
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
package org.eclipse.cdt.core.dom.ast;
|
||||
|
||||
/**
|
||||
* Interface for ast nodes that can nest in initializer lists.
|
||||
* Interface for AST nodes that can nest in initializer lists.
|
||||
* @since 5.2
|
||||
* @noextend This interface is not intended to be extended by clients.
|
||||
* @noimplement This interface is not intended to be implemented by clients.
|
||||
|
|
|
@ -22,25 +22,25 @@ public interface IASTReturnStatement extends IASTStatement {
|
|||
/**
|
||||
* This is the optional return value for this function.
|
||||
*
|
||||
* @return the return expression or null.
|
||||
* @return the return expression or {@code null}.
|
||||
*/
|
||||
public IASTExpression getReturnValue();
|
||||
|
||||
/**
|
||||
* Returns the return value as {@link IASTInitializerClause}, or <code>null</code>.
|
||||
* In c++ this can be an braced initializer list.
|
||||
* Returns the return value as {@link IASTInitializerClause}, or {@code null}.
|
||||
* In C++ this can be an braced initializer list.
|
||||
* @since 5.2
|
||||
*/
|
||||
public IASTInitializerClause getReturnArgument();
|
||||
|
||||
/**
|
||||
* Not allowed on frozen ast.
|
||||
* Not allowed on frozen AST.
|
||||
* @since 5.2
|
||||
*/
|
||||
public void setReturnArgument(IASTInitializerClause returnValue);
|
||||
|
||||
/**
|
||||
* Not allowed on frozen ast.
|
||||
* Not allowed on frozen AST.
|
||||
*/
|
||||
public void setReturnValue(IASTExpression returnValue);
|
||||
|
||||
|
|
|
@ -24,7 +24,8 @@ public interface IASTTypeIdInitializerExpression extends IASTExpression {
|
|||
* <code>IASTTypeIdInitializerExpression</code> and
|
||||
* <code>IASTTypeId</code>.
|
||||
*/
|
||||
public static final ASTNodeProperty TYPE_ID = new ASTNodeProperty("IASTTypeIdInitializerExpression.TYPE_ID - IASTTypeId for IASTTypeIdInitializerExpression"); //$NON-NLS-1$
|
||||
public static final ASTNodeProperty TYPE_ID =
|
||||
new ASTNodeProperty("IASTTypeIdInitializerExpression.TYPE_ID - IASTTypeId for IASTTypeIdInitializerExpression"); //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* <code>INITIALIZER</code> represents the relationship between an
|
||||
|
|
|
@ -18,27 +18,27 @@ package org.eclipse.cdt.core.dom.ast;
|
|||
*/
|
||||
public interface IASTWhileStatement extends IASTStatement {
|
||||
/**
|
||||
* <code>CONDITIONEXPRESSION</code> represents the relationship between an <code>IASTWhileStatement</code> and
|
||||
* it's nested <code>IASTExpression</code>.
|
||||
* {@code CONDITIONEXPRESSION} represents the relationship between an {@code IASTWhileStatement} and
|
||||
* it's nested {@code IASTExpression}.
|
||||
*/
|
||||
public static final ASTNodeProperty CONDITIONEXPRESSION = new ASTNodeProperty(
|
||||
"IASTWhileStatement.CONDITIONEXPRESSION - IASTExpression (condition) for IASTWhileStatement"); //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* <code>BODY</code> represents the relationship between an <code>IASTWhileStatement</code> and
|
||||
* it's nested <code>IASTStatement</code>.
|
||||
* {@code BODY} represents the relationship between an {@code IASTWhileStatement} and
|
||||
* it's nested {@code IASTStatement}.
|
||||
*/
|
||||
public static final ASTNodeProperty BODY = new ASTNodeProperty("IASTWhileStatement.BODY - IASTStatement (body) for IASTWhileStatement"); //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Get the condition on the while loop
|
||||
* Returns the condition on the while loop
|
||||
*
|
||||
* @return expression for the condition
|
||||
*/
|
||||
public IASTExpression getCondition();
|
||||
|
||||
/**
|
||||
* Set the condition of the while loop.
|
||||
* Sets the condition of the while loop.
|
||||
*
|
||||
* @param condition
|
||||
*/
|
||||
|
@ -52,7 +52,7 @@ public interface IASTWhileStatement extends IASTStatement {
|
|||
public IASTStatement getBody();
|
||||
|
||||
/**
|
||||
* Set the body of the while loop.
|
||||
* Sets the body of the while loop.
|
||||
*
|
||||
* @param body
|
||||
*/
|
||||
|
|
|
@ -37,10 +37,10 @@ public interface IScope {
|
|||
public IName getScopeName();
|
||||
|
||||
/**
|
||||
* Returns the first enclosing non-template scope, or <code>null</code> if this
|
||||
* Returns the first enclosing non-template scope, or {@code null} if this
|
||||
* is the global scope.
|
||||
* <p>
|
||||
* For scopes obtained from an index, <code>null</code> is returned to indicate that the
|
||||
* For scopes obtained from an index, {@code null} is returned to indicate that the
|
||||
* scope is only enclosed by the global scope.
|
||||
*/
|
||||
public IScope getParent() throws DOMException;
|
||||
|
@ -51,7 +51,7 @@ public interface IScope {
|
|||
* lookup. Constructors are not considered during this lookup and won't be returned.
|
||||
* No attempt is made to resolve potential ambiguities or perform access checking.
|
||||
*
|
||||
* @param name
|
||||
* @param name the name of the bindings
|
||||
* @return An array of bindings.
|
||||
*/
|
||||
public IBinding[] find(String name);
|
||||
|
@ -62,11 +62,9 @@ public interface IScope {
|
|||
* yet been cached in this scope, or if resolve == false and the appropriate binding
|
||||
* has not yet been resolved.
|
||||
*
|
||||
* @param name
|
||||
* @param resolve
|
||||
* whether or not to resolve the matching binding if it has not
|
||||
* been so already.
|
||||
* @return the binding in this scope that matches the name, or null
|
||||
* @param name the name of the binding
|
||||
* @param resolve whether or not to resolve the matching binding if it has not been so already.
|
||||
* @return the binding in this scope that matches the name, or {@code null}
|
||||
*/
|
||||
public IBinding getBinding(IASTName name, boolean resolve);
|
||||
|
||||
|
@ -77,10 +75,8 @@ public interface IScope {
|
|||
* has not yet been resolved. Accepts file local bindings from the index for the files
|
||||
* in the given set, only.
|
||||
*
|
||||
* @param name
|
||||
* @param resolve
|
||||
* whether or not to resolve the matching binding if it has not
|
||||
* been so already.
|
||||
* @param name the name of the binding
|
||||
* @param resolve whether or not to resolve the matching binding if it has not been so already.
|
||||
* @param acceptLocalBindings a set of files for which to accept local bindings.
|
||||
* @return the binding in this scope that matches the name, or null
|
||||
*/
|
||||
|
@ -140,51 +136,63 @@ public interface IScope {
|
|||
public final void setPrefixLookup(boolean prefixLookup) {
|
||||
fPrefixLookup = prefixLookup;
|
||||
}
|
||||
|
||||
public final void setResolve(boolean resolve) {
|
||||
fResolve = resolve;
|
||||
}
|
||||
|
||||
public final void setIgnorePointOfDeclaration(boolean ignorePointOfDeclaration) {
|
||||
fIgnorePointOfDeclaration = ignorePointOfDeclaration;
|
||||
}
|
||||
|
||||
public final void setLookupKey(char[] key) {
|
||||
fLookupKey= key;
|
||||
}
|
||||
|
||||
public final char[] getLookupKey() {
|
||||
return fLookupKey;
|
||||
}
|
||||
|
||||
public final IASTNode getLookupPoint() {
|
||||
return fLookupPoint;
|
||||
}
|
||||
|
||||
public final boolean isResolve() {
|
||||
return fResolve;
|
||||
}
|
||||
|
||||
public final boolean isPrefixLookup() {
|
||||
return fPrefixLookup;
|
||||
}
|
||||
|
||||
public final boolean isIgnorePointOfDeclaration() {
|
||||
return fIgnorePointOfDeclaration;
|
||||
}
|
||||
|
||||
public final IIndexFileSet getIncludedFiles() {
|
||||
return fTu == null ? IIndexFileSet.EMPTY : fTu.getIndexFileSet();
|
||||
}
|
||||
|
||||
public final IIndex getIndex() {
|
||||
return fTu == null ? null : fTu.getIndex();
|
||||
}
|
||||
|
||||
public final IASTName getLookupName() {
|
||||
return fLookupPointIsName ? (IASTName) fLookupPoint : null;
|
||||
}
|
||||
|
||||
public IASTTranslationUnit getTranslationUnit() {
|
||||
return fTu;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the bindings in this scope that the given name or prefix could resolve to. Could
|
||||
* Returns the bindings in this scope that the given name or prefix could resolve to. Could
|
||||
* return null if there is no matching bindings in this scope, if the bindings have not
|
||||
* yet been cached in this scope, or if resolve == false and the appropriate bindings
|
||||
* have not yet been resolved.
|
||||
*
|
||||
* @return : the bindings in this scope that match the name or prefix, or null
|
||||
* @return the bindings in this scope that match the name or prefix, or {@code null}
|
||||
* @since 5.5
|
||||
*/
|
||||
public IBinding[] getBindings(ScopeLookupData lookup);
|
||||
|
|
|
@ -49,27 +49,27 @@ public interface ICPPASTCatchHandler extends IASTStatement {
|
|||
public boolean isCatchAll();
|
||||
|
||||
/**
|
||||
* Set the catch body.
|
||||
* Sets the catch body.
|
||||
*/
|
||||
public void setCatchBody(IASTStatement compoundStatement);
|
||||
|
||||
/**
|
||||
* Get the catch body.
|
||||
* Returns the catch body.
|
||||
*/
|
||||
public IASTStatement getCatchBody();
|
||||
|
||||
/**
|
||||
* Set the declaration.
|
||||
* Sets the declaration.
|
||||
*/
|
||||
public void setDeclaration(IASTDeclaration decl);
|
||||
|
||||
/**
|
||||
* Get the declaration.
|
||||
* Returns the declaration.
|
||||
*/
|
||||
public IASTDeclaration getDeclaration();
|
||||
|
||||
/**
|
||||
* Get the scope represented by this catch handler.
|
||||
* Returns the scope represented by this catch handler.
|
||||
* @since 5.1
|
||||
*/
|
||||
public IScope getScope();
|
||||
|
|
|
@ -13,10 +13,11 @@ package org.eclipse.cdt.core.dom.ast.cpp;
|
|||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||
|
||||
/**
|
||||
* Interface for c++ expressions.
|
||||
* Interface for C++ expressions.
|
||||
*
|
||||
* @since 5.10
|
||||
* @noextend This interface is not intended to be extended by clients.
|
||||
* @noimplement This interface is not intended to be implemented by clients.
|
||||
* @since 5.5
|
||||
*/
|
||||
public interface ICPPASTExpression extends IASTExpression, ICPPASTInitializerClause {
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Mike Kucera (IBM) - Initial API and implementation
|
||||
* Mike Kucera (IBM) - Initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.core.dom.ast.cpp;
|
||||
|
||||
|
@ -20,7 +20,6 @@ import org.eclipse.cdt.core.dom.ast.IASTImplicitNameOwner;
|
|||
* @noimplement This interface is not intended to be implemented by clients.
|
||||
*/
|
||||
public interface ICPPASTExpressionList extends IASTExpressionList, ICPPASTExpression, IASTImplicitNameOwner {
|
||||
|
||||
@Override
|
||||
public ICPPASTExpressionList copy();
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ public interface ICPPASTFieldReference extends IASTFieldReference, ICPPASTExpres
|
|||
public boolean isTemplate();
|
||||
|
||||
/**
|
||||
* Set the template keyword used.
|
||||
* Sets the template keyword used.
|
||||
*
|
||||
* @param value
|
||||
*/
|
||||
|
|
|
@ -32,7 +32,7 @@ public interface ICPPASTFunctionCallExpression
|
|||
|
||||
/**
|
||||
* Returns the function binding for the overloaded operator() invoked by
|
||||
* the function call, or <code>null</code> if the operator() is not overloaded.
|
||||
* the function call, or {@code null} if the operator() is not overloaded.
|
||||
* @since 5.8
|
||||
*/
|
||||
public ICPPFunction getOverload();
|
||||
|
|
|
@ -22,11 +22,11 @@ import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
|||
* @since 5.2
|
||||
*/
|
||||
public interface ICPPASTPackExpansionExpression extends ICPPASTExpression {
|
||||
|
||||
/**
|
||||
* Represents the relationship between a pack-expansion and its pattern.
|
||||
*/
|
||||
public static final ASTNodeProperty PATTERN = new ASTNodeProperty("ICPPASTPackExpansionExpression.Pattern [IASTExpression]"); //$NON-NLS-1$
|
||||
public static final ASTNodeProperty PATTERN =
|
||||
new ASTNodeProperty("ICPPASTPackExpansionExpression.Pattern [IASTExpression]"); //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Returns the pattern of the pack expansion.
|
||||
|
|
|
@ -14,7 +14,7 @@ import org.eclipse.cdt.core.dom.ast.ASTNodeProperty;
|
|||
import org.eclipse.cdt.core.dom.ast.IASTStatement;
|
||||
|
||||
/**
|
||||
* This interface represents the try block statement. try { //body } catch (Exc e )
|
||||
* This interface represents the try block statement. try { //body } catch (Exc e)
|
||||
* { // handler } catch ( ... ) { }
|
||||
*
|
||||
* @noextend This interface is not intended to be extended by clients.
|
||||
|
@ -22,43 +22,41 @@ import org.eclipse.cdt.core.dom.ast.IASTStatement;
|
|||
*/
|
||||
public interface ICPPASTTryBlockStatement extends IASTStatement {
|
||||
/**
|
||||
* <code>BODY</code> is the body of the try block.
|
||||
* {@code BODY} is the body of the try block.
|
||||
*/
|
||||
public static final ASTNodeProperty BODY = new ASTNodeProperty("ICPPASTTryBlockStatement.BODY - Body of try block"); //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Set try body.
|
||||
* Sets the try body.
|
||||
*
|
||||
* @param tryBlock
|
||||
* <code>IASTStatement</code>
|
||||
* @param tryBlock {@code IASTStatement}
|
||||
*/
|
||||
public void setTryBody(IASTStatement tryBlock);
|
||||
|
||||
/**
|
||||
* Get try body.
|
||||
* Returns the try body.
|
||||
*
|
||||
* @return <code>IASTStatement</code>
|
||||
* @return {@code IASTStatement}
|
||||
*/
|
||||
public IASTStatement getTryBody();
|
||||
|
||||
/**
|
||||
* <code>CATCH_HANDLER</code> are the exception catching handlers.
|
||||
* {@code CATCH_HANDLER} are the exception catching handlers.
|
||||
*/
|
||||
public static final ASTNodeProperty CATCH_HANDLER = new ASTNodeProperty(
|
||||
"ICPPASTTryBlockStatement.CATCH_HANDLER - Exception catching handlers"); //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Add catch handler.
|
||||
* Adds catch handler.
|
||||
*
|
||||
* @param handler
|
||||
* <code>ICPPASTCatchHandler</code>
|
||||
* @param handler {@code ICPPASTCatchHandler}
|
||||
*/
|
||||
public void addCatchHandler(ICPPASTCatchHandler handler);
|
||||
|
||||
/**
|
||||
* Get the catch handlers.
|
||||
* Returns the catch handlers.
|
||||
*
|
||||
* @return <code>ICPPASTCatchHandler []</code>
|
||||
* @return {@code ICPPASTCatchHandler[]}
|
||||
*/
|
||||
public ICPPASTCatchHandler[] getCatchHandlers();
|
||||
|
||||
|
|
|
@ -402,4 +402,19 @@ public abstract class ASTNode implements IASTNode {
|
|||
public void resolvePendingAmbiguities() {
|
||||
((ASTTranslationUnit) getTranslationUnit()).resolvePendingAmbiguities(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method for use in {{@link #accept(ASTVisitor)} methods.
|
||||
*
|
||||
* @param action the visitor to accept
|
||||
* @param nodes the array of nodes accepting the visitor
|
||||
* @return continue on ({@code true}) or quit ({@code false})
|
||||
*/
|
||||
protected static <T extends IASTNode> boolean acceptByNodes(T[] nodes, ASTVisitor action) {
|
||||
for (T node : nodes) {
|
||||
if (!node.accept(action))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,103 +0,0 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2005, 2011 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* John Camelon (IBM Rational Software) - Initial API and implementation
|
||||
* Yuan Zhang / Beth Tibbitts (IBM Research)
|
||||
* Markus Schorn (Wind River Systems)
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.core.dom.parser;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTInitializer;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTTypeIdInitializerExpression;
|
||||
|
||||
/**
|
||||
* Compound literals for c and c++.
|
||||
*/
|
||||
public abstract class ASTTypeIdInitializerExpression extends ASTNode implements IASTTypeIdInitializerExpression {
|
||||
private IASTTypeId typeId;
|
||||
private IASTInitializer initializer;
|
||||
|
||||
public ASTTypeIdInitializerExpression() {
|
||||
}
|
||||
|
||||
public ASTTypeIdInitializerExpression(IASTTypeId t, IASTInitializer i) {
|
||||
setTypeId(t);
|
||||
setInitializer(i);
|
||||
}
|
||||
|
||||
protected void initializeCopy(ASTTypeIdInitializerExpression copy, CopyStyle style) {
|
||||
copy.setTypeId(typeId == null ? null : typeId.copy(style));
|
||||
copy.setInitializer(initializer == null ? null : initializer.copy(style));
|
||||
copy(copy, style);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IASTTypeId getTypeId() {
|
||||
return typeId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeId(IASTTypeId typeId) {
|
||||
assertNotFrozen();
|
||||
this.typeId = typeId;
|
||||
if (typeId != null) {
|
||||
typeId.setParent(this);
|
||||
typeId.setPropertyInParent(TYPE_ID);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IASTInitializer getInitializer() {
|
||||
return initializer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInitializer(IASTInitializer initializer) {
|
||||
assertNotFrozen();
|
||||
this.initializer = initializer;
|
||||
if (initializer != null) {
|
||||
initializer.setParent(this);
|
||||
initializer.setPropertyInParent(INITIALIZER);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean accept(ASTVisitor action) {
|
||||
if (action.shouldVisitExpressions) {
|
||||
switch(action.visit(this)) {
|
||||
case ASTVisitor.PROCESS_ABORT: return false;
|
||||
case ASTVisitor.PROCESS_SKIP: return true;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
if (typeId != null && !typeId.accept(action)) return false;
|
||||
if (initializer != null && !initializer.accept(action)) return false;
|
||||
|
||||
if (action.shouldVisitExpressions) {
|
||||
switch(action.leave(this)) {
|
||||
case ASTVisitor.PROCESS_ABORT: return false;
|
||||
case ASTVisitor.PROCESS_SKIP: return true;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean isLValue() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ValueCategory getValueCategory() {
|
||||
return ValueCategory.PRVALUE;
|
||||
}
|
||||
}
|
|
@ -6,30 +6,100 @@
|
|||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* John Camelon (IBM Rational Software) - Initial API and implementation
|
||||
* Yuan Zhang / Beth Tibbitts (IBM Research)
|
||||
* Markus Schorn (Wind River Systems)
|
||||
* John Camelon (IBM Rational Software) - Initial API and implementation
|
||||
* Yuan Zhang / Beth Tibbitts (IBM Research)
|
||||
* Markus Schorn (Wind River Systems)
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.core.dom.parser.c;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTInitializer;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
|
||||
import org.eclipse.cdt.core.dom.ast.IType;
|
||||
import org.eclipse.cdt.core.dom.ast.c.ICASTTypeIdInitializerExpression;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.ASTTypeIdInitializerExpression;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
||||
|
||||
/**
|
||||
* C-specific implementation adds nothing but the c-specific interface.
|
||||
* Type id initializer expression for C, type-id { initializer }
|
||||
*/
|
||||
public class CASTTypeIdInitializerExpression extends ASTTypeIdInitializerExpression implements
|
||||
ICASTTypeIdInitializerExpression {
|
||||
public class CASTTypeIdInitializerExpression extends ASTNode implements ICASTTypeIdInitializerExpression {
|
||||
private IASTTypeId fTypeId;
|
||||
private IASTInitializer fInitializer;
|
||||
|
||||
private CASTTypeIdInitializerExpression() {
|
||||
super();
|
||||
public CASTTypeIdInitializerExpression() {
|
||||
}
|
||||
|
||||
public CASTTypeIdInitializerExpression(IASTTypeId typeId, IASTInitializer initializer) {
|
||||
super(typeId, initializer);
|
||||
public CASTTypeIdInitializerExpression(IASTTypeId t, IASTInitializer i) {
|
||||
setTypeId(t);
|
||||
fInitializer = i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IASTTypeId getTypeId() {
|
||||
return fTypeId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeId(IASTTypeId typeId) {
|
||||
assertNotFrozen();
|
||||
this.fTypeId = typeId;
|
||||
if (typeId != null) {
|
||||
typeId.setParent(this);
|
||||
typeId.setPropertyInParent(TYPE_ID);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IASTInitializer getInitializer() {
|
||||
return fInitializer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInitializer(IASTInitializer initializer) {
|
||||
assertNotFrozen();
|
||||
this.fInitializer = initializer;
|
||||
if (initializer != null) {
|
||||
initializer.setParent(this);
|
||||
initializer.setPropertyInParent(INITIALIZER);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean accept(ASTVisitor action) {
|
||||
if (action.shouldVisitExpressions) {
|
||||
switch (action.visit(this)) {
|
||||
case ASTVisitor.PROCESS_ABORT: return false;
|
||||
case ASTVisitor.PROCESS_SKIP: return true;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
if (fTypeId != null && !fTypeId.accept(action)) return false;
|
||||
if (fInitializer != null && !fInitializer.accept(action)) return false;
|
||||
|
||||
if (action.shouldVisitExpressions) {
|
||||
switch (action.leave(this)) {
|
||||
case ASTVisitor.PROCESS_ABORT: return false;
|
||||
case ASTVisitor.PROCESS_SKIP: return true;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean isLValue() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ValueCategory getValueCategory() {
|
||||
return ValueCategory.PRVALUE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IType getExpressionType() {
|
||||
return CVisitor.createType(getTypeId().getAbstractDeclarator());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -39,13 +109,9 @@ public class CASTTypeIdInitializerExpression extends ASTTypeIdInitializerExpress
|
|||
|
||||
@Override
|
||||
public CASTTypeIdInitializerExpression copy(CopyStyle style) {
|
||||
CASTTypeIdInitializerExpression copy = new CASTTypeIdInitializerExpression();
|
||||
initializeCopy(copy, style);
|
||||
return copy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IType getExpressionType() {
|
||||
return CVisitor.createType(getTypeId().getAbstractDeclarator());
|
||||
CASTTypeIdInitializerExpression copy = new CASTTypeIdInitializerExpression(
|
||||
fTypeId == null ? null : fTypeId.copy(style),
|
||||
fInitializer == null ? null : fInitializer.copy(style));
|
||||
return copy(copy, style);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguousExpression;
|
|||
public class CPPASTAmbiguousExpression extends ASTAmbiguousNode
|
||||
implements IASTAmbiguousExpression, ICPPASTExpression {
|
||||
private IASTExpression[] exp = new IASTExpression[2];
|
||||
private int expPos= -1;
|
||||
private int expPos;
|
||||
|
||||
public CPPASTAmbiguousExpression(IASTExpression... expressions) {
|
||||
for (IASTExpression e : expressions) {
|
||||
|
@ -43,7 +43,7 @@ public class CPPASTAmbiguousExpression extends ASTAmbiguousNode
|
|||
public void addExpression(IASTExpression e) {
|
||||
assertNotFrozen();
|
||||
if (e != null) {
|
||||
exp = ArrayUtil.appendAt(IASTExpression.class, exp, ++expPos, e);
|
||||
exp = ArrayUtil.appendAt(exp, expPos++, e);
|
||||
e.setParent(this);
|
||||
e.setPropertyInParent(SUBEXPRESSION);
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ public class CPPASTAmbiguousExpression extends ASTAmbiguousNode
|
|||
|
||||
@Override
|
||||
public IASTExpression[] getExpressions() {
|
||||
exp = ArrayUtil.trimAt(IASTExpression.class, exp, expPos);
|
||||
exp = ArrayUtil.trim(exp, expPos);
|
||||
return exp;
|
||||
}
|
||||
|
||||
|
|
|
@ -121,9 +121,6 @@ public class CPPASTBinaryExpression extends ASTNode implements ICPPASTBinaryExpr
|
|||
setInitOperand2(expression);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.core.dom.ast.IASTImplicitNameOwner#getImplicitNames()
|
||||
*/
|
||||
@Override
|
||||
public IASTImplicitName[] getImplicitNames() {
|
||||
if (implicitNames == null) {
|
||||
|
@ -159,12 +156,8 @@ public class CPPASTBinaryExpression extends ASTNode implements ICPPASTBinaryExpr
|
|||
if (operand1 != null && !operand1.accept(action))
|
||||
return false;
|
||||
|
||||
if (action.shouldVisitImplicitNames) {
|
||||
for (IASTImplicitName name : getImplicitNames()) {
|
||||
if (!name.accept(action))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (action.shouldVisitImplicitNames && !acceptByNodes(getImplicitNames(), action))
|
||||
return false;
|
||||
|
||||
if (operand2 != null && !operand2.accept(action))
|
||||
return false;
|
||||
|
@ -185,7 +178,7 @@ public class CPPASTBinaryExpression extends ASTNode implements ICPPASTBinaryExpr
|
|||
}
|
||||
}
|
||||
|
||||
public static boolean acceptWithoutRecursion(IASTBinaryExpression bexpr, ASTVisitor action) {
|
||||
private static boolean acceptWithoutRecursion(IASTBinaryExpression bexpr, ASTVisitor action) {
|
||||
N stack= new N(bexpr);
|
||||
while (stack != null) {
|
||||
IASTBinaryExpression expr= stack.fExpression;
|
||||
|
@ -211,12 +204,10 @@ public class CPPASTBinaryExpression extends ASTNode implements ICPPASTBinaryExpr
|
|||
return false;
|
||||
}
|
||||
if (stack.fState == 1) {
|
||||
if (action.shouldVisitImplicitNames) {
|
||||
for (IASTImplicitName name : ((IASTImplicitNameOwner) expr).getImplicitNames()) {
|
||||
if (!name.accept(action))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (action.shouldVisitImplicitNames &&
|
||||
!acceptByNodes(((IASTImplicitNameOwner) expr).getImplicitNames(), action)) {
|
||||
return false;
|
||||
}
|
||||
stack.fState= 2;
|
||||
|
||||
IASTExpression op2 = expr.getOperand2();
|
||||
|
|
|
@ -31,16 +31,16 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalTypeId;
|
|||
* Cast expression for C++
|
||||
*/
|
||||
public class CPPASTCastExpression extends ASTNode implements ICPPASTCastExpression, IASTAmbiguityParent {
|
||||
private int op;
|
||||
private ICPPASTExpression operand;
|
||||
private IASTTypeId typeId;
|
||||
private int fOperator;
|
||||
private ICPPASTExpression fOperand;
|
||||
private IASTTypeId fTypeId;
|
||||
private ICPPEvaluation fEvaluation;
|
||||
|
||||
public CPPASTCastExpression() {
|
||||
}
|
||||
|
||||
public CPPASTCastExpression(int operator, IASTTypeId typeId, IASTExpression operand) {
|
||||
op = operator;
|
||||
fOperator = operator;
|
||||
setOperand(operand);
|
||||
setTypeId(typeId);
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ public class CPPASTCastExpression extends ASTNode implements ICPPASTCastExpressi
|
|||
public CPPASTCastExpression copy(CopyStyle style) {
|
||||
CPPASTCastExpression copy = new CPPASTCastExpression();
|
||||
copy.setOperator(getOperator());
|
||||
copy.setTypeId(typeId == null ? null : typeId.copy(style));
|
||||
copy.setTypeId(fTypeId == null ? null : fTypeId.copy(style));
|
||||
IASTExpression operand = getOperand();
|
||||
copy.setOperand(operand == null ? null : operand.copy(style));
|
||||
return copy(copy, style);
|
||||
|
@ -63,7 +63,7 @@ public class CPPASTCastExpression extends ASTNode implements ICPPASTCastExpressi
|
|||
@Override
|
||||
public void setTypeId(IASTTypeId typeId) {
|
||||
assertNotFrozen();
|
||||
this.typeId = typeId;
|
||||
this.fTypeId = typeId;
|
||||
if (typeId != null) {
|
||||
typeId.setParent(this);
|
||||
typeId.setPropertyInParent(TYPE_ID);
|
||||
|
@ -72,35 +72,35 @@ public class CPPASTCastExpression extends ASTNode implements ICPPASTCastExpressi
|
|||
|
||||
@Override
|
||||
public IASTTypeId getTypeId() {
|
||||
return typeId;
|
||||
return fTypeId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOperator() {
|
||||
return op;
|
||||
return fOperator;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOperator(int operator) {
|
||||
assertNotFrozen();
|
||||
op = operator;
|
||||
fOperator = operator;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IASTExpression getOperand() {
|
||||
return operand;
|
||||
return fOperand;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOperand(IASTExpression expression) {
|
||||
assertNotFrozen();
|
||||
operand = (ICPPASTExpression) expression;
|
||||
fOperand = (ICPPASTExpression) expression;
|
||||
if (expression != null) {
|
||||
expression.setParent(this);
|
||||
expression.setPropertyInParent(OPERAND);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean accept(ASTVisitor action) {
|
||||
if (action.shouldVisitExpressions) {
|
||||
|
@ -111,7 +111,7 @@ public class CPPASTCastExpression extends ASTNode implements ICPPASTCastExpressi
|
|||
}
|
||||
}
|
||||
|
||||
if (typeId != null && !typeId.accept(action)) return false;
|
||||
if (fTypeId != null && !fTypeId.accept(action)) return false;
|
||||
IASTExpression op = getOperand();
|
||||
if (op != null && !op.accept(action)) return false;
|
||||
|
||||
|
@ -127,10 +127,10 @@ public class CPPASTCastExpression extends ASTNode implements ICPPASTCastExpressi
|
|||
|
||||
@Override
|
||||
public void replace(IASTNode child, IASTNode other) {
|
||||
if (child == operand) {
|
||||
if (child == fOperand) {
|
||||
other.setPropertyInParent(child.getPropertyInParent());
|
||||
other.setParent(child.getParent());
|
||||
operand = (ICPPASTExpression) other;
|
||||
fOperand = (ICPPASTExpression) other;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -144,14 +144,14 @@ public class CPPASTCastExpression extends ASTNode implements ICPPASTCastExpressi
|
|||
}
|
||||
|
||||
private ICPPEvaluation computeEvaluation() {
|
||||
if (operand == null)
|
||||
if (fOperand == null)
|
||||
return EvalFixed.INCOMPLETE;
|
||||
|
||||
IType type= CPPVisitor.createType(getTypeId());
|
||||
if (type == null || type instanceof IProblemType)
|
||||
return EvalFixed.INCOMPLETE;
|
||||
|
||||
return new EvalTypeId(type, this, operand.getEvaluation());
|
||||
return new EvalTypeId(type, this, fOperand.getEvaluation());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -28,12 +28,12 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalFixed;
|
|||
* Gnu-extension: ({ ... })
|
||||
*/
|
||||
public class CPPASTCompoundStatementExpression extends ASTNode implements IGNUASTCompoundStatementExpression, ICPPASTExpression {
|
||||
|
||||
private IASTCompoundStatement statement;
|
||||
private IASTCompoundStatement fStatement;
|
||||
private ICPPEvaluation fEval;
|
||||
|
||||
public CPPASTCompoundStatementExpression() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ICPPEvaluation getEvaluation() {
|
||||
if (fEval == null) {
|
||||
|
@ -63,19 +63,19 @@ public class CPPASTCompoundStatementExpression extends ASTNode implements IGNUAS
|
|||
@Override
|
||||
public CPPASTCompoundStatementExpression copy(CopyStyle style) {
|
||||
CPPASTCompoundStatementExpression copy = new CPPASTCompoundStatementExpression();
|
||||
copy.setCompoundStatement(statement == null ? null : statement.copy(style));
|
||||
copy.setCompoundStatement(fStatement == null ? null : fStatement.copy(style));
|
||||
return copy(copy, style);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IASTCompoundStatement getCompoundStatement() {
|
||||
return statement;
|
||||
return fStatement;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCompoundStatement(IASTCompoundStatement statement) {
|
||||
assertNotFrozen();
|
||||
this.statement = statement;
|
||||
this.fStatement = statement;
|
||||
if (statement != null) {
|
||||
statement.setParent(this);
|
||||
statement.setPropertyInParent(STATEMENT);
|
||||
|
@ -83,22 +83,22 @@ public class CPPASTCompoundStatementExpression extends ASTNode implements IGNUAS
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean accept( ASTVisitor action ){
|
||||
if( action.shouldVisitExpressions ){
|
||||
switch( action.visit( this ) ){
|
||||
case ASTVisitor.PROCESS_ABORT : return false;
|
||||
case ASTVisitor.PROCESS_SKIP : return true;
|
||||
default : break;
|
||||
public boolean accept(ASTVisitor action) {
|
||||
if (action.shouldVisitExpressions) {
|
||||
switch (action.visit(this)) {
|
||||
case ASTVisitor.PROCESS_ABORT: return false;
|
||||
case ASTVisitor.PROCESS_SKIP: return true;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
if( statement != null ) if( !statement.accept( action ) ) return false;
|
||||
|
||||
if( action.shouldVisitExpressions ){
|
||||
switch( action.leave( this ) ){
|
||||
case ASTVisitor.PROCESS_ABORT : return false;
|
||||
case ASTVisitor.PROCESS_SKIP : return true;
|
||||
default : break;
|
||||
if (fStatement != null && !fStatement.accept(action)) return false;
|
||||
|
||||
if (action.shouldVisitExpressions) {
|
||||
switch (action.leave(this)) {
|
||||
case ASTVisitor.PROCESS_ABORT: return false;
|
||||
case ASTVisitor.PROCESS_SKIP: return true;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -25,8 +25,8 @@ import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
|
|||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalConditional;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalFixed;
|
||||
|
||||
public class CPPASTConditionalExpression extends ASTNode implements IASTConditionalExpression,
|
||||
ICPPASTExpression, IASTAmbiguityParent {
|
||||
public class CPPASTConditionalExpression extends ASTNode
|
||||
implements IASTConditionalExpression, ICPPASTExpression, IASTAmbiguityParent {
|
||||
private ICPPASTExpression fCondition;
|
||||
private ICPPASTExpression fPositive;
|
||||
private ICPPASTExpression fNegative;
|
||||
|
@ -116,7 +116,7 @@ public class CPPASTConditionalExpression extends ASTNode implements IASTConditio
|
|||
return false;
|
||||
if (fNegative != null && !fNegative.accept(action))
|
||||
return false;
|
||||
|
||||
|
||||
if (action.shouldVisitExpressions && action.leave(this) == ASTVisitor.PROCESS_ABORT)
|
||||
return false;
|
||||
|
||||
|
|
|
@ -102,12 +102,12 @@ public class CPPASTDeleteExpression extends ASTNode implements ICPPASTDeleteExpr
|
|||
}
|
||||
|
||||
/**
|
||||
* Try to resolve both the destructor and operator delete.
|
||||
* Tries to resolve both the destructor and operator delete.
|
||||
*/
|
||||
@Override
|
||||
public IASTImplicitName[] getImplicitNames() {
|
||||
if (implicitNames == null) {
|
||||
List<IASTImplicitName> names = new ArrayList<IASTImplicitName>();
|
||||
List<IASTImplicitName> names = new ArrayList<>();
|
||||
|
||||
if (!isVectored) {
|
||||
ICPPFunction destructor = CPPSemantics.findImplicitlyCalledDestructor(this);
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* John Camelon (IBM) - Initial API and implementation
|
||||
* Markus Schorn (Wind River Systems)
|
||||
* John Camelon (IBM) - Initial API and implementation
|
||||
* Markus Schorn (Wind River Systems)
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||
|
||||
|
@ -33,8 +33,7 @@ public class CPPASTEqualsInitializer extends ASTEqualsInitializer {
|
|||
@Override
|
||||
public CPPASTEqualsInitializer copy(CopyStyle style) {
|
||||
IASTInitializerClause arg = getInitializerClause();
|
||||
CPPASTEqualsInitializer copy = new CPPASTEqualsInitializer(arg == null ? null
|
||||
: arg.copy(style));
|
||||
CPPASTEqualsInitializer copy = new CPPASTEqualsInitializer(arg == null ? null : arg.copy(style));
|
||||
return copy(copy, style);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,14 +29,13 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalComma;
|
|||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalFixed;
|
||||
|
||||
public class CPPASTExpressionList extends ASTNode implements ICPPASTExpressionList, IASTAmbiguityParent {
|
||||
|
||||
private IASTExpression[] expressions = new IASTExpression[2];
|
||||
|
||||
/**
|
||||
* Caution: may contain nulls.
|
||||
* @see CPPASTExpressionList#computeImplicitNames
|
||||
* @see #computeImplicitNames
|
||||
*/
|
||||
private IASTImplicitName[] implicitNames;
|
||||
private IASTImplicitName[] fImplicitNames;
|
||||
|
||||
private ICPPEvaluation fEvaluation;
|
||||
|
||||
|
@ -48,8 +47,9 @@ public class CPPASTExpressionList extends ASTNode implements ICPPASTExpressionLi
|
|||
@Override
|
||||
public CPPASTExpressionList copy(CopyStyle style) {
|
||||
CPPASTExpressionList copy = new CPPASTExpressionList();
|
||||
for(IASTExpression expr : getExpressions())
|
||||
for (IASTExpression expr : getExpressions()) {
|
||||
copy.addExpression(expr == null ? null : expr.copy(style));
|
||||
}
|
||||
return copy(copy, style);
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,7 @@ public class CPPASTExpressionList extends ASTNode implements ICPPASTExpressionLi
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (action.shouldVisitExpressions) {
|
||||
switch (action.leave(this)) {
|
||||
case ASTVisitor.PROCESS_ABORT: return false;
|
||||
|
@ -104,32 +104,31 @@ public class CPPASTExpressionList extends ASTNode implements ICPPASTExpressionLi
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns an array of implicit names where each element of the array
|
||||
* represents a comma between the expression in the same index and the
|
||||
* next expression. This array contains null elements as placeholders
|
||||
* for commas that do not resolve to overloaded operators.
|
||||
* Returns an array of implicit names where each element of the array represents a comma between
|
||||
* the expression in the same index and the next expression. This array contains null elements
|
||||
* as placeholders for commas that do not resolve to overloaded operators.
|
||||
*/
|
||||
private IASTImplicitName[] computeImplicitNames() {
|
||||
if (implicitNames == null) {
|
||||
if (fImplicitNames == null) {
|
||||
IASTExpression[] exprs = getExpressions(); // has to be at least two
|
||||
if (exprs.length < 2)
|
||||
return implicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
|
||||
return fImplicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
|
||||
|
||||
implicitNames = new IASTImplicitName[exprs.length - 1];
|
||||
fImplicitNames = new IASTImplicitName[exprs.length - 1];
|
||||
|
||||
ICPPFunction[] overloads = getOverloads();
|
||||
for(int i = 0; i < overloads.length; i++) {
|
||||
for (int i = 0; i < overloads.length; i++) {
|
||||
ICPPFunction overload = overloads[i];
|
||||
if (overload != null && !(overload instanceof CPPImplicitFunction)) {
|
||||
CPPASTImplicitName operatorName = new CPPASTImplicitName(OverloadableOperator.COMMA, this);
|
||||
operatorName.setBinding(overload);
|
||||
operatorName.computeOperatorOffsets(exprs[i], true);
|
||||
implicitNames[i] = operatorName;
|
||||
fImplicitNames[i] = operatorName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return implicitNames;
|
||||
return fImplicitNames;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -49,11 +49,11 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalMemberAccess;
|
|||
|
||||
public class CPPASTFieldReference extends ASTNode
|
||||
implements ICPPASTFieldReference, IASTAmbiguityParent, ICPPASTCompletionContext {
|
||||
private boolean isTemplate;
|
||||
private ICPPASTExpression owner;
|
||||
private IASTName name;
|
||||
private boolean isDeref;
|
||||
private IASTImplicitName[] implicitNames;
|
||||
private boolean fIsTemplate;
|
||||
private boolean fIsDeref;
|
||||
private ICPPASTExpression fOwner;
|
||||
private IASTName fName;
|
||||
private IASTImplicitName[] fImplicitNames;
|
||||
private ICPPEvaluation fEvaluation;
|
||||
|
||||
public CPPASTFieldReference() {
|
||||
|
@ -72,33 +72,33 @@ public class CPPASTFieldReference extends ASTNode
|
|||
@Override
|
||||
public CPPASTFieldReference copy(CopyStyle style) {
|
||||
CPPASTFieldReference copy = new CPPASTFieldReference();
|
||||
copy.setFieldName(name == null ? null : name.copy(style));
|
||||
copy.setFieldOwner(owner == null ? null : owner.copy(style));
|
||||
copy.isTemplate = isTemplate;
|
||||
copy.isDeref = isDeref;
|
||||
copy.setFieldName(fName == null ? null : fName.copy(style));
|
||||
copy.setFieldOwner(fOwner == null ? null : fOwner.copy(style));
|
||||
copy.fIsTemplate = fIsTemplate;
|
||||
copy.fIsDeref = fIsDeref;
|
||||
return copy(copy, style);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTemplate() {
|
||||
return isTemplate;
|
||||
return fIsTemplate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIsTemplate(boolean value) {
|
||||
assertNotFrozen();
|
||||
isTemplate = value;
|
||||
fIsTemplate = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ICPPASTExpression getFieldOwner() {
|
||||
return owner;
|
||||
return fOwner;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFieldOwner(IASTExpression expression) {
|
||||
assertNotFrozen();
|
||||
owner = (ICPPASTExpression) expression;
|
||||
fOwner = (ICPPASTExpression) expression;
|
||||
if (expression != null) {
|
||||
expression.setParent(this);
|
||||
expression.setPropertyInParent(FIELD_OWNER);
|
||||
|
@ -107,13 +107,13 @@ public class CPPASTFieldReference extends ASTNode
|
|||
|
||||
@Override
|
||||
public IASTName getFieldName() {
|
||||
return name;
|
||||
return fName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFieldName(IASTName name) {
|
||||
assertNotFrozen();
|
||||
this.name = name;
|
||||
this.fName = name;
|
||||
if (name != null) {
|
||||
name.setParent(this);
|
||||
name.setPropertyInParent(FIELD_NAME);
|
||||
|
@ -122,42 +122,42 @@ public class CPPASTFieldReference extends ASTNode
|
|||
|
||||
@Override
|
||||
public boolean isPointerDereference() {
|
||||
return isDeref;
|
||||
return fIsDeref;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIsPointerDereference(boolean value) {
|
||||
assertNotFrozen();
|
||||
isDeref = value;
|
||||
fIsDeref = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IASTImplicitName[] getImplicitNames() {
|
||||
if (implicitNames == null) {
|
||||
if (!isDeref)
|
||||
return implicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
|
||||
if (fImplicitNames == null) {
|
||||
if (!fIsDeref)
|
||||
return fImplicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
|
||||
|
||||
// Collect the function bindings
|
||||
List<ICPPFunction> functionBindings = new ArrayList<ICPPFunction>();
|
||||
EvalMemberAccess.getFieldOwnerType(owner.getExpressionType(), isDeref, this, functionBindings, false);
|
||||
EvalMemberAccess.getFieldOwnerType(fOwner.getExpressionType(), fIsDeref, this, functionBindings, false);
|
||||
if (functionBindings.isEmpty())
|
||||
return implicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
|
||||
return fImplicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
|
||||
|
||||
// Create a name to wrap each binding
|
||||
implicitNames = new IASTImplicitName[functionBindings.size()];
|
||||
fImplicitNames = new IASTImplicitName[functionBindings.size()];
|
||||
int i= -1;
|
||||
for (ICPPFunction op : functionBindings) {
|
||||
if (op != null && !(op instanceof CPPImplicitFunction)) {
|
||||
CPPASTImplicitName operatorName = new CPPASTImplicitName(OverloadableOperator.ARROW, this);
|
||||
operatorName.setBinding(op);
|
||||
operatorName.computeOperatorOffsets(owner, true);
|
||||
implicitNames[++i] = operatorName;
|
||||
operatorName.computeOperatorOffsets(fOwner, true);
|
||||
fImplicitNames[++i] = operatorName;
|
||||
}
|
||||
}
|
||||
implicitNames= ArrayUtil.trimAt(IASTImplicitName.class, implicitNames, i);
|
||||
fImplicitNames= ArrayUtil.trimAt(IASTImplicitName.class, fImplicitNames, i);
|
||||
}
|
||||
|
||||
return implicitNames;
|
||||
return fImplicitNames;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -170,7 +170,7 @@ public class CPPASTFieldReference extends ASTNode
|
|||
}
|
||||
}
|
||||
|
||||
if (owner != null && !owner.accept(action))
|
||||
if (fOwner != null && !fOwner.accept(action))
|
||||
return false;
|
||||
|
||||
if (action.shouldVisitImplicitNames) {
|
||||
|
@ -180,9 +180,9 @@ public class CPPASTFieldReference extends ASTNode
|
|||
}
|
||||
}
|
||||
|
||||
if (name != null && !name.accept(action))
|
||||
if (fName != null && !fName.accept(action))
|
||||
return false;
|
||||
|
||||
|
||||
if (action.shouldVisitExpressions) {
|
||||
switch (action.leave(this)) {
|
||||
case ASTVisitor.PROCESS_ABORT: return false;
|
||||
|
@ -195,17 +195,17 @@ public class CPPASTFieldReference extends ASTNode
|
|||
|
||||
@Override
|
||||
public int getRoleForName(IASTName n) {
|
||||
if (n == name)
|
||||
if (n == fName)
|
||||
return r_reference;
|
||||
return r_unclear;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void replace(IASTNode child, IASTNode other) {
|
||||
if (child == owner) {
|
||||
if (child == fOwner) {
|
||||
other.setPropertyInParent(child.getPropertyInParent());
|
||||
other.setParent(child.getParent());
|
||||
owner = (ICPPASTExpression) other;
|
||||
fOwner = (ICPPASTExpression) other;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -238,7 +238,7 @@ public class CPPASTFieldReference extends ASTNode
|
|||
*/
|
||||
@Override
|
||||
public IType getFieldOwnerType() {
|
||||
return EvalMemberAccess.getFieldOwnerType(owner.getExpressionType(), isDeref, this, null, true);
|
||||
return EvalMemberAccess.getFieldOwnerType(fOwner.getExpressionType(), fIsDeref, this, null, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -250,24 +250,24 @@ public class CPPASTFieldReference extends ASTNode
|
|||
}
|
||||
|
||||
private ICPPEvaluation createEvaluation() {
|
||||
ICPPEvaluation ownerEval = owner.getEvaluation();
|
||||
ICPPEvaluation ownerEval = fOwner.getEvaluation();
|
||||
if (!ownerEval.isTypeDependent()) {
|
||||
IType ownerType= EvalMemberAccess.getFieldOwnerType(ownerEval.getTypeOrFunctionSet(this), isDeref, this, null, false);
|
||||
IType ownerType= EvalMemberAccess.getFieldOwnerType(ownerEval.getTypeOrFunctionSet(this), fIsDeref, this, null, false);
|
||||
if (ownerType != null) {
|
||||
IBinding binding = name.resolvePreBinding();
|
||||
IBinding binding = fName.resolvePreBinding();
|
||||
if (binding instanceof CPPFunctionSet)
|
||||
binding= name.resolveBinding();
|
||||
binding= fName.resolveBinding();
|
||||
|
||||
if (binding instanceof IProblemBinding || binding instanceof IType || binding instanceof ICPPConstructor)
|
||||
return EvalFixed.INCOMPLETE;
|
||||
|
||||
return new EvalMemberAccess(ownerType, ownerEval.getValueCategory(this), binding, isDeref, this);
|
||||
return new EvalMemberAccess(ownerType, ownerEval.getValueCategory(this), binding, fIsDeref, this);
|
||||
}
|
||||
}
|
||||
|
||||
IBinding qualifier= null;
|
||||
ICPPTemplateArgument[] args= null;
|
||||
IASTName n= name;
|
||||
IASTName n= fName;
|
||||
if (n instanceof ICPPASTQualifiedName) {
|
||||
ICPPASTQualifiedName qn= (ICPPASTQualifiedName) n;
|
||||
ICPPASTNameSpecifier[] ns= qn.getQualifier();
|
||||
|
@ -285,7 +285,7 @@ public class CPPASTFieldReference extends ASTNode
|
|||
return EvalFixed.INCOMPLETE;
|
||||
}
|
||||
}
|
||||
return new EvalID(ownerEval, qualifier, name.getSimpleID(), false, true, args, this);
|
||||
return new EvalID(ownerEval, qualifier, fName.getSimpleID(), false, true, args, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -34,6 +34,7 @@ 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.ICPPASTInitializerClause;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPConstructor;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
||||
import org.eclipse.cdt.core.parser.IToken;
|
||||
|
@ -47,11 +48,11 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.LookupData;
|
|||
|
||||
public class CPPASTFunctionCallExpression extends ASTNode
|
||||
implements ICPPASTFunctionCallExpression, IASTAmbiguityParent {
|
||||
private ICPPASTExpression functionName;
|
||||
private ICPPASTExpression fFunctionName;
|
||||
private IASTInitializerClause[] fArguments;
|
||||
|
||||
private IASTImplicitName[] implicitNames;
|
||||
private ICPPEvaluation evaluation;
|
||||
private IASTImplicitName[] fImplicitNames;
|
||||
private ICPPEvaluation fEvaluation;
|
||||
|
||||
public CPPASTFunctionCallExpression() {
|
||||
setArguments(null);
|
||||
|
@ -78,19 +79,19 @@ public class CPPASTFunctionCallExpression extends ASTNode
|
|||
}
|
||||
|
||||
CPPASTFunctionCallExpression copy = new CPPASTFunctionCallExpression(null, args);
|
||||
copy.setFunctionNameExpression(functionName == null ? null : functionName.copy(style));
|
||||
copy.setFunctionNameExpression(fFunctionName == null ? null : fFunctionName.copy(style));
|
||||
return copy(copy, style);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IASTExpression getFunctionNameExpression() {
|
||||
return functionName;
|
||||
return fFunctionName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFunctionNameExpression(IASTExpression expression) {
|
||||
assertNotFrozen();
|
||||
this.functionName = (ICPPASTExpression) expression;
|
||||
this.fFunctionName = (ICPPASTExpression) expression;
|
||||
if (expression != null) {
|
||||
expression.setParent(this);
|
||||
expression.setPropertyInParent(FUNCTION_NAME);
|
||||
|
@ -118,21 +119,21 @@ public class CPPASTFunctionCallExpression extends ASTNode
|
|||
|
||||
@Override
|
||||
public IASTImplicitName[] getImplicitNames() {
|
||||
if (implicitNames == null) {
|
||||
if (fImplicitNames == null) {
|
||||
ICPPFunction overload = getOverload();
|
||||
if (overload == null)
|
||||
return implicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
|
||||
return fImplicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
|
||||
|
||||
if (getEvaluation() instanceof EvalTypeId) {
|
||||
CPPASTImplicitName n1 = new CPPASTImplicitName(overload.getNameCharArray(), this);
|
||||
n1.setOffsetAndLength((ASTNode) functionName);
|
||||
n1.setOffsetAndLength((ASTNode) fFunctionName);
|
||||
n1.setBinding(overload);
|
||||
return implicitNames= new IASTImplicitName[] {n1};
|
||||
return fImplicitNames= new IASTImplicitName[] {n1};
|
||||
}
|
||||
|
||||
if (overload instanceof CPPImplicitFunction) {
|
||||
if (!(overload instanceof ICPPMethod) || ((ICPPMethod) overload).isImplicit()) {
|
||||
return implicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
|
||||
return fImplicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -145,9 +146,9 @@ public class CPPASTFunctionCallExpression extends ASTNode
|
|||
n2.setAlternate(true);
|
||||
|
||||
if (fArguments.length == 0) {
|
||||
int idEndOffset = ((ASTNode) functionName).getOffset() + ((ASTNode) functionName).getLength();
|
||||
int idEndOffset = ((ASTNode) fFunctionName).getOffset() + ((ASTNode) fFunctionName).getLength();
|
||||
try {
|
||||
IToken lparen = functionName.getTrailingSyntax();
|
||||
IToken lparen = fFunctionName.getTrailingSyntax();
|
||||
IToken rparen = lparen.getNext();
|
||||
|
||||
if (lparen.getType() == IToken.tLPAREN) {
|
||||
|
@ -166,13 +167,13 @@ public class CPPASTFunctionCallExpression extends ASTNode
|
|||
n2.setOffsetAndLength(idEndOffset, 0);
|
||||
}
|
||||
} else {
|
||||
n1.computeOperatorOffsets(functionName, true);
|
||||
n1.computeOperatorOffsets(fFunctionName, true);
|
||||
n2.computeOperatorOffsets(fArguments[fArguments.length - 1], true);
|
||||
}
|
||||
|
||||
implicitNames = new IASTImplicitName[] { n1, n2 };
|
||||
fImplicitNames = new IASTImplicitName[] { n1, n2 };
|
||||
}
|
||||
return implicitNames;
|
||||
return fImplicitNames;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -185,7 +186,7 @@ public class CPPASTFunctionCallExpression extends ASTNode
|
|||
}
|
||||
}
|
||||
|
||||
if (functionName != null && !functionName.accept(action))
|
||||
if (fFunctionName != null && !fFunctionName.accept(action))
|
||||
return false;
|
||||
|
||||
IASTImplicitName[] implicits = action.shouldVisitImplicitNames ? getImplicitNames() : null;
|
||||
|
@ -209,10 +210,10 @@ public class CPPASTFunctionCallExpression extends ASTNode
|
|||
|
||||
@Override
|
||||
public void replace(IASTNode child, IASTNode other) {
|
||||
if (child == functionName) {
|
||||
if (child == fFunctionName) {
|
||||
other.setPropertyInParent(child.getPropertyInParent());
|
||||
other.setParent(child.getParent());
|
||||
functionName = (ICPPASTExpression) other;
|
||||
fFunctionName = (ICPPASTExpression) other;
|
||||
}
|
||||
for (int i = 0; i < fArguments.length; ++i) {
|
||||
if (child == fArguments[i]) {
|
||||
|
@ -223,8 +224,8 @@ public class CPPASTFunctionCallExpression extends ASTNode
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
@Override
|
||||
public IASTExpression getParameterExpression() {
|
||||
if (fArguments.length == 0)
|
||||
return null;
|
||||
|
@ -246,8 +247,8 @@ public class CPPASTFunctionCallExpression extends ASTNode
|
|||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
@Override
|
||||
public void setParameterExpression(IASTExpression expression) {
|
||||
assertNotFrozen();
|
||||
if (expression == null) {
|
||||
|
@ -270,9 +271,10 @@ public class CPPASTFunctionCallExpression extends ASTNode
|
|||
IType t= getNestedType(((EvalTypeId) eval).getInputType(), TDEF | CVTYPE | REF);
|
||||
if (t instanceof ICPPClassType && !(t instanceof ICPPUnknownBinding)) {
|
||||
ICPPClassType cls= (ICPPClassType) t;
|
||||
LookupData data= CPPSemantics.createLookupData(((IASTIdExpression) functionName).getName());
|
||||
LookupData data= CPPSemantics.createLookupData(((IASTIdExpression) fFunctionName).getName());
|
||||
try {
|
||||
IBinding b= CPPSemantics.resolveFunction(data, ClassTypeHelper.getConstructors(cls, data.getLookupPoint()), true);
|
||||
ICPPConstructor[] constructors = ClassTypeHelper.getConstructors(cls, data.getLookupPoint());
|
||||
IBinding b= CPPSemantics.resolveFunction(data, constructors, true);
|
||||
if (b instanceof ICPPFunction)
|
||||
return (ICPPFunction) b;
|
||||
} catch (DOMException e) {
|
||||
|
@ -285,14 +287,14 @@ public class CPPASTFunctionCallExpression extends ASTNode
|
|||
|
||||
@Override
|
||||
public ICPPEvaluation getEvaluation() {
|
||||
if (evaluation == null)
|
||||
evaluation= computeEvaluation();
|
||||
if (fEvaluation == null)
|
||||
fEvaluation= computeEvaluation();
|
||||
|
||||
return evaluation;
|
||||
return fEvaluation;
|
||||
}
|
||||
|
||||
private ICPPEvaluation computeEvaluation() {
|
||||
if (functionName == null || fArguments == null)
|
||||
if (fFunctionName == null || fArguments == null)
|
||||
return EvalFixed.INCOMPLETE;
|
||||
|
||||
ICPPEvaluation conversion= checkForExplicitTypeConversion();
|
||||
|
@ -300,7 +302,7 @@ public class CPPASTFunctionCallExpression extends ASTNode
|
|||
return conversion;
|
||||
|
||||
ICPPEvaluation[] args= new ICPPEvaluation[fArguments.length + 1];
|
||||
args[0]= functionName.getEvaluation();
|
||||
args[0]= fFunctionName.getEvaluation();
|
||||
for (int i = 1; i < args.length; i++) {
|
||||
args[i]= ((ICPPASTInitializerClause) fArguments[i - 1]).getEvaluation();
|
||||
}
|
||||
|
@ -308,8 +310,8 @@ public class CPPASTFunctionCallExpression extends ASTNode
|
|||
}
|
||||
|
||||
private ICPPEvaluation checkForExplicitTypeConversion() {
|
||||
if (functionName instanceof IASTIdExpression) {
|
||||
final IASTName name = ((IASTIdExpression) functionName).getName();
|
||||
if (fFunctionName instanceof IASTIdExpression) {
|
||||
final IASTName name = ((IASTIdExpression) fFunctionName).getName();
|
||||
IBinding b= name.resolvePreBinding();
|
||||
if (b instanceof IType) {
|
||||
ICPPEvaluation[] args= new ICPPEvaluation[fArguments.length];
|
||||
|
|
|
@ -29,8 +29,9 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalID;
|
|||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.FunctionSetType;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil;
|
||||
|
||||
public class CPPASTIdExpression extends ASTNode implements IASTIdExpression, ICPPASTExpression, ICPPASTCompletionContext {
|
||||
private IASTName name;
|
||||
public class CPPASTIdExpression extends ASTNode
|
||||
implements IASTIdExpression, ICPPASTExpression, ICPPASTCompletionContext {
|
||||
private IASTName fName;
|
||||
private ICPPEvaluation fEvaluation;
|
||||
|
||||
public CPPASTIdExpression() {
|
||||
|
@ -47,19 +48,19 @@ public class CPPASTIdExpression extends ASTNode implements IASTIdExpression, ICP
|
|||
|
||||
@Override
|
||||
public CPPASTIdExpression copy(CopyStyle style) {
|
||||
CPPASTIdExpression copy = new CPPASTIdExpression(name == null ? null : name.copy(style));
|
||||
CPPASTIdExpression copy = new CPPASTIdExpression(fName == null ? null : fName.copy(style));
|
||||
return copy(copy, style);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IASTName getName() {
|
||||
return name;
|
||||
return fName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setName(IASTName name) {
|
||||
assertNotFrozen();
|
||||
this.name = name;
|
||||
this.fName = name;
|
||||
if (name != null) {
|
||||
name.setParent(this);
|
||||
name.setPropertyInParent(ID_NAME);
|
||||
|
@ -76,7 +77,7 @@ public class CPPASTIdExpression extends ASTNode implements IASTIdExpression, ICP
|
|||
}
|
||||
}
|
||||
|
||||
if (name != null && !name.accept(action)) return false;
|
||||
if (fName != null && !fName.accept(action)) return false;
|
||||
|
||||
if (action.shouldVisitExpressions) {
|
||||
switch (action.leave(this)) {
|
||||
|
@ -90,7 +91,7 @@ public class CPPASTIdExpression extends ASTNode implements IASTIdExpression, ICP
|
|||
|
||||
@Override
|
||||
public int getRoleForName(IASTName n) {
|
||||
if (name == n)
|
||||
if (fName == n)
|
||||
return r_reference;
|
||||
return r_unclear;
|
||||
}
|
||||
|
@ -102,7 +103,7 @@ public class CPPASTIdExpression extends ASTNode implements IASTIdExpression, ICP
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return name != null ? name.toString() : "<unnamed>"; //$NON-NLS-1$
|
||||
return fName != null ? fName.toString() : "<unnamed>"; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -122,7 +123,7 @@ public class CPPASTIdExpression extends ASTNode implements IASTIdExpression, ICP
|
|||
public IType getExpressionType() {
|
||||
IType type= getEvaluation().getTypeOrFunctionSet(this);
|
||||
if (type instanceof FunctionSetType) {
|
||||
IBinding binding= name.resolveBinding();
|
||||
IBinding binding= fName.resolveBinding();
|
||||
if (binding instanceof IFunction) {
|
||||
return SemanticUtil.mapToAST(((IFunction) binding).getType(), this);
|
||||
}
|
||||
|
|
|
@ -71,11 +71,6 @@ public class CPPASTLambdaExpression extends ASTNode implements ICPPASTLambdaExpr
|
|||
return copy(copy, style);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IASTImplicitName[] getImplicitNames() {
|
||||
return new IASTImplicitName[] {getFunctionCallOperatorName()};
|
||||
}
|
||||
|
||||
@Override
|
||||
public IASTImplicitName getClosureTypeName() {
|
||||
if (fClosureTypeName == null) {
|
||||
|
@ -109,6 +104,11 @@ public class CPPASTLambdaExpression extends ASTNode implements ICPPASTLambdaExpr
|
|||
return fImplicitFunctionCallName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IASTImplicitName[] getImplicitNames() {
|
||||
return new IASTImplicitName[] {getFunctionCallOperatorName()};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean accept(ASTVisitor visitor) {
|
||||
if (visitor.shouldVisitExpressions) {
|
||||
|
|
|
@ -40,17 +40,17 @@ public class CPPASTLiteralExpression extends ASTNode implements ICPPASTLiteralEx
|
|||
public static final CPPASTLiteralExpression INT_ZERO =
|
||||
new CPPASTLiteralExpression(lk_integer_constant, new char[] {'0'});
|
||||
|
||||
private int kind;
|
||||
private char[] value = CharArrayUtils.EMPTY;
|
||||
private int fStringLiteralSize = -1; // accounting for escape sequences and the null terminator
|
||||
private int fKind;
|
||||
private char[] fValue = CharArrayUtils.EMPTY;
|
||||
private int fStringLiteralSize = -1; // Accounting for escape sequences and the null terminator.
|
||||
private ICPPEvaluation fEvaluation;
|
||||
|
||||
public CPPASTLiteralExpression() {
|
||||
}
|
||||
|
||||
public CPPASTLiteralExpression(int kind, char[] value) {
|
||||
this.kind = kind;
|
||||
this.value = value;
|
||||
this.fKind = kind;
|
||||
this.fValue = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -61,35 +61,35 @@ public class CPPASTLiteralExpression extends ASTNode implements ICPPASTLiteralEx
|
|||
@Override
|
||||
public CPPASTLiteralExpression copy(CopyStyle style) {
|
||||
CPPASTLiteralExpression copy =
|
||||
new CPPASTLiteralExpression(kind, value == null ? null : value.clone());
|
||||
new CPPASTLiteralExpression(fKind, fValue == null ? null : fValue.clone());
|
||||
return copy(copy, style);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getKind() {
|
||||
return kind;
|
||||
return fKind;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setKind(int value) {
|
||||
assertNotFrozen();
|
||||
kind = value;
|
||||
fKind = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public char[] getValue() {
|
||||
return value;
|
||||
return fValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(char[] value) {
|
||||
assertNotFrozen();
|
||||
this.value= value;
|
||||
this.fValue= value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new String(value);
|
||||
return new String(fValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -112,22 +112,22 @@ public class CPPASTLiteralExpression extends ASTNode implements ICPPASTLiteralEx
|
|||
}
|
||||
|
||||
private int computeStringLiteralSize() {
|
||||
int start = 0, end = value.length - 1;
|
||||
int start = 0, end = fValue.length - 1;
|
||||
boolean isRaw = false;
|
||||
|
||||
// Skip past a prefix affecting the character type.
|
||||
if (value[0] == 'L' || value[0] == 'u' || value[0] == 'U') {
|
||||
if (fValue[0] == 'L' || fValue[0] == 'u' || fValue[0] == 'U') {
|
||||
++start;
|
||||
}
|
||||
|
||||
// If there is an 'R' prefix, skip past it but take note of it.
|
||||
if (value[start] == 'R') {
|
||||
if (fValue[start] == 'R') {
|
||||
++start;
|
||||
isRaw = true;
|
||||
}
|
||||
|
||||
// Now we should have a quote-enclosed string. Skip past the quotes.
|
||||
if (!(value[start] == '"' && value[end] == '"')) {
|
||||
if (!(fValue[start] == '"' && fValue[end] == '"')) {
|
||||
// Unexpected!
|
||||
return 0;
|
||||
}
|
||||
|
@ -136,13 +136,13 @@ public class CPPASTLiteralExpression extends ASTNode implements ICPPASTLiteralEx
|
|||
|
||||
// If we have a raw string, skip past the raw prefix.
|
||||
if (isRaw) {
|
||||
while (value[start] != '(' && start <= end) {
|
||||
while (fValue[start] != '(' && start <= end) {
|
||||
++start;
|
||||
--end;
|
||||
}
|
||||
|
||||
// Now we should have a parenthesis-enclosed string.
|
||||
if (!(value[start] == '(' && value[end] == ')')) {
|
||||
if (!(fValue[start] == '(' && fValue[end] == ')')) {
|
||||
// Unexpected!
|
||||
return 0;
|
||||
}
|
||||
|
@ -161,7 +161,7 @@ public class CPPASTLiteralExpression extends ASTNode implements ICPPASTLiteralEx
|
|||
if (escaping) {
|
||||
escaping = false;
|
||||
++length;
|
||||
} else if (value[start] == '\\') {
|
||||
} else if (fValue[start] == '\\') {
|
||||
escaping = true;
|
||||
} else {
|
||||
++length;
|
||||
|
@ -253,7 +253,7 @@ public class CPPASTLiteralExpression extends ASTNode implements ICPPASTLiteralEx
|
|||
@Deprecated
|
||||
public void setValue(String value) {
|
||||
assertNotFrozen();
|
||||
this.value = value.toCharArray();
|
||||
this.fValue = value.toCharArray();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -272,7 +272,7 @@ public class CPPASTLiteralExpression extends ASTNode implements ICPPASTLiteralEx
|
|||
}
|
||||
|
||||
private ICPPEvaluation createEvaluation() {
|
||||
switch (kind) {
|
||||
switch (fKind) {
|
||||
case lk_this: {
|
||||
IScope scope = CPPVisitor.getContainingScope(this);
|
||||
IType type= CPPVisitor.getImpliedObjectType(scope);
|
||||
|
|
|
@ -48,15 +48,15 @@ import org.eclipse.core.runtime.Assert;
|
|||
* Represents a new expression [expr.new].
|
||||
*/
|
||||
public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression, IASTAmbiguityParent {
|
||||
private IASTInitializerClause[] placement;
|
||||
private IASTTypeId typeId;
|
||||
private IASTInitializer initializer;
|
||||
private IASTImplicitName[] implicitNames;
|
||||
private boolean isGlobal;
|
||||
private boolean isNewTypeId;
|
||||
private IASTInitializerClause[] fPlacement;
|
||||
private IASTTypeId fTypeId;
|
||||
private IASTInitializer fInitializer;
|
||||
private boolean fIsGlobal;
|
||||
private boolean fIsNewTypeId;
|
||||
|
||||
private IASTExpression[] cachedArraySizes;
|
||||
private IASTExpression[] fCachedArraySizes;
|
||||
private ICPPEvaluation fEvaluation;
|
||||
private IASTImplicitName[] fImplicitNames;
|
||||
|
||||
public CPPASTNewExpression() {
|
||||
}
|
||||
|
@ -75,40 +75,40 @@ public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression
|
|||
@Override
|
||||
public CPPASTNewExpression copy(CopyStyle style) {
|
||||
CPPASTNewExpression copy = new CPPASTNewExpression();
|
||||
copy.setIsGlobal(isGlobal);
|
||||
copy.setIsNewTypeId(isNewTypeId);
|
||||
if (placement != null) {
|
||||
IASTInitializerClause[] plcmt = new IASTInitializerClause[placement.length];
|
||||
for (int i = 0; i < placement.length; i++) {
|
||||
plcmt[i] = placement[i].copy(style);
|
||||
copy.setIsGlobal(fIsGlobal);
|
||||
copy.setIsNewTypeId(fIsNewTypeId);
|
||||
if (fPlacement != null) {
|
||||
IASTInitializerClause[] plcmt = new IASTInitializerClause[fPlacement.length];
|
||||
for (int i = 0; i < fPlacement.length; i++) {
|
||||
plcmt[i] = fPlacement[i].copy(style);
|
||||
}
|
||||
copy.setPlacementArguments(plcmt);
|
||||
}
|
||||
copy.setTypeId(typeId == null ? null : typeId.copy(style));
|
||||
copy.setInitializer(initializer == null ? null : initializer.copy(style));
|
||||
copy.setTypeId(fTypeId == null ? null : fTypeId.copy(style));
|
||||
copy.setInitializer(fInitializer == null ? null : fInitializer.copy(style));
|
||||
return copy(copy, style);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isGlobal() {
|
||||
return isGlobal;
|
||||
return fIsGlobal;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIsGlobal(boolean value) {
|
||||
assertNotFrozen();
|
||||
isGlobal = value;
|
||||
fIsGlobal = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IASTInitializerClause[] getPlacementArguments() {
|
||||
return placement;
|
||||
return fPlacement;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPlacementArguments(IASTInitializerClause[] args) {
|
||||
assertNotFrozen();
|
||||
placement = args;
|
||||
fPlacement = args;
|
||||
if (args != null) {
|
||||
for (IASTInitializerClause arg : args) {
|
||||
arg.setParent(this);
|
||||
|
@ -119,13 +119,13 @@ public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression
|
|||
|
||||
@Override
|
||||
public IASTInitializer getInitializer() {
|
||||
return initializer;
|
||||
return fInitializer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInitializer(IASTInitializer expression) {
|
||||
assertNotFrozen();
|
||||
initializer = expression;
|
||||
fInitializer = expression;
|
||||
if (expression != null) {
|
||||
expression.setParent(this);
|
||||
expression.setPropertyInParent(NEW_INITIALIZER);
|
||||
|
@ -134,13 +134,13 @@ public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression
|
|||
|
||||
@Override
|
||||
public IASTTypeId getTypeId() {
|
||||
return typeId;
|
||||
return fTypeId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeId(IASTTypeId typeId) {
|
||||
assertNotFrozen();
|
||||
this.typeId = typeId;
|
||||
fTypeId = typeId;
|
||||
if (typeId != null) {
|
||||
typeId.setParent(this);
|
||||
typeId.setPropertyInParent(TYPE_ID);
|
||||
|
@ -149,13 +149,13 @@ public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression
|
|||
|
||||
@Override
|
||||
public boolean isNewTypeId() {
|
||||
return isNewTypeId;
|
||||
return fIsNewTypeId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIsNewTypeId(boolean value) {
|
||||
assertNotFrozen();
|
||||
isNewTypeId = value;
|
||||
fIsNewTypeId = value;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -163,7 +163,7 @@ public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression
|
|||
*/
|
||||
@Override
|
||||
public IASTImplicitName[] getImplicitNames() {
|
||||
if (implicitNames == null) {
|
||||
if (fImplicitNames == null) {
|
||||
CPPASTImplicitName operatorName = null;
|
||||
ICPPFunction operatorFunction = CPPSemantics.findOverloadedOperator(this);
|
||||
if (operatorFunction != null && !(operatorFunction instanceof CPPImplicitFunction)) {
|
||||
|
@ -183,20 +183,20 @@ public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression
|
|||
|
||||
if (operatorName != null) {
|
||||
if (constructorName != null) {
|
||||
implicitNames = new IASTImplicitName[] { operatorName, constructorName };
|
||||
fImplicitNames = new IASTImplicitName[] { operatorName, constructorName };
|
||||
} else {
|
||||
implicitNames = new IASTImplicitName[] { operatorName };
|
||||
fImplicitNames = new IASTImplicitName[] { operatorName };
|
||||
}
|
||||
} else {
|
||||
if (constructorName != null) {
|
||||
implicitNames = new IASTImplicitName[] { constructorName };
|
||||
fImplicitNames = new IASTImplicitName[] { constructorName };
|
||||
} else {
|
||||
implicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
|
||||
fImplicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return implicitNames;
|
||||
return fImplicitNames;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -232,16 +232,16 @@ public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression
|
|||
}
|
||||
}
|
||||
|
||||
if (placement != null) {
|
||||
for (IASTInitializerClause arg : placement) {
|
||||
if (fPlacement != null) {
|
||||
for (IASTInitializerClause arg : fPlacement) {
|
||||
if (!arg.accept(action))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (typeId != null && !typeId.accept(action))
|
||||
if (fTypeId != null && !fTypeId.accept(action))
|
||||
return false;
|
||||
|
||||
if (initializer != null && !initializer.accept(action))
|
||||
if (fInitializer != null && !fInitializer.accept(action))
|
||||
return false;
|
||||
|
||||
if (action.shouldVisitExpressions) {
|
||||
|
@ -256,12 +256,12 @@ public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression
|
|||
|
||||
@Override
|
||||
public void replace(IASTNode child, IASTNode other) {
|
||||
if (placement != null) {
|
||||
for (int i = 0; i < placement.length; ++i) {
|
||||
if (child == placement[i]) {
|
||||
if (fPlacement != null) {
|
||||
for (int i = 0; i < fPlacement.length; ++i) {
|
||||
if (child == fPlacement[i]) {
|
||||
other.setPropertyInParent(child.getPropertyInParent());
|
||||
other.setParent(child.getParent());
|
||||
placement[i] = (IASTExpression) other;
|
||||
fPlacement[i] = (IASTExpression) other;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -270,13 +270,13 @@ public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression
|
|||
@Override
|
||||
public ICPPEvaluation getEvaluation() {
|
||||
if (fEvaluation == null) {
|
||||
IType t = typeId != null ? CPPVisitor.createType(typeId) : ProblemType.UNKNOWN_FOR_EXPRESSION;
|
||||
IType t = fTypeId != null ? CPPVisitor.createType(fTypeId) : ProblemType.UNKNOWN_FOR_EXPRESSION;
|
||||
if (t instanceof IArrayType) {
|
||||
t = ((IArrayType) t).getType();
|
||||
}
|
||||
ICPPEvaluation[] arguments = ICPPEvaluation.EMPTY_ARRAY;
|
||||
if (initializer instanceof ICPPASTConstructorInitializer) {
|
||||
IASTInitializerClause[] args = ((ICPPASTConstructorInitializer) initializer).getArguments();
|
||||
if (fInitializer instanceof ICPPASTConstructorInitializer) {
|
||||
IASTInitializerClause[] args = ((ICPPASTConstructorInitializer) fInitializer).getArguments();
|
||||
arguments= new ICPPEvaluation[args.length];
|
||||
for (int i = 0; i < arguments.length; i++) {
|
||||
arguments[i] = ((ICPPASTInitializerClause) args[i]).getEvaluation();
|
||||
|
@ -305,40 +305,40 @@ public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression
|
|||
@Override
|
||||
@Deprecated
|
||||
public IASTExpression[] getNewTypeIdArrayExpressions() {
|
||||
if (cachedArraySizes == null) {
|
||||
if (typeId != null) {
|
||||
IASTDeclarator dtor = ASTQueries.findInnermostDeclarator(typeId.getAbstractDeclarator());
|
||||
if (fCachedArraySizes == null) {
|
||||
if (fTypeId != null) {
|
||||
IASTDeclarator dtor = ASTQueries.findInnermostDeclarator(fTypeId.getAbstractDeclarator());
|
||||
if (dtor instanceof IASTArrayDeclarator) {
|
||||
IASTArrayDeclarator ad = (IASTArrayDeclarator) dtor;
|
||||
IASTArrayModifier[] ams = ad.getArrayModifiers();
|
||||
cachedArraySizes = new IASTExpression[ams.length];
|
||||
fCachedArraySizes = new IASTExpression[ams.length];
|
||||
for (int i = 0; i < ams.length; i++) {
|
||||
IASTArrayModifier am = ams[i];
|
||||
cachedArraySizes[i] = am.getConstantExpression();
|
||||
fCachedArraySizes[i] = am.getConstantExpression();
|
||||
}
|
||||
return cachedArraySizes;
|
||||
return fCachedArraySizes;
|
||||
}
|
||||
}
|
||||
cachedArraySizes = IASTExpression.EMPTY_EXPRESSION_ARRAY;
|
||||
fCachedArraySizes = IASTExpression.EMPTY_EXPRESSION_ARRAY;
|
||||
}
|
||||
return cachedArraySizes;
|
||||
return fCachedArraySizes;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void addNewTypeIdArrayExpression(IASTExpression expression) {
|
||||
assertNotFrozen();
|
||||
Assert.isNotNull(typeId);
|
||||
IASTDeclarator dtor= ASTQueries.findInnermostDeclarator(typeId.getAbstractDeclarator());
|
||||
Assert.isNotNull(fTypeId);
|
||||
IASTDeclarator dtor= ASTQueries.findInnermostDeclarator(fTypeId.getAbstractDeclarator());
|
||||
if (dtor instanceof IASTArrayDeclarator == false) {
|
||||
Assert.isNotNull(dtor);
|
||||
Assert.isTrue(dtor.getParent() == typeId);
|
||||
Assert.isTrue(dtor.getParent() == fTypeId);
|
||||
IASTArrayDeclarator adtor= new CPPASTArrayDeclarator(dtor.getName());
|
||||
IASTPointerOperator[] ptrOps= dtor.getPointerOperators();
|
||||
for (IASTPointerOperator ptr : ptrOps) {
|
||||
adtor.addPointerOperator(ptr);
|
||||
}
|
||||
typeId.setAbstractDeclarator(adtor);
|
||||
fTypeId.setAbstractDeclarator(adtor);
|
||||
dtor= adtor;
|
||||
}
|
||||
IASTArrayModifier mod= new CPPASTArrayModifier(expression);
|
||||
|
@ -349,16 +349,16 @@ public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression
|
|||
@Override
|
||||
@Deprecated
|
||||
public IASTExpression getNewPlacement() {
|
||||
if (placement == null || placement.length == 0)
|
||||
if (fPlacement == null || fPlacement.length == 0)
|
||||
return null;
|
||||
if (placement.length == 1) {
|
||||
if (placement[0] instanceof IASTExpression)
|
||||
return (IASTExpression) placement[0];
|
||||
if (fPlacement.length == 1) {
|
||||
if (fPlacement[0] instanceof IASTExpression)
|
||||
return (IASTExpression) fPlacement[0];
|
||||
return null;
|
||||
}
|
||||
|
||||
CASTExpressionList result= new CASTExpressionList();
|
||||
for (IASTInitializerClause arg : placement) {
|
||||
for (IASTInitializerClause arg : fPlacement) {
|
||||
if (arg instanceof IASTExpression) {
|
||||
result.addExpression(((IASTExpression) arg).copy());
|
||||
}
|
||||
|
@ -384,11 +384,11 @@ public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression
|
|||
@Override
|
||||
@Deprecated
|
||||
public IASTExpression getNewInitializer() {
|
||||
if (initializer == null || initializer instanceof IASTExpression) {
|
||||
return (IASTExpression) initializer;
|
||||
if (fInitializer == null || fInitializer instanceof IASTExpression) {
|
||||
return (IASTExpression) fInitializer;
|
||||
}
|
||||
if (initializer instanceof ICPPASTConstructorInitializer) {
|
||||
IASTExpression expr= ((ICPPASTConstructorInitializer) initializer).getExpression();
|
||||
if (fInitializer instanceof ICPPASTConstructorInitializer) {
|
||||
IASTExpression expr= ((ICPPASTConstructorInitializer) fInitializer).getExpression();
|
||||
if (expr == null) {
|
||||
expr= new CPPASTExpressionList();
|
||||
} else {
|
||||
|
|
|
@ -34,6 +34,7 @@ public class CPPASTProblemExpression extends CPPASTProblemOwner implements IASTP
|
|||
public CPPASTProblemExpression copy() {
|
||||
return copy(CopyStyle.withoutLocations);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CPPASTProblemExpression copy(CopyStyle style) {
|
||||
CPPASTProblemExpression copy = new CPPASTProblemExpression();
|
||||
|
|
|
@ -148,8 +148,8 @@ public class CPPASTSimpleTypeConstructorExpression extends ASTNode
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
@Override
|
||||
public int getSimpleType() {
|
||||
IType type= getExpressionType();
|
||||
if (type instanceof ICPPBasicType) {
|
||||
|
@ -185,8 +185,8 @@ public class CPPASTSimpleTypeConstructorExpression extends ASTNode
|
|||
return t_unspecified;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
@Override
|
||||
public void setSimpleType(int value) {
|
||||
CPPASTSimpleDeclSpecifier declspec = new CPPASTSimpleDeclSpecifier();
|
||||
switch(value) {
|
||||
|
@ -234,8 +234,8 @@ public class CPPASTSimpleTypeConstructorExpression extends ASTNode
|
|||
setDeclSpecifier(declspec);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
@Override
|
||||
public IASTExpression getInitialValue() {
|
||||
if (fInitializer instanceof ICPPASTConstructorInitializer) {
|
||||
return ((ICPPASTConstructorInitializer) fInitializer).getExpression();
|
||||
|
@ -243,8 +243,8 @@ public class CPPASTSimpleTypeConstructorExpression extends ASTNode
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
@Override
|
||||
public void setInitialValue(IASTExpression expression) {
|
||||
ICPPASTConstructorInitializer init= new CPPASTConstructorInitializer();
|
||||
init.setExpression(expression);
|
||||
|
|
|
@ -24,15 +24,15 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalFixed;
|
|||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalUnaryTypeID;
|
||||
|
||||
public class CPPASTTypeIdExpression extends ASTNode implements ICPPASTTypeIdExpression {
|
||||
private int op;
|
||||
private IASTTypeId typeId;
|
||||
private int fOperator;
|
||||
private IASTTypeId fTypeId;
|
||||
private ICPPEvaluation fEvaluation;
|
||||
|
||||
public CPPASTTypeIdExpression() {
|
||||
}
|
||||
|
||||
public CPPASTTypeIdExpression(int op, IASTTypeId typeId) {
|
||||
this.op = op;
|
||||
this.fOperator = op;
|
||||
setTypeId(typeId);
|
||||
}
|
||||
|
||||
|
@ -44,25 +44,25 @@ public class CPPASTTypeIdExpression extends ASTNode implements ICPPASTTypeIdExpr
|
|||
@Override
|
||||
public CPPASTTypeIdExpression copy(CopyStyle style) {
|
||||
CPPASTTypeIdExpression copy =
|
||||
new CPPASTTypeIdExpression(op, typeId == null ? null : typeId.copy(style));
|
||||
new CPPASTTypeIdExpression(fOperator, fTypeId == null ? null : fTypeId.copy(style));
|
||||
return copy(copy, style);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOperator() {
|
||||
return op;
|
||||
return fOperator;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setOperator(int value) {
|
||||
assertNotFrozen();
|
||||
this.op = value;
|
||||
fOperator = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeId(IASTTypeId typeId) {
|
||||
assertNotFrozen();
|
||||
this.typeId = typeId;
|
||||
this.fTypeId = typeId;
|
||||
if (typeId != null) {
|
||||
typeId.setParent(this);
|
||||
typeId.setPropertyInParent(TYPE_ID);
|
||||
|
@ -71,7 +71,7 @@ public class CPPASTTypeIdExpression extends ASTNode implements ICPPASTTypeIdExpr
|
|||
|
||||
@Override
|
||||
public IASTTypeId getTypeId() {
|
||||
return typeId;
|
||||
return fTypeId;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -84,7 +84,7 @@ public class CPPASTTypeIdExpression extends ASTNode implements ICPPASTTypeIdExpr
|
|||
}
|
||||
}
|
||||
|
||||
if (typeId != null && !typeId.accept(action)) return false;
|
||||
if (fTypeId != null && !fTypeId.accept(action)) return false;
|
||||
|
||||
if (action.shouldVisitExpressions) {
|
||||
switch (action.leave(this)) {
|
||||
|
@ -99,11 +99,11 @@ public class CPPASTTypeIdExpression extends ASTNode implements ICPPASTTypeIdExpr
|
|||
@Override
|
||||
public ICPPEvaluation getEvaluation() {
|
||||
if (fEvaluation == null) {
|
||||
IType type= CPPVisitor.createType(typeId);
|
||||
IType type= CPPVisitor.createType(fTypeId);
|
||||
if (type == null || type instanceof IProblemType) {
|
||||
fEvaluation= EvalFixed.INCOMPLETE;
|
||||
} else {
|
||||
fEvaluation= new EvalUnaryTypeID(op, type, this);
|
||||
fEvaluation= new EvalUnaryTypeID(fOperator, type, this);
|
||||
}
|
||||
}
|
||||
return fEvaluation;
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTInitializer;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTTypeIdInitializerExpression;
|
||||
|
@ -17,35 +18,97 @@ import org.eclipse.cdt.core.dom.ast.IProblemType;
|
|||
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.ICPPASTInitializerClause;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.ASTTypeIdInitializerExpression;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalFixed;
|
||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalTypeId;
|
||||
|
||||
/**
|
||||
* C++ variant of type id initializer expression. type-id { initializer }
|
||||
* Type id initializer expression for C++, type-id { initializer }
|
||||
*/
|
||||
public class CPPASTTypeIdInitializerExpression extends ASTTypeIdInitializerExpression implements ICPPASTExpression {
|
||||
|
||||
public class CPPASTTypeIdInitializerExpression extends ASTNode
|
||||
implements IASTTypeIdInitializerExpression, ICPPASTExpression {
|
||||
private IASTTypeId fTypeId;
|
||||
private IASTInitializer fInitializer;
|
||||
private ICPPEvaluation fEvaluation;
|
||||
|
||||
private CPPASTTypeIdInitializerExpression() {
|
||||
public CPPASTTypeIdInitializerExpression() {
|
||||
}
|
||||
|
||||
public CPPASTTypeIdInitializerExpression(IASTTypeId typeId, IASTInitializer initializer) {
|
||||
super(typeId, initializer);
|
||||
public CPPASTTypeIdInitializerExpression(IASTTypeId t, IASTInitializer i) {
|
||||
setTypeId(t);
|
||||
setInitializer(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IASTTypeId getTypeId() {
|
||||
return fTypeId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeId(IASTTypeId typeId) {
|
||||
assertNotFrozen();
|
||||
this.fTypeId = typeId;
|
||||
if (typeId != null) {
|
||||
typeId.setParent(this);
|
||||
typeId.setPropertyInParent(TYPE_ID);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IASTInitializer getInitializer() {
|
||||
return fInitializer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInitializer(IASTInitializer initializer) {
|
||||
assertNotFrozen();
|
||||
this.fInitializer = initializer;
|
||||
if (initializer != null) {
|
||||
initializer.setParent(this);
|
||||
initializer.setPropertyInParent(INITIALIZER);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean accept(ASTVisitor action) {
|
||||
if (action.shouldVisitExpressions) {
|
||||
switch (action.visit(this)) {
|
||||
case ASTVisitor.PROCESS_ABORT: return false;
|
||||
case ASTVisitor.PROCESS_SKIP: return true;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
if (fTypeId != null && !fTypeId.accept(action)) return false;
|
||||
if (fInitializer != null && !fInitializer.accept(action)) return false;
|
||||
|
||||
if (action.shouldVisitExpressions) {
|
||||
switch (action.leave(this)) {
|
||||
case ASTVisitor.PROCESS_ABORT: return false;
|
||||
case ASTVisitor.PROCESS_SKIP: return true;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean isLValue() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IASTTypeIdInitializerExpression copy() {
|
||||
return copy(CopyStyle.withoutLocations);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IASTTypeIdInitializerExpression copy(CopyStyle style) {
|
||||
CPPASTTypeIdInitializerExpression expr = new CPPASTTypeIdInitializerExpression();
|
||||
initializeCopy(expr, style);
|
||||
return expr;
|
||||
CPPASTTypeIdInitializerExpression copy =new CPPASTTypeIdInitializerExpression(
|
||||
fTypeId == null ? null : fTypeId.copy(style),
|
||||
fInitializer == null ? null : fInitializer.copy(style));
|
||||
return copy(copy, style);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -55,7 +118,7 @@ public class CPPASTTypeIdInitializerExpression extends ASTTypeIdInitializerExpre
|
|||
|
||||
return fEvaluation;
|
||||
}
|
||||
|
||||
|
||||
private ICPPEvaluation computeEvaluation() {
|
||||
final IASTInitializer initializer = getInitializer();
|
||||
if (!(initializer instanceof ICPPASTInitializerClause))
|
||||
|
@ -68,13 +131,13 @@ public class CPPASTTypeIdInitializerExpression extends ASTTypeIdInitializerExpre
|
|||
return new EvalTypeId(type, this, ((ICPPASTInitializerClause) initializer).getEvaluation());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public IType getExpressionType() {
|
||||
return getEvaluation().getTypeOrFunctionSet(this);
|
||||
}
|
||||
|
||||
return getEvaluation().getTypeOrFunctionSet(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ValueCategory getValueCategory() {
|
||||
return getEvaluation().getValueCategory(this);
|
||||
return getEvaluation().getValueCategory(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,8 +41,8 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.FunctionSetType;
|
|||
public class CPPASTUnaryExpression extends ASTNode implements ICPPASTUnaryExpression, IASTAmbiguityParent {
|
||||
private int fOperator;
|
||||
private ICPPASTExpression fOperand;
|
||||
private IASTImplicitName[] fImplicitNames;
|
||||
private ICPPEvaluation fEvaluation;
|
||||
private IASTImplicitName[] fImplicitNames;
|
||||
|
||||
public CPPASTUnaryExpression() {
|
||||
}
|
||||
|
@ -94,9 +94,6 @@ public class CPPASTUnaryExpression extends ASTNode implements ICPPASTUnaryExpres
|
|||
return fOperator == op_postFixDecr || fOperator == op_postFixIncr;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.core.dom.ast.IASTImplicitNameOwner#getImplicitNames()
|
||||
*/
|
||||
@Override
|
||||
public IASTImplicitName[] getImplicitNames() {
|
||||
if (fImplicitNames == null) {
|
||||
|
|
|
@ -37,7 +37,7 @@ public class CPPBlockScope extends CPPNamespaceScope implements ICPPBlockScope {
|
|||
if (node instanceof IASTCompoundStatement) {
|
||||
final IASTNode parent= node.getParent();
|
||||
if (parent instanceof IASTFunctionDefinition) {
|
||||
IASTDeclarator dtor= ((IASTFunctionDefinition)parent).getDeclarator();
|
||||
IASTDeclarator dtor= ((IASTFunctionDefinition) parent).getDeclarator();
|
||||
dtor = ASTQueries.findInnermostDeclarator(dtor);
|
||||
return dtor.getName();
|
||||
}
|
||||
|
|
|
@ -52,12 +52,12 @@ public class CPPFunctionScope extends CPPScope implements ICPPFunctionScope {
|
|||
|
||||
@Override
|
||||
public void addBinding(IBinding binding) {
|
||||
//3.3.4 only labels have function scope
|
||||
// 3.3.4 only labels have function scope.
|
||||
if (!(binding instanceof ILabel))
|
||||
return;
|
||||
|
||||
if (labels == CharArrayObjectMap.EMPTY_MAP)
|
||||
labels = new CharArrayObjectMap<ILabel>(2);
|
||||
labels = new CharArrayObjectMap<>(2);
|
||||
|
||||
labels.put(binding.getNameCharArray(), (ILabel) binding);
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ public class CPPFunctionScope extends CPPScope implements ICPPFunctionScope {
|
|||
@Override
|
||||
public IBinding[] find(String name) {
|
||||
char[] n = name.toCharArray();
|
||||
List<IBinding> bindings = new ArrayList<IBinding>();
|
||||
List<IBinding> bindings = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < labels.size(); i++) {
|
||||
char[] key = labels.keyAt(i);
|
||||
|
@ -84,8 +84,8 @@ public class CPPFunctionScope extends CPPScope implements ICPPFunctionScope {
|
|||
|
||||
@Override
|
||||
public IScope getParent() {
|
||||
//we can't just resolve the function and get its parent scope, since there are cases where that
|
||||
//could loop since resolving functions requires resolving their parameter types
|
||||
// We can't just resolve the function and get its parent scope, since there are cases where that
|
||||
// could loop because resolving functions requires resolving their parameter types.
|
||||
IASTFunctionDeclarator fdtor = (IASTFunctionDeclarator) getPhysicalNode();
|
||||
IASTName name = fdtor.getName().getLastName();
|
||||
return CPPVisitor.getContainingNonTemplateScope(name);
|
||||
|
@ -96,9 +96,9 @@ public class CPPFunctionScope extends CPPScope implements ICPPFunctionScope {
|
|||
IASTFunctionDeclarator fnDtor = (IASTFunctionDeclarator) getPhysicalNode();
|
||||
IASTNode parent = fnDtor.getParent();
|
||||
if (parent instanceof IASTFunctionDefinition) {
|
||||
IASTStatement body = ((IASTFunctionDefinition)parent).getBody();
|
||||
IASTStatement body = ((IASTFunctionDefinition) parent).getBody();
|
||||
if (body instanceof IASTCompoundStatement)
|
||||
return ((IASTCompoundStatement)body).getScope();
|
||||
return ((IASTCompoundStatement) body).getScope();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ public class CPPFunctionScope extends CPPScope implements ICPPFunctionScope {
|
|||
public IName getScopeName() {
|
||||
IASTNode node = getPhysicalNode();
|
||||
if (node instanceof IASTDeclarator) {
|
||||
return ((IASTDeclarator)node).getName();
|
||||
return ((IASTDeclarator) node).getName();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#Mon Oct 17 17:37:10 PDT 2011
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
||||
|
@ -82,6 +81,7 @@ org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
|
|||
org.eclipse.jdt.core.compiler.source=1.7
|
||||
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
|
||||
|
@ -89,18 +89,21 @@ org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_e
|
|||
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
|
||||
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
|
||||
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
|
||||
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
|
||||
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
|
||||
org.eclipse.jdt.core.formatter.blank_lines_before_field=0
|
||||
|
@ -120,6 +123,7 @@ org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
|
|||
org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
|
||||
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
|
||||
|
@ -135,11 +139,17 @@ org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
|
|||
org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
|
||||
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
|
||||
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
|
||||
org.eclipse.jdt.core.formatter.comment.line_length=110
|
||||
org.eclipse.jdt.core.formatter.comment.line_length=80
|
||||
org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
|
||||
org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
|
||||
org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
|
||||
org.eclipse.jdt.core.formatter.compact_else_if=true
|
||||
org.eclipse.jdt.core.formatter.continuation_indentation=2
|
||||
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
|
||||
org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
|
||||
org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
|
||||
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
|
||||
org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
|
||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
|
||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
|
||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
|
||||
|
@ -157,7 +167,9 @@ org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
|
|||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
|
||||
|
@ -205,6 +217,7 @@ org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=inser
|
|||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
|
||||
|
@ -223,12 +236,14 @@ org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invoca
|
|||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
|
||||
|
@ -252,6 +267,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invoc
|
|||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
|
||||
|
@ -279,6 +295,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do n
|
|||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
|
||||
|
@ -307,6 +324,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invoc
|
|||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
|
||||
|
@ -316,6 +334,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=inser
|
|||
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
|
||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
|
||||
|
@ -339,5 +358,8 @@ org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
|
|||
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
|
||||
org.eclipse.jdt.core.formatter.tabulation.char=tab
|
||||
org.eclipse.jdt.core.formatter.tabulation.size=4
|
||||
org.eclipse.jdt.core.formatter.use_on_off_tags=false
|
||||
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
|
||||
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
|
||||
org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
|
||||
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#Wed Jan 28 12:19:09 CET 2009
|
||||
eclipse.preferences.version=1
|
||||
formatter_profile=_CDT
|
||||
formatter_settings_version=11
|
||||
formatter_settings_version=12
|
||||
org.eclipse.jdt.ui.ignorelowercasenames=true
|
||||
org.eclipse.jdt.ui.importorder=java;javax;org;com;org.eclipse.cdt;org.eclipse.cdt.internal;org.eclipse.cdt.internal.ui;
|
||||
org.eclipse.jdt.ui.ondemandthreshold=99
|
||||
|
|
Loading…
Add table
Reference in a new issue