mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 06:02:11 +02:00
Reverted erroneous commits.
Change-Id: I7e914e27413f102d4b84c62f53f300c4ec5d23e8 Signed-off-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
This commit is contained in:
parent
76f23d05c3
commit
bec85475fd
65 changed files with 655 additions and 1237 deletions
|
@ -169,7 +169,7 @@ public final class CxxAstUtils {
|
||||||
* For any BinaryExpression, guess the type from the other operand. (A good
|
* For any BinaryExpression, guess the type from the other operand. (A good
|
||||||
* guess for =, ==; hard to get a better guess for others)
|
* guess for =, ==; hard to get a better guess for others)
|
||||||
*
|
*
|
||||||
* @return inferred type or {@code null} if couldn't infer
|
* @return inferred type or null if couldn't infer
|
||||||
*/
|
*/
|
||||||
private static IType tryInferTypeFromBinaryExpr(IASTName astName) {
|
private static IType tryInferTypeFromBinaryExpr(IASTName astName) {
|
||||||
if (astName.getParent() instanceof IASTIdExpression && astName.getParent().getParent() instanceof IASTBinaryExpression) {
|
if (astName.getParent() instanceof IASTIdExpression && astName.getParent().getParent() instanceof IASTBinaryExpression) {
|
||||||
|
@ -188,8 +188,9 @@ public final class CxxAstUtils {
|
||||||
* For a function call, tries to find a matching function declaration.
|
* For a function call, tries to find a matching function declaration.
|
||||||
* Checks the argument count.
|
* Checks the argument count.
|
||||||
*
|
*
|
||||||
* @param index the index
|
* @param index
|
||||||
* @return a generated declaration or {@code null} if not suitable
|
*
|
||||||
|
* @return a generated declaration or null if not suitable
|
||||||
*/
|
*/
|
||||||
private static IASTSimpleDeclaration tryInferTypeFromFunctionCall(IASTName astName, INodeFactory factory, IIndex index) {
|
private static IASTSimpleDeclaration tryInferTypeFromFunctionCall(IASTName astName, INodeFactory factory, IIndex index) {
|
||||||
if (astName.getParent() instanceof IASTIdExpression && astName.getParent().getParent() instanceof IASTFunctionCallExpression
|
if (astName.getParent() instanceof IASTIdExpression && astName.getParent().getParent() instanceof IASTFunctionCallExpression
|
||||||
|
@ -302,11 +303,13 @@ public final class CxxAstUtils {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If the function definition belongs to a class, returns the class.
|
* If the function definition belongs to a class, returns the class.
|
||||||
* Otherwise, returns {@code null}.
|
* Otherwise, returns null.
|
||||||
*
|
*
|
||||||
* @param function the function definition to check
|
* @param function
|
||||||
* @param index the index to use for name lookup
|
* the function definition to check
|
||||||
* @return either a type specifier or {@code null}
|
* @param index
|
||||||
|
* the index to use for name lookup
|
||||||
|
* @return Either a type specifier or null
|
||||||
*/
|
*/
|
||||||
public static IASTCompositeTypeSpecifier getCompositeTypeFromFunction(final IASTFunctionDefinition function, final IIndex index) {
|
public static IASTCompositeTypeSpecifier getCompositeTypeFromFunction(final IASTFunctionDefinition function, final IIndex index) {
|
||||||
// Return value to be set via visitor.
|
// Return value to be set via visitor.
|
||||||
|
@ -368,19 +371,19 @@ public final class CxxAstUtils {
|
||||||
return returnSpecifier[0];
|
return returnSpecifier[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isThrowStatement(IASTNode statement) {
|
public static boolean isThrowStatement(IASTNode body) {
|
||||||
if (!(statement instanceof IASTExpressionStatement))
|
if (!(body instanceof IASTExpressionStatement))
|
||||||
return false;
|
return false;
|
||||||
IASTExpression expression = ((IASTExpressionStatement) statement).getExpression();
|
IASTExpression expression = ((IASTExpressionStatement) body).getExpression();
|
||||||
if (!(expression instanceof IASTUnaryExpression))
|
if (!(expression instanceof IASTUnaryExpression))
|
||||||
return false;
|
return false;
|
||||||
return ((IASTUnaryExpression) expression).getOperator() == IASTUnaryExpression.op_throw;
|
return ((IASTUnaryExpression) expression).getOperator() == IASTUnaryExpression.op_throw;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isExitStatement(IASTNode statement) {
|
public static boolean isExitStatement(IASTNode body) {
|
||||||
if (!(statement instanceof IASTExpressionStatement))
|
if (!(body instanceof IASTExpressionStatement))
|
||||||
return false;
|
return false;
|
||||||
IASTExpression expression = ((IASTExpressionStatement) statement).getExpression();
|
IASTExpression expression = ((IASTExpressionStatement) body).getExpression();
|
||||||
if (!(expression instanceof IASTFunctionCallExpression))
|
if (!(expression instanceof IASTFunctionCallExpression))
|
||||||
return false;
|
return false;
|
||||||
IASTExpression functionNameExpression = ((IASTFunctionCallExpression) expression).getFunctionNameExpression();
|
IASTExpression functionNameExpression = ((IASTFunctionCallExpression) expression).getFunctionNameExpression();
|
||||||
|
|
|
@ -6,14 +6,14 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Alena Laskavaia - initial API and implementation
|
* Alena Laskavaia - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.codan.core.model;
|
package org.eclipse.cdt.codan.core.model;
|
||||||
|
|
||||||
import org.eclipse.core.resources.IResource;
|
import org.eclipse.core.resources.IResource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface to describe problem location. Usually contains file and line number,
|
* Interface to describe problem location. Usually contains file and linenumber,
|
||||||
* also supports character positions for sophisticated errors.
|
* also supports character positions for sophisticated errors.
|
||||||
*
|
*
|
||||||
* @noextend This interface is not intended to be extended by clients.
|
* @noextend This interface is not intended to be extended by clients.
|
||||||
|
@ -22,7 +22,7 @@ import org.eclipse.core.resources.IResource;
|
||||||
public interface IProblemLocation {
|
public interface IProblemLocation {
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return the file where the problem occurred
|
* @return File for the problem - absolute full paths
|
||||||
*/
|
*/
|
||||||
IResource getFile();
|
IResource getFile();
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ public interface IProblemLocation {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return extra data for the problem location, checker specific, can be
|
* @return extra data for problem location, checker specific, can be
|
||||||
* backtrace for example
|
* backtrace for example
|
||||||
*/
|
*/
|
||||||
Object getData();
|
Object getData();
|
||||||
|
|
|
@ -80,7 +80,6 @@ org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
|
||||||
org.eclipse.jdt.core.compiler.source=1.7
|
org.eclipse.jdt.core.compiler.source=1.7
|
||||||
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
|
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_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_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_explicit_constructor_call=16
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
|
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
|
||||||
|
@ -88,21 +87,18 @@ 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_assignment=0
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
|
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_compact_if=16
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
|
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=16
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
|
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_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_multiple_fields=16
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=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_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_selector_in_method_invocation=16
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=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_enum_declaration=16
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_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_constructor_declaration=16
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_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_imports=1
|
||||||
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
|
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
|
||||||
org.eclipse.jdt.core.formatter.blank_lines_before_field=0
|
org.eclipse.jdt.core.formatter.blank_lines_before_field=0
|
||||||
|
@ -122,7 +118,6 @@ 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_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_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_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_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_switch=end_of_line
|
||||||
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
|
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
|
||||||
|
@ -138,17 +133,11 @@ 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.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_before_root_tags=insert
|
||||||
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
|
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
|
||||||
org.eclipse.jdt.core.formatter.comment.line_length=80
|
org.eclipse.jdt.core.formatter.comment.line_length=110
|
||||||
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.compact_else_if=true
|
||||||
org.eclipse.jdt.core.formatter.continuation_indentation=2
|
org.eclipse.jdt.core.formatter.continuation_indentation=2
|
||||||
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=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_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_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_constant_header=true
|
||||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
|
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
|
||||||
|
@ -166,9 +155,7 @@ 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_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_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_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_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_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_catch_in_try_statement=do not insert
|
||||||
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
|
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
|
||||||
|
@ -216,7 +203,6 @@ 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_arguments=insert
|
||||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=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_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_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_arguments=do not insert
|
||||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
|
||||||
|
@ -235,14 +221,12 @@ 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_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_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_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_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_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_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_conditional=insert
|
||||||
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not 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_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_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_and_in_type_parameter=insert
|
||||||
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
|
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
|
||||||
|
@ -266,7 +250,6 @@ 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_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_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_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_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_assert=insert
|
||||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
|
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
|
||||||
|
@ -294,7 +277,6 @@ 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_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_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_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_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_arguments=do not insert
|
||||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
|
||||||
|
@ -323,7 +305,6 @@ 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_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_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_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_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_return=insert
|
||||||
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
|
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
|
||||||
|
@ -333,7 +314,6 @@ 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_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=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_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_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_brackets_in_array_type_reference=do not insert
|
||||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
|
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
|
||||||
|
@ -349,7 +329,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_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_imple_if_on_one_line=false
|
||||||
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
|
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
|
||||||
org.eclipse.jdt.core.formatter.lineSplit=110
|
org.eclipse.jdt.core.formatter.lineSplit=100
|
||||||
org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
|
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.never_indent_line_comments_on_first_column=false
|
||||||
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
|
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
|
||||||
|
@ -357,8 +337,5 @@ 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.put_empty_statement_on_new_line=true
|
||||||
org.eclipse.jdt.core.formatter.tabulation.char=tab
|
org.eclipse.jdt.core.formatter.tabulation.char=tab
|
||||||
org.eclipse.jdt.core.formatter.tabulation.size=4
|
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.use_tabs_only_for_leading_indentations=false
|
||||||
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
|
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,4 +1,5 @@
|
||||||
|
#Wed Jan 28 12:19:26 CET 2009
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
formatter_profile=_CDT
|
formatter_profile=_CDT
|
||||||
formatter_settings_version=12
|
formatter_settings_version=11
|
||||||
internal.default.compliance=user
|
internal.default.compliance=user
|
||||||
|
|
|
@ -18,11 +18,11 @@ import java.util.Arrays;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import junit.framework.Assert;
|
||||||
import junit.framework.AssertionFailedError;
|
import junit.framework.AssertionFailedError;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
||||||
import org.junit.Assert;
|
|
||||||
|
|
||||||
public class ASTComparer extends Assert {
|
public class ASTComparer extends Assert {
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2009, 2015 IBM Corporation and others.
|
* Copyright (c) 2009, 2013 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -13,12 +13,8 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.core.parser.tests.ast2;
|
package org.eclipse.cdt.core.parser.tests.ast2;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import junit.framework.TestSuite;
|
import junit.framework.TestSuite;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorName;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorNameOwner;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitName;
|
import org.eclipse.cdt.core.dom.ast.IASTImplicitName;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitNameOwner;
|
import org.eclipse.cdt.core.dom.ast.IASTImplicitNameOwner;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTNodeSelector;
|
import org.eclipse.cdt.core.dom.ast.IASTNodeSelector;
|
||||||
|
@ -29,11 +25,9 @@ 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.ICPPMethod;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateInstance;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateInstance;
|
||||||
import org.eclipse.cdt.core.parser.ParserLanguage;
|
import org.eclipse.cdt.core.parser.ParserLanguage;
|
||||||
import org.eclipse.cdt.internal.core.parser.ParserException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for classes implementing {@link IASTImplicitNameOwner} and {@link IASTImplicitDestructorNameOwner}
|
* Tests for classes implementing IASTImplicitNameOwner interface.
|
||||||
* interfaces.
|
|
||||||
*/
|
*/
|
||||||
public class AST2CPPImplicitNameTests extends AST2TestBase {
|
public class AST2CPPImplicitNameTests extends AST2TestBase {
|
||||||
|
|
||||||
|
@ -48,12 +42,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
||||||
return suite(AST2CPPImplicitNameTests.class);
|
return suite(AST2CPPImplicitNameTests.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected BindingAssertionHelper getAssertionHelper() throws ParserException, IOException {
|
public IASTImplicitName[] getImplicitNames(IASTTranslationUnit tu, String contents, String section, int len) {
|
||||||
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);
|
final int offset = contents.indexOf(section);
|
||||||
assertTrue(offset >= 0);
|
assertTrue(offset >= 0);
|
||||||
IASTNodeSelector selector = tu.getNodeSelector(null);
|
IASTNodeSelector selector = tu.getNodeSelector(null);
|
||||||
|
@ -63,25 +52,6 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
||||||
return implicits;
|
return implicits;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected IASTImplicitDestructorName[] getImplicitDestructorNames(IASTTranslationUnit tu, String contents,
|
|
||||||
String section) {
|
|
||||||
return getImplicitDestructorNames(tu, contents, section, section.length());
|
|
||||||
}
|
|
||||||
|
|
||||||
protected IASTImplicitDestructorName[] getImplicitDestructorNames(IASTTranslationUnit tu, String contents,
|
|
||||||
String section, int len) {
|
|
||||||
final int offset = contents.indexOf(section);
|
|
||||||
assertTrue(offset >= 0);
|
|
||||||
IASTNodeSelector selector = tu.getNodeSelector(null);
|
|
||||||
IASTImplicitName firstImplicit = selector.findImplicitName(offset, len);
|
|
||||||
if (firstImplicit instanceof IASTImplicitDestructorName) {
|
|
||||||
IASTImplicitDestructorNameOwner owner = (IASTImplicitDestructorNameOwner) firstImplicit.getParent();
|
|
||||||
IASTImplicitDestructorName[] implicits = owner.getImplicitDestructorNames();
|
|
||||||
return implicits;
|
|
||||||
}
|
|
||||||
return IASTImplicitDestructorName.EMPTY_NAME_ARRAY;
|
|
||||||
}
|
|
||||||
|
|
||||||
// class point {
|
// class point {
|
||||||
// int x, y;
|
// int x, y;
|
||||||
// public:
|
// public:
|
||||||
|
@ -101,7 +71,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
||||||
// +p;
|
// +p;
|
||||||
// }
|
// }
|
||||||
public void testBinaryExpressions() throws Exception {
|
public void testBinaryExpressions() throws Exception {
|
||||||
BindingAssertionHelper ba= getAssertionHelper();
|
BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true);
|
||||||
IASTTranslationUnit tu = ba.getTranslationUnit();
|
IASTTranslationUnit tu = ba.getTranslationUnit();
|
||||||
NameCollector col = new NameCollector();
|
NameCollector col = new NameCollector();
|
||||||
tu.accept(col);
|
tu.accept(col);
|
||||||
|
@ -145,7 +115,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
||||||
// *y; //2
|
// *y; //2
|
||||||
// }
|
// }
|
||||||
public void testPointerDereference() throws Exception {
|
public void testPointerDereference() throws Exception {
|
||||||
BindingAssertionHelper ba= getAssertionHelper();
|
BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true);
|
||||||
ba.assertImplicitName("*x;", 1, ICPPFunction.class);
|
ba.assertImplicitName("*x;", 1, ICPPFunction.class);
|
||||||
ba.assertNoImplicitName("*y; //2", 1);
|
ba.assertNoImplicitName("*y; //2", 1);
|
||||||
}
|
}
|
||||||
|
@ -163,7 +133,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
||||||
// X* px2 = &y; // overloaded
|
// X* px2 = &y; // overloaded
|
||||||
// }
|
// }
|
||||||
public void testPointerToMember() throws Exception {
|
public void testPointerToMember() throws Exception {
|
||||||
BindingAssertionHelper ba= getAssertionHelper();
|
BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true);
|
||||||
IASTTranslationUnit tu = ba.getTranslationUnit();
|
IASTTranslationUnit tu = ba.getTranslationUnit();
|
||||||
NameCollector col = new NameCollector();
|
NameCollector col = new NameCollector();
|
||||||
tu.accept(col);
|
tu.accept(col);
|
||||||
|
@ -224,7 +194,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
||||||
// (++p1).x; //2
|
// (++p1).x; //2
|
||||||
// }
|
// }
|
||||||
public void testUnaryPrefixAndPostfix() throws Exception {
|
public void testUnaryPrefixAndPostfix() throws Exception {
|
||||||
BindingAssertionHelper ba= getAssertionHelper();
|
BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true);
|
||||||
ba.assertImplicitName("++).x; //1", 2, ICPPFunction.class);
|
ba.assertImplicitName("++).x; //1", 2, ICPPFunction.class);
|
||||||
ba.assertImplicitName("++p1).x; //2", 2, ICPPMethod.class);
|
ba.assertImplicitName("++p1).x; //2", 2, ICPPMethod.class);
|
||||||
}
|
}
|
||||||
|
@ -250,7 +220,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
||||||
// test(a, b, c, d); // func
|
// test(a, b, c, d); // func
|
||||||
// }
|
// }
|
||||||
public void testCommaOperator1() throws Exception {
|
public void testCommaOperator1() throws Exception {
|
||||||
BindingAssertionHelper ba= getAssertionHelper();
|
BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true);
|
||||||
// expression lists are used in function calls but they should not resolve to the comma operator
|
// 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(", b, c, d); // func", 1);
|
||||||
ba.assertNoImplicitName(", c, d); // func", 1);
|
ba.assertNoImplicitName(", c, d); // func", 1);
|
||||||
|
@ -285,7 +255,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
||||||
// (a, b, c, d).ee; // expr
|
// (a, b, c, d).ee; // expr
|
||||||
// }
|
// }
|
||||||
public void testCommaOperator2() throws Exception {
|
public void testCommaOperator2() throws Exception {
|
||||||
BindingAssertionHelper ba = getAssertionHelper();
|
BindingAssertionHelper ba = new BindingAssertionHelper(getAboveComment(), true);
|
||||||
|
|
||||||
IASTImplicitName opAB = ba.assertImplicitName(", b, c, d", 1, ICPPMethod.class);
|
IASTImplicitName opAB = ba.assertImplicitName(", b, c, d", 1, ICPPMethod.class);
|
||||||
IASTImplicitName opCC = ba.assertImplicitName(", c, d", 1, ICPPFunction.class);
|
IASTImplicitName opCC = ba.assertImplicitName(", c, d", 1, ICPPFunction.class);
|
||||||
|
@ -316,7 +286,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
||||||
// x(1, 2); // 3
|
// x(1, 2); // 3
|
||||||
// }
|
// }
|
||||||
public void testFunctionCallOperator() throws Exception {
|
public void testFunctionCallOperator() throws Exception {
|
||||||
BindingAssertionHelper ba= getAssertionHelper();
|
BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true);
|
||||||
IASTTranslationUnit tu = ba.getTranslationUnit();
|
IASTTranslationUnit tu = ba.getTranslationUnit();
|
||||||
NameCollector col = new NameCollector();
|
NameCollector col = new NameCollector();
|
||||||
tu.accept(col);
|
tu.accept(col);
|
||||||
|
@ -357,7 +327,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
||||||
// b = a; // should not resolve
|
// b = a; // should not resolve
|
||||||
// }
|
// }
|
||||||
public void testCopyAssignmentOperator() throws Exception {
|
public void testCopyAssignmentOperator() throws Exception {
|
||||||
BindingAssertionHelper ba= getAssertionHelper();
|
BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true);
|
||||||
ba.assertNoImplicitName("= a;", 1);
|
ba.assertNoImplicitName("= a;", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -375,7 +345,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
||||||
// func(y[q]); //2
|
// func(y[q]); //2
|
||||||
// }
|
// }
|
||||||
public void testArraySubscript() throws Exception {
|
public void testArraySubscript() throws Exception {
|
||||||
BindingAssertionHelper ba= getAssertionHelper();
|
BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true);
|
||||||
IASTTranslationUnit tu = ba.getTranslationUnit();
|
IASTTranslationUnit tu = ba.getTranslationUnit();
|
||||||
NameCollector col = new NameCollector();
|
NameCollector col = new NameCollector();
|
||||||
tu.accept(col);
|
tu.accept(col);
|
||||||
|
@ -410,7 +380,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
||||||
// delete 1;
|
// delete 1;
|
||||||
// }
|
// }
|
||||||
public void testDelete() throws Exception {
|
public void testDelete() throws Exception {
|
||||||
BindingAssertionHelper ba= getAssertionHelper();
|
BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true);
|
||||||
IASTImplicitName[] names = ba.getImplicitNames("delete x;", 6);
|
IASTImplicitName[] names = ba.getImplicitNames("delete x;", 6);
|
||||||
assertEquals(2, names.length);
|
assertEquals(2, names.length);
|
||||||
IASTImplicitName destructor = names[0];
|
IASTImplicitName destructor = names[0];
|
||||||
|
@ -444,7 +414,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
||||||
// delete b;
|
// delete b;
|
||||||
// }
|
// }
|
||||||
public void testOverloadedDelete_Bug351547() throws Exception {
|
public void testOverloadedDelete_Bug351547() throws Exception {
|
||||||
BindingAssertionHelper bh= getAssertionHelper();
|
BindingAssertionHelper bh= new BindingAssertionHelper(getAboveComment(), true);
|
||||||
IBinding m= bh.assertNonProblem("operator delete(void * a)", 15);
|
IBinding m= bh.assertNonProblem("operator delete(void * a)", 15);
|
||||||
IBinding f= bh.assertNonProblem("operator delete(void * b)", 15);
|
IBinding f= bh.assertNonProblem("operator delete(void * b)", 15);
|
||||||
|
|
||||||
|
@ -471,7 +441,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
||||||
// B* b = new B;
|
// B* b = new B;
|
||||||
// }
|
// }
|
||||||
public void testOverloadedNew_Bug354585() throws Exception {
|
public void testOverloadedNew_Bug354585() throws Exception {
|
||||||
BindingAssertionHelper bh= getAssertionHelper();
|
BindingAssertionHelper bh= new BindingAssertionHelper(getAboveComment(), true);
|
||||||
IBinding m= bh.assertNonProblem("operator new(size_t a)", 12);
|
IBinding m= bh.assertNonProblem("operator new(size_t a)", 12);
|
||||||
IBinding f= bh.assertNonProblem("operator new(size_t b)", 12);
|
IBinding f= bh.assertNonProblem("operator new(size_t b)", 12);
|
||||||
|
|
||||||
|
@ -490,7 +460,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
||||||
// delete[] x;
|
// delete[] x;
|
||||||
// }
|
// }
|
||||||
public void testImplicitNewAndDelete() throws Exception {
|
public void testImplicitNewAndDelete() throws Exception {
|
||||||
BindingAssertionHelper ba = getAssertionHelper();
|
BindingAssertionHelper ba = new BindingAssertionHelper(getAboveComment(), true);
|
||||||
ba.assertNoImplicitName("new X", 3);
|
ba.assertNoImplicitName("new X", 3);
|
||||||
ba.assertNoImplicitName("delete[]", 6);
|
ba.assertNoImplicitName("delete[]", 6);
|
||||||
}
|
}
|
||||||
|
@ -509,7 +479,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
||||||
// int* p2 = new (5, 6) int[5];
|
// int* p2 = new (5, 6) int[5];
|
||||||
// }
|
// }
|
||||||
public void testNew() throws Exception {
|
public void testNew() throws Exception {
|
||||||
BindingAssertionHelper ba= getAssertionHelper();
|
BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true);
|
||||||
IASTImplicitName n1 = ba.assertImplicitName("new (nothrow) X", 3, ICPPFunction.class);
|
IASTImplicitName n1 = ba.assertImplicitName("new (nothrow) X", 3, ICPPFunction.class);
|
||||||
IASTImplicitName n2 = ba.assertImplicitName("new (nothrow) int", 3, ICPPFunction.class);
|
IASTImplicitName n2 = ba.assertImplicitName("new (nothrow) int", 3, ICPPFunction.class);
|
||||||
IASTImplicitName n3 = ba.assertImplicitName("new (5, 6) int", 3, ICPPFunction.class);
|
IASTImplicitName n3 = ba.assertImplicitName("new (5, 6) int", 3, ICPPFunction.class);
|
||||||
|
@ -527,7 +497,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
||||||
// throw;
|
// throw;
|
||||||
// }
|
// }
|
||||||
public void testEmptyThrow() throws Exception {
|
public void testEmptyThrow() throws Exception {
|
||||||
BindingAssertionHelper ba= getAssertionHelper();
|
BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true);
|
||||||
ba.assertNoImplicitName("throw;", 5);
|
ba.assertNoImplicitName("throw;", 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -556,7 +526,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
||||||
// };
|
// };
|
||||||
// B C::t = 1;
|
// B C::t = 1;
|
||||||
public void testConstructorCall() throws Exception {
|
public void testConstructorCall() throws Exception {
|
||||||
BindingAssertionHelper ba= getAssertionHelper();
|
BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true);
|
||||||
IASTTranslationUnit tu = ba.getTranslationUnit();
|
IASTTranslationUnit tu = ba.getTranslationUnit();
|
||||||
ICPPConstructor ctor0 = ba.assertNonProblem("A()", 1, ICPPConstructor.class);
|
ICPPConstructor ctor0 = ba.assertNonProblem("A()", 1, ICPPConstructor.class);
|
||||||
ICPPConstructor ctor1 = ba.assertNonProblem("A(int)", 1, ICPPConstructor.class);
|
ICPPConstructor ctor1 = ba.assertNonProblem("A(int)", 1, ICPPConstructor.class);
|
||||||
|
@ -593,21 +563,7 @@ public class AST2CPPImplicitNameTests extends AST2TestBase {
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
public void testBuiltinOperators_294543() throws Exception {
|
public void testBuiltinOperators_294543() throws Exception {
|
||||||
BindingAssertionHelper ba= getAssertionHelper();
|
BindingAssertionHelper ba= new BindingAssertionHelper(getAboveComment(), true);
|
||||||
IASTTranslationUnit tu = ba.getTranslationUnit();
|
|
||||||
ICPPFunction op = ba.assertNonProblem("operator==", 0);
|
|
||||||
IASTImplicitName a = ba.assertImplicitName("==b", 2, ICPPFunction.class);
|
|
||||||
assertSame(op, a.resolveBinding());
|
|
||||||
}
|
|
||||||
|
|
||||||
// struct A {
|
|
||||||
// ~A();
|
|
||||||
// int a;
|
|
||||||
// };
|
|
||||||
// int x = A().a;
|
|
||||||
public void testDestructor() throws Exception {
|
|
||||||
BindingAssertionHelper ba= getAssertionHelper();
|
|
||||||
XXX
|
|
||||||
IASTTranslationUnit tu = ba.getTranslationUnit();
|
IASTTranslationUnit tu = ba.getTranslationUnit();
|
||||||
ICPPFunction op = ba.assertNonProblem("operator==", 0);
|
ICPPFunction op = ba.assertNonProblem("operator==", 0);
|
||||||
IASTImplicitName a = ba.assertImplicitName("==b", 2, ICPPFunction.class);
|
IASTImplicitName a = ba.assertImplicitName("==b", 2, ICPPFunction.class);
|
||||||
|
|
|
@ -41,8 +41,6 @@ import org.eclipse.cdt.core.dom.ast.IASTExpressionStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTFunctionDeclarator;
|
import org.eclipse.cdt.core.dom.ast.IASTFunctionDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
|
import org.eclipse.cdt.core.dom.ast.IASTFunctionDefinition;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTIdExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTIdExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorName;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorNameOwner;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitName;
|
import org.eclipse.cdt.core.dom.ast.IASTImplicitName;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitNameOwner;
|
import org.eclipse.cdt.core.dom.ast.IASTImplicitNameOwner;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTInitializerClause;
|
import org.eclipse.cdt.core.dom.ast.IASTInitializerClause;
|
||||||
|
@ -675,16 +673,6 @@ public class AST2TestBase extends BaseTestCase {
|
||||||
return implicits;
|
return implicits;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IASTImplicitDestructorName[] getImplicitDestructotNames(String section, int len) {
|
|
||||||
final int offset = contents.indexOf(section);
|
|
||||||
assertTrue(offset >= 0);
|
|
||||||
IASTNodeSelector selector = tu.getNodeSelector(null);
|
|
||||||
IASTNode enclosingNode = selector.findStrictlyEnclosingNode(offset, len);
|
|
||||||
if (!(enclosingNode instanceof IASTImplicitDestructorNameOwner))
|
|
||||||
return IASTImplicitDestructorName.EMPTY_NAME_ARRAY;
|
|
||||||
return ((IASTImplicitDestructorNameOwner) enclosingNode).getImplicitDestructorNames();
|
|
||||||
}
|
|
||||||
|
|
||||||
public IASTName findName(String section, int len) {
|
public IASTName findName(String section, int len) {
|
||||||
final int offset = contents.indexOf(section);
|
final int offset = contents.indexOf(section);
|
||||||
assertTrue("Section \"" + section + "\" not found", offset >= 0);
|
assertTrue("Section \"" + section + "\" not found", offset >= 0);
|
||||||
|
@ -708,7 +696,7 @@ public class AST2TestBase extends BaseTestCase {
|
||||||
return findName(contents, name);
|
return findName(contents, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IASTImplicitName findImplicitName(String section, int len) {
|
public IASTName findImplicitName(String section, int len) {
|
||||||
final int offset = contents.indexOf(section);
|
final int offset = contents.indexOf(section);
|
||||||
assertTrue(offset >= 0);
|
assertTrue(offset >= 0);
|
||||||
IASTNodeSelector selector = tu.getNodeSelector(null);
|
IASTNodeSelector selector = tu.getNodeSelector(null);
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#Mon Oct 17 17:36:13 PDT 2011
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
||||||
|
@ -80,7 +81,6 @@ org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
|
||||||
org.eclipse.jdt.core.compiler.source=1.7
|
org.eclipse.jdt.core.compiler.source=1.7
|
||||||
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
|
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_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_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_explicit_constructor_call=16
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
|
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
|
||||||
|
@ -88,21 +88,18 @@ 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_assignment=0
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
|
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_compact_if=16
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
|
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=16
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
|
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_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_multiple_fields=16
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=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_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_selector_in_method_invocation=16
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=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_enum_declaration=16
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_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_constructor_declaration=16
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_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_imports=1
|
||||||
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
|
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
|
||||||
org.eclipse.jdt.core.formatter.blank_lines_before_field=0
|
org.eclipse.jdt.core.formatter.blank_lines_before_field=0
|
||||||
|
@ -122,7 +119,6 @@ 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_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_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_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_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_switch=end_of_line
|
||||||
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
|
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
|
||||||
|
@ -138,17 +134,11 @@ 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.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_before_root_tags=insert
|
||||||
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
|
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
|
||||||
org.eclipse.jdt.core.formatter.comment.line_length=80
|
org.eclipse.jdt.core.formatter.comment.line_length=110
|
||||||
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.compact_else_if=true
|
||||||
org.eclipse.jdt.core.formatter.continuation_indentation=2
|
org.eclipse.jdt.core.formatter.continuation_indentation=2
|
||||||
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=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_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_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_constant_header=true
|
||||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
|
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
|
||||||
|
@ -166,9 +156,7 @@ 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_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_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_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_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_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_catch_in_try_statement=do not insert
|
||||||
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
|
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
|
||||||
|
@ -216,7 +204,6 @@ 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_arguments=insert
|
||||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=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_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_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_arguments=do not insert
|
||||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
|
||||||
|
@ -235,14 +222,12 @@ 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_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_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_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_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_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_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_conditional=insert
|
||||||
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not 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_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_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_and_in_type_parameter=insert
|
||||||
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
|
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
|
||||||
|
@ -266,7 +251,6 @@ 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_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_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_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_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_assert=insert
|
||||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
|
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
|
||||||
|
@ -294,7 +278,6 @@ 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_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_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_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_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_arguments=do not insert
|
||||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
|
||||||
|
@ -323,7 +306,6 @@ 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_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_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_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_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_return=insert
|
||||||
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
|
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
|
||||||
|
@ -333,7 +315,6 @@ 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_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=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_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_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_brackets_in_array_type_reference=do not insert
|
||||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
|
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
|
||||||
|
@ -349,7 +330,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_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_imple_if_on_one_line=false
|
||||||
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
|
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
|
||||||
org.eclipse.jdt.core.formatter.lineSplit=110
|
org.eclipse.jdt.core.formatter.lineSplit=100
|
||||||
org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
|
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.never_indent_line_comments_on_first_column=false
|
||||||
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
|
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
|
||||||
|
@ -357,8 +338,5 @@ 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.put_empty_statement_on_new_line=true
|
||||||
org.eclipse.jdt.core.formatter.tabulation.char=tab
|
org.eclipse.jdt.core.formatter.tabulation.char=tab
|
||||||
org.eclipse.jdt.core.formatter.tabulation.size=4
|
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.use_tabs_only_for_leading_indentations=false
|
||||||
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
|
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,4 +1,5 @@
|
||||||
|
#Wed Jan 28 12:19:26 CET 2009
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
formatter_profile=_CDT
|
formatter_profile=_CDT
|
||||||
formatter_settings_version=12
|
formatter_settings_version=11
|
||||||
internal.default.compliance=user
|
internal.default.compliance=user
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
|
@ -22,11 +22,12 @@ import org.eclipse.core.runtime.Assert;
|
||||||
* @since 5.1
|
* @since 5.1
|
||||||
*/
|
*/
|
||||||
public final class ASTNameCollector extends ASTVisitor {
|
public final class ASTNameCollector extends ASTVisitor {
|
||||||
private final char[] fName;
|
|
||||||
private final ArrayList<IASTName> fFound= new ArrayList<>(4);
|
private char[] fName;
|
||||||
|
private ArrayList<IASTName> fFound= new ArrayList<IASTName>(4);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a name collector for the given name.
|
* Construct a name collector for the given name.
|
||||||
*/
|
*/
|
||||||
public ASTNameCollector(char[] name) {
|
public ASTNameCollector(char[] name) {
|
||||||
Assert.isNotNull(name);
|
Assert.isNotNull(name);
|
||||||
|
@ -35,7 +36,7 @@ public final class ASTNameCollector extends ASTVisitor {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a name collector for the given name.
|
* Construct a name collector for the given name.
|
||||||
*/
|
*/
|
||||||
public ASTNameCollector(String name) {
|
public ASTNameCollector(String name) {
|
||||||
this(name.toCharArray());
|
this(name.toCharArray());
|
||||||
|
@ -52,14 +53,14 @@ public final class ASTNameCollector extends ASTVisitor {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the array of matching names.
|
* Return the array of matching names.
|
||||||
*/
|
*/
|
||||||
public IASTName[] getNames() {
|
public IASTName[] getNames() {
|
||||||
return fFound.toArray(new IASTName[fFound.size()]);
|
return fFound.toArray(new IASTName[fFound.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clears the names found, such that the collector can be reused.
|
* Clear the names found, such that the collector can be reused.
|
||||||
*/
|
*/
|
||||||
public void clear() {
|
public void clear() {
|
||||||
fFound.clear();
|
fFound.clear();
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2015 IBM Corporation and others.
|
* Copyright (c) 2004, 2012 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -172,8 +172,6 @@ public abstract class ASTVisitor {
|
||||||
* Implicit names are created to allow implicit bindings to be resolved,
|
* Implicit names are created to allow implicit bindings to be resolved,
|
||||||
* normally they are not visited, set this flag to true to visit them.
|
* normally they are not visited, set this flag to true to visit them.
|
||||||
* @since 5.1
|
* @since 5.1
|
||||||
* @see #visit(IASTName)
|
|
||||||
* @see IASTImplicitName
|
|
||||||
*/
|
*/
|
||||||
public boolean shouldVisitImplicitNames = false;
|
public boolean shouldVisitImplicitNames = false;
|
||||||
|
|
||||||
|
@ -181,21 +179,9 @@ public abstract class ASTVisitor {
|
||||||
* Sometimes more than one implicit name is created for a binding,
|
* 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.
|
* set this flag to true to visit more than one name for an implicit binding.
|
||||||
* @since 5.1
|
* @since 5.1
|
||||||
* @see #visit(IASTName)
|
|
||||||
* @see IASTImplicitName
|
|
||||||
*/
|
*/
|
||||||
public boolean shouldVisitImplicitNameAlternates = false;
|
public boolean shouldVisitImplicitNameAlternates = false;
|
||||||
|
|
||||||
/**
|
|
||||||
* Implicit destructor names are created to mark code locations where destructors of temporaries and
|
|
||||||
* variables going out of scope are called, normally they are not visited, set this flag to true to visit
|
|
||||||
* them.
|
|
||||||
* @since 5.11
|
|
||||||
* @see #visit(IASTName)
|
|
||||||
* @see IASTImplicitDestructorName
|
|
||||||
*/
|
|
||||||
public boolean shouldVisitImplicitDestructorNames = false;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a visitor that does not visit any kind of node per default.
|
* Creates a visitor that does not visit any kind of node per default.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -18,30 +18,33 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
*/
|
*/
|
||||||
public interface IASTCompoundStatement extends IASTStatement {
|
public interface IASTCompoundStatement extends IASTStatement {
|
||||||
/**
|
/**
|
||||||
* {@code NESTED_STATEMENT} represents the relationship between an {@code IASTCompoundStatement}
|
* <code>NESTED_STATEMENT</code> represents the relationship between an
|
||||||
* and its nested {@code IASTStatement}
|
* <code>IASTCompoundStatement</code> and its nested
|
||||||
|
* <code>IASTStatement</code>
|
||||||
*/
|
*/
|
||||||
public static final ASTNodeProperty NESTED_STATEMENT = new ASTNodeProperty(
|
public static final ASTNodeProperty NESTED_STATEMENT = new ASTNodeProperty(
|
||||||
"IASTCompoundStatement.NESTED_STATEMENT - nested IASTStatement for IASTCompoundStatement"); //$NON-NLS-1$
|
"IASTCompoundStatement.NESTED_STATEMENT - nested IASTStatement for IASTCompoundStatement"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the statements in this block.
|
* Gets the statements in this block.
|
||||||
*
|
*
|
||||||
* @return Array of IASTStatement
|
* @return Array of IASTStatement
|
||||||
*/
|
*/
|
||||||
public IASTStatement[] getStatements();
|
public IASTStatement[] getStatements();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds a statement to the compound block.
|
* Add a statement to the compound block.
|
||||||
*
|
*
|
||||||
* @param statement the statement to be added
|
* @param statement
|
||||||
|
* statement to be added
|
||||||
*/
|
*/
|
||||||
public void addStatement(IASTStatement statement);
|
public void addStatement(IASTStatement statement);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns {@code IScope} node that this node eludes to in the logical tree.
|
* Get <code>IScope</code> node that this node eludes to in the logical
|
||||||
|
* tree.
|
||||||
*
|
*
|
||||||
* @return the {@code IScope}
|
* @return the <code>IScope</code>
|
||||||
*/
|
*/
|
||||||
public IScope getScope();
|
public IScope getScope();
|
||||||
|
|
||||||
|
|
|
@ -18,32 +18,33 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
*/
|
*/
|
||||||
public interface IASTDoStatement extends IASTStatement {
|
public interface IASTDoStatement extends IASTStatement {
|
||||||
/**
|
/**
|
||||||
* {@code BODY} represents the relationship between a
|
* <code>BODY</code> represents the relationship between a
|
||||||
* {@code IASTDoStatement} and its nested body
|
* <code>IASTDoStatement</code> and its nested body
|
||||||
* {@code IASTStatement}.
|
* <code>IASTStatement</code>.
|
||||||
*/
|
*/
|
||||||
public static final ASTNodeProperty BODY =
|
public static final ASTNodeProperty BODY =
|
||||||
new ASTNodeProperty("IASTDoStatement.BODY - nested body for IASTDoStatement"); //$NON-NLS-1$
|
new ASTNodeProperty("IASTDoStatement.BODY - nested body for IASTDoStatement"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@code CONDITION} represents the relationship between a
|
* <code>CONDITION</code> represents the relationship between a
|
||||||
* {@code IASTDoStatement} and its condition
|
* <code>IASTDoStatement</code> and its condition
|
||||||
* {@code IASTExpression}.
|
* <code>IASTExpression</code>.
|
||||||
*/
|
*/
|
||||||
public static final ASTNodeProperty CONDITION = new ASTNodeProperty(
|
public static final ASTNodeProperty CONDITION = new ASTNodeProperty(
|
||||||
"IASTDoStatement.CONDITION - IASTExpression condition for IASTDoStatement"); //$NON-NLS-1$
|
"IASTDoStatement.CONDITION - IASTExpression condition for IASTDoStatement"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the body of the loop.
|
* Get the body of the loop.
|
||||||
*
|
*
|
||||||
* @return {@code IASTStatement} loop code body
|
* @return <code>IASTStatement</code> loop code body
|
||||||
*/
|
*/
|
||||||
public IASTStatement getBody();
|
public IASTStatement getBody();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the body of the loop.
|
* Set the body of the loop.
|
||||||
*
|
*
|
||||||
* @param body an {@code IASTStatement}
|
* @param body
|
||||||
|
* an <code>IASTStatement</code>
|
||||||
*/
|
*/
|
||||||
public void setBody(IASTStatement body);
|
public void setBody(IASTStatement body);
|
||||||
|
|
||||||
|
@ -55,9 +56,10 @@ public interface IASTDoStatement extends IASTStatement {
|
||||||
public IASTExpression getCondition();
|
public IASTExpression getCondition();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the condition for the loop.
|
* Set the condition for the loop.
|
||||||
*
|
*
|
||||||
* @param condition an {@code IASTExpression}
|
* @param condition
|
||||||
|
* an IASTExpression
|
||||||
*/
|
*/
|
||||||
public void setCondition(IASTExpression condition);
|
public void setCondition(IASTExpression condition);
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
package org.eclipse.cdt.core.dom.ast;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Expression list (comma separated list of expressions).
|
* Expression List (Comma separated list of expressions).
|
||||||
*
|
*
|
||||||
* @noextend This interface is not intended to be extended by clients.
|
* @noextend This interface is not intended to be extended by clients.
|
||||||
* @noimplement This interface is not intended to be implemented by clients.
|
* @noimplement This interface is not intended to be implemented by clients.
|
||||||
|
@ -26,16 +26,17 @@ public interface IASTExpressionList extends IASTExpression {
|
||||||
"IASTExpressionList.NESTED_EXPRESSION - Nested IASTExpression for IASTExpressionList"); //$NON-NLS-1$
|
"IASTExpressionList.NESTED_EXPRESSION - Nested IASTExpression for IASTExpressionList"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns nested expressions.
|
* Get nested expressions.
|
||||||
*
|
*
|
||||||
* @return an array of nested expressions
|
* @return <code>IASTExpression[] </code> nested expressions
|
||||||
*/
|
*/
|
||||||
public IASTExpression[] getExpressions();
|
public IASTExpression[] getExpressions();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds nested expression.
|
* Add nested expression.
|
||||||
*
|
*
|
||||||
* @param expression the expression to be added.
|
* @param expression
|
||||||
|
* <code>IASTExpression</code> value to be added.
|
||||||
*/
|
*/
|
||||||
public void addExpression(IASTExpression expression);
|
public void addExpression(IASTExpression expression);
|
||||||
|
|
||||||
|
|
|
@ -19,89 +19,96 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
*/
|
*/
|
||||||
public interface IASTForStatement extends IASTStatement {
|
public interface IASTForStatement extends IASTStatement {
|
||||||
/**
|
/**
|
||||||
* {@code CONDITION} represents the relationship between a {@code IASTForStatement} and
|
* <code>CONDITION</code> represents the relationship between a
|
||||||
* its {@code IASTExpression} condition.
|
* <code>IASTForStatement</code> and its <code>IASTExpression</code>
|
||||||
|
* condition.
|
||||||
*/
|
*/
|
||||||
public static final ASTNodeProperty CONDITION = new ASTNodeProperty(
|
public static final ASTNodeProperty CONDITION = new ASTNodeProperty(
|
||||||
"IASTForStatement.CONDITION - IASTExpression condition of IASTForStatement"); //$NON-NLS-1$
|
"IASTForStatement.CONDITION - IASTExpression condition of IASTForStatement"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@code ITERATION} represents the relationship between a {@code IASTForStatement} and
|
* <code>ITERATION</code> represents the relationship between a
|
||||||
* its {@code IASTExpression} iteration expression.
|
* <code>IASTForStatement</code> and its <code>IASTExpression</code>
|
||||||
|
* iteration expression.
|
||||||
*/
|
*/
|
||||||
public static final ASTNodeProperty ITERATION = new ASTNodeProperty(
|
public static final ASTNodeProperty ITERATION = new ASTNodeProperty(
|
||||||
"IASTForStatement.ITERATION - IASTExpression iteration of IASTForStatement"); //$NON-NLS-1$
|
"IASTForStatement.ITERATION - IASTExpression iteration of IASTForStatement"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@code BODY} represents the relationship between a {@code IASTForStatement} and
|
* <code>BODY</code> represents the relationship between a
|
||||||
* its {@code IASTStatement} body.
|
* <code>IASTForStatement</code> and its <code>IASTStatement</code>
|
||||||
|
* body.
|
||||||
*/
|
*/
|
||||||
public static final ASTNodeProperty BODY = new ASTNodeProperty(
|
public static final ASTNodeProperty BODY = new ASTNodeProperty(
|
||||||
"IASTForStatement.BODY - IASTStatement body of IASTForStatement"); //$NON-NLS-1$
|
"IASTForStatement.BODY - IASTStatement body of IASTForStatement"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@code INITIALIZER} represents the relationship between a {@code IASTForStatement} and
|
* <code>INITIALIZER</code> represents the relationship between a
|
||||||
* its {@code IASTDeclaration} initializer.
|
* <code>IASTForStatement</code> and its <code>IASTDeclaration</code>
|
||||||
|
* initializer.
|
||||||
*/
|
*/
|
||||||
public static final ASTNodeProperty INITIALIZER = new ASTNodeProperty(
|
public static final ASTNodeProperty INITIALIZER = new ASTNodeProperty(
|
||||||
"IASTForStatement.INITIALIZER - initializer for IASTForStatement"); //$NON-NLS-1$
|
"IASTForStatement.INITIALIZER - initializer for IASTForStatement"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the initializer statement.
|
|
||||||
*/
|
|
||||||
public IASTStatement getInitializerStatement();
|
public IASTStatement getInitializerStatement();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param statement
|
* @param statement
|
||||||
*/
|
*/
|
||||||
public void setInitializerStatement(IASTStatement statement);
|
public void setInitializerStatement( IASTStatement statement );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the condition expression for the loop.
|
* Get the condition expression for the loop.
|
||||||
*
|
*
|
||||||
* @return {@code IASTExpression}
|
* @return <code>IASTExpression</code>
|
||||||
*/
|
*/
|
||||||
public IASTExpression getConditionExpression();
|
public IASTExpression getConditionExpression();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the condition expression for the loop.
|
* Set the condition expression for the loop.
|
||||||
*
|
*
|
||||||
* @param condition {@code IASTExpression}
|
* @param condition
|
||||||
|
* <code>IASTExpression</code>
|
||||||
*/
|
*/
|
||||||
public void setConditionExpression(IASTExpression condition);
|
public void setConditionExpression(IASTExpression condition);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the expression that is evaluated after the completion of an iteration of the loop.
|
* Get the expression that is evaluated after the completion of an iteration
|
||||||
|
* of the loop.
|
||||||
*
|
*
|
||||||
* @return {@code IASTExpression}
|
* @return <code>IASTExpression</code>
|
||||||
*/
|
*/
|
||||||
public IASTExpression getIterationExpression();
|
public IASTExpression getIterationExpression();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the expression that is evaluated after the completion of an iteration of the loop.
|
* Set the expression that is evaluated after the completion of an iteration
|
||||||
|
* of the loop.
|
||||||
*
|
*
|
||||||
* @param iterator {@code IASTExpression}
|
* @param iterator
|
||||||
|
* <code>IASTExpression</code>
|
||||||
*/
|
*/
|
||||||
public void setIterationExpression(IASTExpression iterator);
|
public void setIterationExpression(IASTExpression iterator);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the statements that this for loop controls.
|
* Get the statements that this for loop controls.
|
||||||
*
|
*
|
||||||
* @return {@code IASTStatement}
|
* @return <code>IASTStatement</code>
|
||||||
*/
|
*/
|
||||||
public IASTStatement getBody();
|
public IASTStatement getBody();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the body of the for loop.
|
* Set the body of the for loop.
|
||||||
*
|
*
|
||||||
* @param statement {@code IASTStatement}
|
* @param statement
|
||||||
|
* <code>IASTStatement</code>
|
||||||
*/
|
*/
|
||||||
public void setBody(IASTStatement statement);
|
public void setBody(IASTStatement statement);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the {@code IScope} represented by this for loop.
|
* Get the <code>IScope</code> represented by this for loop.
|
||||||
*
|
*
|
||||||
* @return {@code IScope}
|
* @return <code>IScope</code>
|
||||||
*/
|
*/
|
||||||
public IScope getScope();
|
public IScope getScope();
|
||||||
|
|
||||||
|
|
|
@ -18,24 +18,24 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
*/
|
*/
|
||||||
public interface IASTFunctionDefinition extends IASTDeclaration {
|
public interface IASTFunctionDefinition extends IASTDeclaration {
|
||||||
/**
|
/**
|
||||||
* {@code DECL_SPECIFIER} represents the relationship between a
|
* <code>DECL_SPECIFIER</code> represents the relationship between a
|
||||||
* {@code IASTFunctionDefinition} and its
|
* <code>IASTFunctionDefinition</code> and its
|
||||||
* {@code IASTDeclSpecifier}.
|
* <code>IASTDeclSpecifier</code>.
|
||||||
*/
|
*/
|
||||||
public static final ASTNodeProperty DECL_SPECIFIER = new ASTNodeProperty(
|
public static final ASTNodeProperty DECL_SPECIFIER = new ASTNodeProperty(
|
||||||
"IASTFunctionDefinition.DECL_SPECIFIER - IASTDeclSpecifier for IASTFunctionDefinition"); //$NON-NLS-1$
|
"IASTFunctionDefinition.DECL_SPECIFIER - IASTDeclSpecifier for IASTFunctionDefinition"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@code DECLARATOR} represents the relationship between a
|
* <code>DECLARATOR</code> represents the relationship between a
|
||||||
* {@code IASTFunctionDefinition} and its
|
* <code>IASTFunctionDefinition</code> and its
|
||||||
* {@code IASTFunctionDeclarator}.
|
* <code>IASTFunctionDeclarator</code>.
|
||||||
*/
|
*/
|
||||||
public static final ASTNodeProperty DECLARATOR = new ASTNodeProperty(
|
public static final ASTNodeProperty DECLARATOR = new ASTNodeProperty(
|
||||||
"IASTFunctionDefinition.DECLARATOR - IASTFunctionDeclarator for IASTFunctionDefinition"); //$NON-NLS-1$
|
"IASTFunctionDefinition.DECLARATOR - IASTFunctionDeclarator for IASTFunctionDefinition"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@code FUNCTION_BODY} represents the relationship between a
|
* <code>FUNCTION_BODY</code> represents the relationship between a
|
||||||
* {@code IASTFunctionDefinition} and its {@code IASTStatement}.
|
* <code>IASTFunctionDefinition</code> and its <code>IASTStatement</code>.
|
||||||
*/
|
*/
|
||||||
public static final ASTNodeProperty FUNCTION_BODY = new ASTNodeProperty(
|
public static final ASTNodeProperty FUNCTION_BODY = new ASTNodeProperty(
|
||||||
"IASTFunctionDefinition.FUNCTION_BODY - Function Body for IASTFunctionDefinition"); //$NON-NLS-1$
|
"IASTFunctionDefinition.FUNCTION_BODY - Function Body for IASTFunctionDefinition"); //$NON-NLS-1$
|
||||||
|
@ -73,7 +73,6 @@ public interface IASTFunctionDefinition extends IASTDeclaration {
|
||||||
* void (f)(int a); // has nested declarator
|
* void (f)(int a); // has nested declarator
|
||||||
* void (f(int a)); // is nested in another declarator
|
* void (f(int a)); // is nested in another declarator
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
|
||||||
* @param declarator
|
* @param declarator
|
||||||
*/
|
*/
|
||||||
public void setDeclarator(IASTFunctionDeclarator declarator);
|
public void setDeclarator(IASTFunctionDeclarator declarator);
|
||||||
|
@ -81,6 +80,7 @@ public interface IASTFunctionDefinition extends IASTDeclaration {
|
||||||
/**
|
/**
|
||||||
* Returns the body of the function. This is usually a compound statement but
|
* Returns the body of the function. This is usually a compound statement but
|
||||||
* C++ also has a function try block.
|
* C++ also has a function try block.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
public IASTStatement getBody();
|
public IASTStatement getBody();
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ public interface IASTFunctionDefinition extends IASTDeclaration {
|
||||||
/**
|
/**
|
||||||
* Get the logical IScope that the function definition body represents.
|
* Get the logical IScope that the function definition body represents.
|
||||||
*
|
*
|
||||||
* @return {@code IScope} representing function body.
|
* @return <code>IScope</code> representing function body.
|
||||||
*/
|
*/
|
||||||
public IScope getScope();
|
public IScope getScope();
|
||||||
|
|
||||||
|
|
|
@ -18,22 +18,22 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
*/
|
*/
|
||||||
public interface IASTIfStatement extends IASTStatement {
|
public interface IASTIfStatement extends IASTStatement {
|
||||||
/**
|
/**
|
||||||
* {@code CONDITION} represents the relationship between an
|
* <code>CONDITION</code> represents the relationship between an
|
||||||
* {@code IASTIfStatement} and its nested {@code IASTExpression}.
|
* <code>IASTIfStatement</code> and its nested <code>IASTExpression</code>.
|
||||||
*/
|
*/
|
||||||
public static final ASTNodeProperty CONDITION = new ASTNodeProperty(
|
public static final ASTNodeProperty CONDITION = new ASTNodeProperty(
|
||||||
"IASTIfStatement.CONDITION - IASTExpression condition for IASTIfStatement"); //$NON-NLS-1$
|
"IASTIfStatement.CONDITION - IASTExpression condition for IASTIfStatement"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@code THEN} represents the relationship between an
|
* <code>THEN</code> represents the relationship between an
|
||||||
* {@code IASTIfStatement} and its nested {@code IASTStatement}
|
* <code>IASTIfStatement</code> and its nested <code>IASTStatement</code>
|
||||||
* (then).
|
* (then).
|
||||||
*/
|
*/
|
||||||
public static final ASTNodeProperty THEN = new ASTNodeProperty("IASTIfStatement.THEN - IASTStatement (then) for IASTIfStatement"); //$NON-NLS-1$
|
public static final ASTNodeProperty THEN = new ASTNodeProperty("IASTIfStatement.THEN - IASTStatement (then) for IASTIfStatement"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@code ELSE} represents the relationship between an
|
* <code>ELSE</code> represents the relationship between an
|
||||||
* {@code IASTIfStatement} and its nested {@code IASTStatement}
|
* <code>IASTIfStatement</code> and its nested <code>IASTStatement</code>
|
||||||
* (else).
|
* (else).
|
||||||
*/
|
*/
|
||||||
public static final ASTNodeProperty ELSE = new ASTNodeProperty("IASTIfStatement.ELSE - IASTStatement (else) for IASTIfStatement"); //$NON-NLS-1$
|
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.
|
* Returns the condition in the if statement.
|
||||||
*
|
*
|
||||||
* @return the condition {@code IASTExpression}. May return {@code null} if the 'if'
|
* @return the condition <code>IASTExpression</code>. May return <code>null</code> if the 'if'
|
||||||
* statement has condition declaration instead of condition expression
|
* statement has condition declaration instead of condition expression
|
||||||
* (see {@link org.eclipse.cdt.core.dom.ast.cpp.ICPPASTIfStatement}).
|
* (see {@link org.eclipse.cdt.core.dom.ast.cpp.ICPPASTIfStatement}).
|
||||||
*/
|
*/
|
||||||
|
@ -50,21 +50,23 @@ public interface IASTIfStatement extends IASTStatement {
|
||||||
/**
|
/**
|
||||||
* Sets the condition in the if statement.
|
* Sets the condition in the if statement.
|
||||||
*
|
*
|
||||||
* @param condition {@code IASTExpression}
|
* @param condition
|
||||||
|
* <code>IASTExpression</code>
|
||||||
*/
|
*/
|
||||||
public void setConditionExpression(IASTExpression condition);
|
public void setConditionExpression(IASTExpression condition);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the statement that is executed if the condition is true.
|
* Returns the statement that is executed if the condition is true.
|
||||||
*
|
*
|
||||||
* @return the then clause {@code IASTStatement}
|
* @return the then clause <code>IASTStatement</code>
|
||||||
*/
|
*/
|
||||||
public IASTStatement getThenClause();
|
public IASTStatement getThenClause();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the statement that is executed if the condition is true.
|
* Sets the statement that is executed if the condition is true.
|
||||||
*
|
*
|
||||||
* @param thenClause {@code IASTStatement}
|
* @param thenClause
|
||||||
|
* <code>IASTStatement</code>
|
||||||
*/
|
*/
|
||||||
public void setThenClause(IASTStatement thenClause);
|
public void setThenClause(IASTStatement thenClause);
|
||||||
|
|
||||||
|
@ -72,14 +74,15 @@ public interface IASTIfStatement extends IASTStatement {
|
||||||
* Returns the statement that is executed if the condition is false. This clause
|
* Returns the statement that is executed if the condition is false. This clause
|
||||||
* is optional and returns null if there is none.
|
* is optional and returns null if there is none.
|
||||||
*
|
*
|
||||||
* @return the else clause or {@code null} {@code IASTStatement}
|
* @return the else clause or null <code>IASTStatement</code>
|
||||||
*/
|
*/
|
||||||
public IASTStatement getElseClause();
|
public IASTStatement getElseClause();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the else clause.
|
* Sets the else clause.
|
||||||
*
|
*
|
||||||
* @param elseClause {@code IASTStatement}
|
* @param elseClause
|
||||||
|
* <code>IASTStatement</code>
|
||||||
*/
|
*/
|
||||||
public void setElseClause(IASTStatement elseClause);
|
public void setElseClause(IASTStatement elseClause);
|
||||||
|
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright (c) 2015 Google, Inc 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:
|
|
||||||
* Sergey Prigogin (Google) - initial API and implementation
|
|
||||||
*******************************************************************************/
|
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* An implicit name corresponding to a destructor call for a temporary or a variable going out of scope.
|
|
||||||
*
|
|
||||||
* @since 5.11
|
|
||||||
* @noextend This interface is not intended to be extended by clients.
|
|
||||||
* @noimplement This interface is not intended to be implemented by clients.
|
|
||||||
*/
|
|
||||||
public interface IASTImplicitDestructorName extends IASTImplicitName {
|
|
||||||
public static final IASTImplicitDestructorName[] EMPTY_NAME_ARRAY = {};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the name corresponding to the constructor call.
|
|
||||||
*/
|
|
||||||
IASTImplicitName getConstructionPoint();
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright (c) 2015 Google, Inc 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:
|
|
||||||
* Sergey Prigogin (Google) - initial API and implementation
|
|
||||||
*******************************************************************************/
|
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* An AST node that may have implicit destructor names.
|
|
||||||
* @see IASTImplicitDestructorName
|
|
||||||
*
|
|
||||||
* @since 5.11
|
|
||||||
* @noextend This interface is not intended to be extended by clients.
|
|
||||||
* @noimplement This interface is not intended to be implemented by clients.
|
|
||||||
*/
|
|
||||||
public interface IASTImplicitDestructorNameOwner extends IASTNode {
|
|
||||||
public static final ASTNodeProperty IMPLICIT_DESTRUCTOR_NAME =
|
|
||||||
new ASTNodeProperty("IASTImplicitDestructorNameOwner.IMPLICIT_DESTRUCTOR_NAME"); //$NON-NLS-1$
|
|
||||||
|
|
||||||
public IASTImplicitDestructorName[] getImplicitDestructorNames();
|
|
||||||
}
|
|
|
@ -11,7 +11,7 @@
|
||||||
package org.eclipse.cdt.core.dom.ast;
|
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
|
* @since 5.2
|
||||||
* @noextend This interface is not intended to be extended by clients.
|
* @noextend This interface is not intended to be extended by clients.
|
||||||
* @noimplement This interface is not intended to be implemented 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.
|
* This is the optional return value for this function.
|
||||||
*
|
*
|
||||||
* @return the return expression or {@code null}.
|
* @return the return expression or null.
|
||||||
*/
|
*/
|
||||||
public IASTExpression getReturnValue();
|
public IASTExpression getReturnValue();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the return value as {@link IASTInitializerClause}, or {@code null}.
|
* Returns the return value as {@link IASTInitializerClause}, or <code>null</code>.
|
||||||
* In C++ this can be an braced initializer list.
|
* In c++ this can be an braced initializer list.
|
||||||
* @since 5.2
|
* @since 5.2
|
||||||
*/
|
*/
|
||||||
public IASTInitializerClause getReturnArgument();
|
public IASTInitializerClause getReturnArgument();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Not allowed on frozen AST.
|
* Not allowed on frozen ast.
|
||||||
* @since 5.2
|
* @since 5.2
|
||||||
*/
|
*/
|
||||||
public void setReturnArgument(IASTInitializerClause returnValue);
|
public void setReturnArgument(IASTInitializerClause returnValue);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Not allowed on frozen AST.
|
* Not allowed on frozen ast.
|
||||||
*/
|
*/
|
||||||
public void setReturnValue(IASTExpression returnValue);
|
public void setReturnValue(IASTExpression returnValue);
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,7 @@ public interface IASTTypeIdInitializerExpression extends IASTExpression {
|
||||||
* <code>IASTTypeIdInitializerExpression</code> and
|
* <code>IASTTypeIdInitializerExpression</code> and
|
||||||
* <code>IASTTypeId</code>.
|
* <code>IASTTypeId</code>.
|
||||||
*/
|
*/
|
||||||
public static final ASTNodeProperty TYPE_ID =
|
public static final ASTNodeProperty TYPE_ID = new ASTNodeProperty("IASTTypeIdInitializerExpression.TYPE_ID - IASTTypeId for IASTTypeIdInitializerExpression"); //$NON-NLS-1$
|
||||||
new ASTNodeProperty("IASTTypeIdInitializerExpression.TYPE_ID - IASTTypeId for IASTTypeIdInitializerExpression"); //$NON-NLS-1$
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>INITIALIZER</code> represents the relationship between an
|
* <code>INITIALIZER</code> represents the relationship between an
|
||||||
|
|
|
@ -18,27 +18,27 @@ package org.eclipse.cdt.core.dom.ast;
|
||||||
*/
|
*/
|
||||||
public interface IASTWhileStatement extends IASTStatement {
|
public interface IASTWhileStatement extends IASTStatement {
|
||||||
/**
|
/**
|
||||||
* {@code CONDITIONEXPRESSION} represents the relationship between an {@code IASTWhileStatement} and
|
* <code>CONDITIONEXPRESSION</code> represents the relationship between an <code>IASTWhileStatement</code> and
|
||||||
* it's nested {@code IASTExpression}.
|
* it's nested <code>IASTExpression</code>.
|
||||||
*/
|
*/
|
||||||
public static final ASTNodeProperty CONDITIONEXPRESSION = new ASTNodeProperty(
|
public static final ASTNodeProperty CONDITIONEXPRESSION = new ASTNodeProperty(
|
||||||
"IASTWhileStatement.CONDITIONEXPRESSION - IASTExpression (condition) for IASTWhileStatement"); //$NON-NLS-1$
|
"IASTWhileStatement.CONDITIONEXPRESSION - IASTExpression (condition) for IASTWhileStatement"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@code BODY} represents the relationship between an {@code IASTWhileStatement} and
|
* <code>BODY</code> represents the relationship between an <code>IASTWhileStatement</code> and
|
||||||
* it's nested {@code IASTStatement}.
|
* it's nested <code>IASTStatement</code>.
|
||||||
*/
|
*/
|
||||||
public static final ASTNodeProperty BODY = new ASTNodeProperty("IASTWhileStatement.BODY - IASTStatement (body) for IASTWhileStatement"); //$NON-NLS-1$
|
public static final ASTNodeProperty BODY = new ASTNodeProperty("IASTWhileStatement.BODY - IASTStatement (body) for IASTWhileStatement"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the condition on the while loop
|
* Get the condition on the while loop
|
||||||
*
|
*
|
||||||
* @return expression for the condition
|
* @return expression for the condition
|
||||||
*/
|
*/
|
||||||
public IASTExpression getCondition();
|
public IASTExpression getCondition();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the condition of the while loop.
|
* Set the condition of the while loop.
|
||||||
*
|
*
|
||||||
* @param condition
|
* @param condition
|
||||||
*/
|
*/
|
||||||
|
@ -52,7 +52,7 @@ public interface IASTWhileStatement extends IASTStatement {
|
||||||
public IASTStatement getBody();
|
public IASTStatement getBody();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the body of the while loop.
|
* Set the body of the while loop.
|
||||||
*
|
*
|
||||||
* @param body
|
* @param body
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -37,10 +37,10 @@ public interface IScope {
|
||||||
public IName getScopeName();
|
public IName getScopeName();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the first enclosing non-template scope, or {@code null} if this
|
* Returns the first enclosing non-template scope, or <code>null</code> if this
|
||||||
* is the global scope.
|
* is the global scope.
|
||||||
* <p>
|
* <p>
|
||||||
* For scopes obtained from an index, {@code null} is returned to indicate that the
|
* For scopes obtained from an index, <code>null</code> is returned to indicate that the
|
||||||
* scope is only enclosed by the global scope.
|
* scope is only enclosed by the global scope.
|
||||||
*/
|
*/
|
||||||
public IScope getParent() throws DOMException;
|
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.
|
* 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.
|
* No attempt is made to resolve potential ambiguities or perform access checking.
|
||||||
*
|
*
|
||||||
* @param name the name of the bindings
|
* @param name
|
||||||
* @return An array of bindings.
|
* @return An array of bindings.
|
||||||
*/
|
*/
|
||||||
public IBinding[] find(String name);
|
public IBinding[] find(String name);
|
||||||
|
@ -62,9 +62,11 @@ public interface IScope {
|
||||||
* yet been cached in this scope, or if resolve == false and the appropriate binding
|
* yet been cached in this scope, or if resolve == false and the appropriate binding
|
||||||
* has not yet been resolved.
|
* has not yet been resolved.
|
||||||
*
|
*
|
||||||
* @param name the name of the binding
|
* @param name
|
||||||
* @param resolve whether or not to resolve the matching binding if it has not been so already.
|
* @param resolve
|
||||||
* @return the binding in this scope that matches the name, or {@code null}
|
* 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
|
||||||
*/
|
*/
|
||||||
public IBinding getBinding(IASTName name, boolean resolve);
|
public IBinding getBinding(IASTName name, boolean resolve);
|
||||||
|
|
||||||
|
@ -75,8 +77,10 @@ public interface IScope {
|
||||||
* has not yet been resolved. Accepts file local bindings from the index for the files
|
* has not yet been resolved. Accepts file local bindings from the index for the files
|
||||||
* in the given set, only.
|
* in the given set, only.
|
||||||
*
|
*
|
||||||
* @param name the name of the binding
|
* @param name
|
||||||
* @param resolve whether or not to resolve the matching binding if it has not been so already.
|
* @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.
|
* @param acceptLocalBindings a set of files for which to accept local bindings.
|
||||||
* @return the binding in this scope that matches the name, or null
|
* @return the binding in this scope that matches the name, or null
|
||||||
*/
|
*/
|
||||||
|
@ -136,63 +140,51 @@ public interface IScope {
|
||||||
public final void setPrefixLookup(boolean prefixLookup) {
|
public final void setPrefixLookup(boolean prefixLookup) {
|
||||||
fPrefixLookup = prefixLookup;
|
fPrefixLookup = prefixLookup;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void setResolve(boolean resolve) {
|
public final void setResolve(boolean resolve) {
|
||||||
fResolve = resolve;
|
fResolve = resolve;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void setIgnorePointOfDeclaration(boolean ignorePointOfDeclaration) {
|
public final void setIgnorePointOfDeclaration(boolean ignorePointOfDeclaration) {
|
||||||
fIgnorePointOfDeclaration = ignorePointOfDeclaration;
|
fIgnorePointOfDeclaration = ignorePointOfDeclaration;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void setLookupKey(char[] key) {
|
public final void setLookupKey(char[] key) {
|
||||||
fLookupKey= key;
|
fLookupKey= key;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final char[] getLookupKey() {
|
public final char[] getLookupKey() {
|
||||||
return fLookupKey;
|
return fLookupKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final IASTNode getLookupPoint() {
|
public final IASTNode getLookupPoint() {
|
||||||
return fLookupPoint;
|
return fLookupPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final boolean isResolve() {
|
public final boolean isResolve() {
|
||||||
return fResolve;
|
return fResolve;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final boolean isPrefixLookup() {
|
public final boolean isPrefixLookup() {
|
||||||
return fPrefixLookup;
|
return fPrefixLookup;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final boolean isIgnorePointOfDeclaration() {
|
public final boolean isIgnorePointOfDeclaration() {
|
||||||
return fIgnorePointOfDeclaration;
|
return fIgnorePointOfDeclaration;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final IIndexFileSet getIncludedFiles() {
|
public final IIndexFileSet getIncludedFiles() {
|
||||||
return fTu == null ? IIndexFileSet.EMPTY : fTu.getIndexFileSet();
|
return fTu == null ? IIndexFileSet.EMPTY : fTu.getIndexFileSet();
|
||||||
}
|
}
|
||||||
|
|
||||||
public final IIndex getIndex() {
|
public final IIndex getIndex() {
|
||||||
return fTu == null ? null : fTu.getIndex();
|
return fTu == null ? null : fTu.getIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
public final IASTName getLookupName() {
|
public final IASTName getLookupName() {
|
||||||
return fLookupPointIsName ? (IASTName) fLookupPoint : null;
|
return fLookupPointIsName ? (IASTName) fLookupPoint : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IASTTranslationUnit getTranslationUnit() {
|
public IASTTranslationUnit getTranslationUnit() {
|
||||||
return fTu;
|
return fTu;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the bindings in this scope that the given name or prefix could resolve to. Could
|
* Get 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
|
* 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
|
* yet been cached in this scope, or if resolve == false and the appropriate bindings
|
||||||
* have not yet been resolved.
|
* have not yet been resolved.
|
||||||
*
|
*
|
||||||
* @return the bindings in this scope that match the name or prefix, or {@code null}
|
* @return : the bindings in this scope that match the name or prefix, or null
|
||||||
* @since 5.5
|
* @since 5.5
|
||||||
*/
|
*/
|
||||||
public IBinding[] getBindings(ScopeLookupData lookup);
|
public IBinding[] getBindings(ScopeLookupData lookup);
|
||||||
|
|
|
@ -49,27 +49,27 @@ public interface ICPPASTCatchHandler extends IASTStatement {
|
||||||
public boolean isCatchAll();
|
public boolean isCatchAll();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the catch body.
|
* Set the catch body.
|
||||||
*/
|
*/
|
||||||
public void setCatchBody(IASTStatement compoundStatement);
|
public void setCatchBody(IASTStatement compoundStatement);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the catch body.
|
* Get the catch body.
|
||||||
*/
|
*/
|
||||||
public IASTStatement getCatchBody();
|
public IASTStatement getCatchBody();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the declaration.
|
* Set the declaration.
|
||||||
*/
|
*/
|
||||||
public void setDeclaration(IASTDeclaration decl);
|
public void setDeclaration(IASTDeclaration decl);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the declaration.
|
* Get the declaration.
|
||||||
*/
|
*/
|
||||||
public IASTDeclaration getDeclaration();
|
public IASTDeclaration getDeclaration();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the scope represented by this catch handler.
|
* Get the scope represented by this catch handler.
|
||||||
* @since 5.1
|
* @since 5.1
|
||||||
*/
|
*/
|
||||||
public IScope getScope();
|
public IScope getScope();
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2012, 2015 Wind River Systems, Inc. and others.
|
* Copyright (c) 2012 Wind River Systems, Inc. and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -7,23 +7,16 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
* Sergey Prigogin (Google)
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.core.dom.ast.cpp;
|
package org.eclipse.cdt.core.dom.ast.cpp;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorName;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorNameOwner;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for C++ expressions. Any full-expressions may contain {@link IASTImplicitDestructorName}s of
|
* Interface for c++ expressions.
|
||||||
* destructors called at the end of the expression to destroy temporaries created by the expression.
|
|
||||||
* A full-expression is an expression that is not a subexpression of another expression.
|
|
||||||
*
|
|
||||||
* @since 5.10
|
|
||||||
* @noextend This interface is not intended to be extended by clients.
|
* @noextend This interface is not intended to be extended by clients.
|
||||||
* @noimplement This interface is not intended to be implemented by clients.
|
* @noimplement This interface is not intended to be implemented by clients.
|
||||||
|
* @since 5.5
|
||||||
*/
|
*/
|
||||||
public interface ICPPASTExpression
|
public interface ICPPASTExpression extends IASTExpression, ICPPASTInitializerClause {
|
||||||
extends IASTExpression, ICPPASTInitializerClause, IASTImplicitDestructorNameOwner {
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Mike Kucera (IBM) - Initial API and implementation
|
* Mike Kucera (IBM) - Initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.core.dom.ast.cpp;
|
package org.eclipse.cdt.core.dom.ast.cpp;
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@ import org.eclipse.cdt.core.dom.ast.IASTImplicitNameOwner;
|
||||||
* @noimplement This interface is not intended to be implemented by clients.
|
* @noimplement This interface is not intended to be implemented by clients.
|
||||||
*/
|
*/
|
||||||
public interface ICPPASTExpressionList extends IASTExpressionList, ICPPASTExpression, IASTImplicitNameOwner {
|
public interface ICPPASTExpressionList extends IASTExpressionList, ICPPASTExpression, IASTImplicitNameOwner {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ICPPASTExpressionList copy();
|
public ICPPASTExpressionList copy();
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ public interface ICPPASTFieldReference extends IASTFieldReference, ICPPASTExpres
|
||||||
public boolean isTemplate();
|
public boolean isTemplate();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the template keyword used.
|
* Set the template keyword used.
|
||||||
*
|
*
|
||||||
* @param value
|
* @param value
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -32,7 +32,7 @@ public interface ICPPASTFunctionCallExpression
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the function binding for the overloaded operator() invoked by
|
* Returns the function binding for the overloaded operator() invoked by
|
||||||
* the function call, or {@code null} if the operator() is not overloaded.
|
* the function call, or <code>null</code> if the operator() is not overloaded.
|
||||||
* @since 5.8
|
* @since 5.8
|
||||||
*/
|
*/
|
||||||
public ICPPFunction getOverload();
|
public ICPPFunction getOverload();
|
||||||
|
|
|
@ -22,11 +22,11 @@ import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||||
* @since 5.2
|
* @since 5.2
|
||||||
*/
|
*/
|
||||||
public interface ICPPASTPackExpansionExpression extends ICPPASTExpression {
|
public interface ICPPASTPackExpansionExpression extends ICPPASTExpression {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the relationship between a pack-expansion and its pattern.
|
* Represents the relationship between a pack-expansion and its pattern.
|
||||||
*/
|
*/
|
||||||
public static final ASTNodeProperty PATTERN =
|
public static final ASTNodeProperty PATTERN = new ASTNodeProperty("ICPPASTPackExpansionExpression.Pattern [IASTExpression]"); //$NON-NLS-1$
|
||||||
new ASTNodeProperty("ICPPASTPackExpansionExpression.Pattern [IASTExpression]"); //$NON-NLS-1$
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the pattern of the pack expansion.
|
* 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;
|
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 ( ... ) { }
|
* { // handler } catch ( ... ) { }
|
||||||
*
|
*
|
||||||
* @noextend This interface is not intended to be extended by clients.
|
* @noextend This interface is not intended to be extended by clients.
|
||||||
|
@ -22,41 +22,43 @@ import org.eclipse.cdt.core.dom.ast.IASTStatement;
|
||||||
*/
|
*/
|
||||||
public interface ICPPASTTryBlockStatement extends IASTStatement {
|
public interface ICPPASTTryBlockStatement extends IASTStatement {
|
||||||
/**
|
/**
|
||||||
* {@code BODY} is the body of the try block.
|
* <code>BODY</code> is the body of the try block.
|
||||||
*/
|
*/
|
||||||
public static final ASTNodeProperty BODY = new ASTNodeProperty("ICPPASTTryBlockStatement.BODY - Body of try block"); //$NON-NLS-1$
|
public static final ASTNodeProperty BODY = new ASTNodeProperty("ICPPASTTryBlockStatement.BODY - Body of try block"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the try body.
|
* Set try body.
|
||||||
*
|
*
|
||||||
* @param tryBlock {@code IASTStatement}
|
* @param tryBlock
|
||||||
|
* <code>IASTStatement</code>
|
||||||
*/
|
*/
|
||||||
public void setTryBody(IASTStatement tryBlock);
|
public void setTryBody(IASTStatement tryBlock);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the try body.
|
* Get try body.
|
||||||
*
|
*
|
||||||
* @return {@code IASTStatement}
|
* @return <code>IASTStatement</code>
|
||||||
*/
|
*/
|
||||||
public IASTStatement getTryBody();
|
public IASTStatement getTryBody();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@code CATCH_HANDLER} are the exception catching handlers.
|
* <code>CATCH_HANDLER</code> are the exception catching handlers.
|
||||||
*/
|
*/
|
||||||
public static final ASTNodeProperty CATCH_HANDLER = new ASTNodeProperty(
|
public static final ASTNodeProperty CATCH_HANDLER = new ASTNodeProperty(
|
||||||
"ICPPASTTryBlockStatement.CATCH_HANDLER - Exception catching handlers"); //$NON-NLS-1$
|
"ICPPASTTryBlockStatement.CATCH_HANDLER - Exception catching handlers"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds catch handler.
|
* Add catch handler.
|
||||||
*
|
*
|
||||||
* @param handler {@code ICPPASTCatchHandler}
|
* @param handler
|
||||||
|
* <code>ICPPASTCatchHandler</code>
|
||||||
*/
|
*/
|
||||||
public void addCatchHandler(ICPPASTCatchHandler handler);
|
public void addCatchHandler(ICPPASTCatchHandler handler);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the catch handlers.
|
* Get the catch handlers.
|
||||||
*
|
*
|
||||||
* @return {@code ICPPASTCatchHandler[]}
|
* @return <code>ICPPASTCatchHandler []</code>
|
||||||
*/
|
*/
|
||||||
public ICPPASTCatchHandler[] getCatchHandlers();
|
public ICPPASTCatchHandler[] getCatchHandlers();
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2005, 2015 IBM Corporation and others.
|
* Copyright (c) 2005, 2011 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -402,19 +402,4 @@ public abstract class ASTNode implements IASTNode {
|
||||||
public void resolvePendingAmbiguities() {
|
public void resolvePendingAmbiguities() {
|
||||||
((ASTTranslationUnit) getTranslationUnit()).resolvePendingAmbiguities(this);
|
((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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,103 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* 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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,106 +1,35 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2005, 2015 IBM Corporation and others.
|
* Copyright (c) 2005, 2011 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* John Camelon (IBM Rational Software) - Initial API and implementation
|
* John Camelon (IBM Rational Software) - Initial API and implementation
|
||||||
* Yuan Zhang / Beth Tibbitts (IBM Research)
|
* Yuan Zhang / Beth Tibbitts (IBM Research)
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
* Sergey Prigogin (Google)
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.c;
|
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.IASTInitializer;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
|
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.c.ICASTTypeIdInitializerExpression;
|
import org.eclipse.cdt.core.dom.ast.c.ICASTTypeIdInitializerExpression;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
import org.eclipse.cdt.internal.core.dom.parser.ASTTypeIdInitializerExpression;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type id initializer expression for C, type-id { initializer }
|
* C-specific implementation adds nothing but the c-specific interface.
|
||||||
*/
|
*/
|
||||||
public class CASTTypeIdInitializerExpression extends ASTNode implements ICASTTypeIdInitializerExpression {
|
public class CASTTypeIdInitializerExpression extends ASTTypeIdInitializerExpression implements
|
||||||
private IASTTypeId fTypeId;
|
ICASTTypeIdInitializerExpression {
|
||||||
private IASTInitializer fInitializer;
|
|
||||||
|
|
||||||
public CASTTypeIdInitializerExpression() {
|
private CASTTypeIdInitializerExpression() {
|
||||||
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public CASTTypeIdInitializerExpression(IASTTypeId t, IASTInitializer i) {
|
public CASTTypeIdInitializerExpression(IASTTypeId typeId, IASTInitializer initializer) {
|
||||||
setTypeId(t);
|
super(typeId, initializer);
|
||||||
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
|
@Override
|
||||||
|
@ -110,9 +39,13 @@ public class CASTTypeIdInitializerExpression extends ASTNode implements ICASTTyp
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CASTTypeIdInitializerExpression copy(CopyStyle style) {
|
public CASTTypeIdInitializerExpression copy(CopyStyle style) {
|
||||||
CASTTypeIdInitializerExpression copy = new CASTTypeIdInitializerExpression(
|
CASTTypeIdInitializerExpression copy = new CASTTypeIdInitializerExpression();
|
||||||
fTypeId == null ? null : fTypeId.copy(style),
|
initializeCopy(copy, style);
|
||||||
fInitializer == null ? null : fInitializer.copy(style));
|
return copy;
|
||||||
return copy(copy, style);
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IType getExpressionType() {
|
||||||
|
return CVisitor.createType(getTypeId().getAbstractDeclarator());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2008, 2015 Wind River Systems, Inc. and others.
|
* Copyright (c) 2008, 2009 Wind River Systems, Inc. and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -7,13 +7,11 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - Initial API and implementation
|
* Markus Schorn - Initial API and implementation
|
||||||
* Sergey Prigogin (Google)
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTCastExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTCastExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorName;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExpression;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExpression;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTAmbiguousBinaryVsCastExpression;
|
import org.eclipse.cdt.internal.core.dom.parser.ASTAmbiguousBinaryVsCastExpression;
|
||||||
|
|
||||||
|
@ -22,9 +20,4 @@ public class CPPASTAmbiguousBinaryVsCastExpression extends ASTAmbiguousBinaryVsC
|
||||||
public CPPASTAmbiguousBinaryVsCastExpression(IASTBinaryExpression bexp, IASTCastExpression castExpr) {
|
public CPPASTAmbiguousBinaryVsCastExpression(IASTBinaryExpression bexp, IASTCastExpression castExpr) {
|
||||||
super(bexp, castExpr);
|
super(bexp, castExpr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public IASTImplicitDestructorName[] getImplicitDestructorNames() {
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2008, 2015 Wind River Systems, Inc. and others.
|
* Copyright (c) 2008 Wind River Systems, Inc. and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -7,13 +7,11 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - Initial API and implementation
|
* Markus Schorn - Initial API and implementation
|
||||||
* Sergey Prigogin (Google)
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTCastExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTCastExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTFunctionCallExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTFunctionCallExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorName;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExpression;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExpression;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTAmbiguousCastVsFunctionCallExpression;
|
import org.eclipse.cdt.internal.core.dom.parser.ASTAmbiguousCastVsFunctionCallExpression;
|
||||||
|
|
||||||
|
@ -23,9 +21,4 @@ public class CPPASTAmbiguousCastVsFunctionCallExpression
|
||||||
public CPPASTAmbiguousCastVsFunctionCallExpression(IASTCastExpression castExpr, IASTFunctionCallExpression funcCall) {
|
public CPPASTAmbiguousCastVsFunctionCallExpression(IASTCastExpression castExpr, IASTFunctionCallExpression funcCall) {
|
||||||
super(castExpr, funcCall);
|
super(castExpr, funcCall);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public IASTImplicitDestructorName[] getImplicitDestructorNames() {
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguousExpression;
|
||||||
public class CPPASTAmbiguousExpression extends ASTAmbiguousNode
|
public class CPPASTAmbiguousExpression extends ASTAmbiguousNode
|
||||||
implements IASTAmbiguousExpression, ICPPASTExpression {
|
implements IASTAmbiguousExpression, ICPPASTExpression {
|
||||||
private IASTExpression[] exp = new IASTExpression[2];
|
private IASTExpression[] exp = new IASTExpression[2];
|
||||||
private int expPos;
|
private int expPos= -1;
|
||||||
|
|
||||||
public CPPASTAmbiguousExpression(IASTExpression... expressions) {
|
public CPPASTAmbiguousExpression(IASTExpression... expressions) {
|
||||||
for (IASTExpression e : expressions) {
|
for (IASTExpression e : expressions) {
|
||||||
|
@ -43,7 +43,7 @@ public class CPPASTAmbiguousExpression extends ASTAmbiguousNode
|
||||||
public void addExpression(IASTExpression e) {
|
public void addExpression(IASTExpression e) {
|
||||||
assertNotFrozen();
|
assertNotFrozen();
|
||||||
if (e != null) {
|
if (e != null) {
|
||||||
exp = ArrayUtil.appendAt(exp, expPos++, e);
|
exp = ArrayUtil.appendAt(IASTExpression.class, exp, ++expPos, e);
|
||||||
e.setParent(this);
|
e.setParent(this);
|
||||||
e.setPropertyInParent(SUBEXPRESSION);
|
e.setPropertyInParent(SUBEXPRESSION);
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ public class CPPASTAmbiguousExpression extends ASTAmbiguousNode
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IASTExpression[] getExpressions() {
|
public IASTExpression[] getExpressions() {
|
||||||
exp = ArrayUtil.trim(exp, expPos);
|
exp = ArrayUtil.trimAt(IASTExpression.class, exp, expPos);
|
||||||
return exp;
|
return exp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2015 IBM Corporation and others.
|
* Copyright (c) 2004, 2012 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -9,7 +9,6 @@
|
||||||
* John Camelon (IBM) - Initial API and implementation
|
* John Camelon (IBM) - Initial API and implementation
|
||||||
* Mike Kucera (IBM)
|
* Mike Kucera (IBM)
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
* Sergey Prigogin (Google)
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
|
@ -17,7 +16,6 @@ import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorName;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitName;
|
import org.eclipse.cdt.core.dom.ast.IASTImplicitName;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTInitializerClause;
|
import org.eclipse.cdt.core.dom.ast.IASTInitializerClause;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
|
@ -212,9 +210,4 @@ public class CPPASTArraySubscriptExpression extends ASTNode
|
||||||
public boolean isLValue() {
|
public boolean isLValue() {
|
||||||
return getValueCategory() == LVALUE;
|
return getValueCategory() == LVALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public IASTImplicitDestructorName[] getImplicitDestructorNames() {
|
|
||||||
return IASTImplicitDestructorName.EMPTY_NAME_ARRAY;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2015 IBM Corporation and others.
|
* Copyright (c) 2004, 2011 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -18,8 +18,6 @@ import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTBinaryExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorName;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorNameOwner;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitName;
|
import org.eclipse.cdt.core.dom.ast.IASTImplicitName;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitNameOwner;
|
import org.eclipse.cdt.core.dom.ast.IASTImplicitNameOwner;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTInitializerClause;
|
import org.eclipse.cdt.core.dom.ast.IASTInitializerClause;
|
||||||
|
@ -32,7 +30,6 @@ 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.ICPPMethod;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
|
import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalBinary;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalBinary;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalFixed;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalFixed;
|
||||||
|
|
||||||
|
@ -44,7 +41,6 @@ public class CPPASTBinaryExpression extends ASTNode implements ICPPASTBinaryExpr
|
||||||
|
|
||||||
private ICPPEvaluation evaluation;
|
private ICPPEvaluation evaluation;
|
||||||
private IASTImplicitName[] implicitNames;
|
private IASTImplicitName[] implicitNames;
|
||||||
private IASTImplicitDestructorName[] implicitDestructorNames;
|
|
||||||
|
|
||||||
public CPPASTBinaryExpression() {
|
public CPPASTBinaryExpression() {
|
||||||
}
|
}
|
||||||
|
@ -125,6 +121,9 @@ public class CPPASTBinaryExpression extends ASTNode implements ICPPASTBinaryExpr
|
||||||
setInitOperand2(expression);
|
setInitOperand2(expression);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.eclipse.cdt.core.dom.ast.IASTImplicitNameOwner#getImplicitNames()
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public IASTImplicitName[] getImplicitNames() {
|
public IASTImplicitName[] getImplicitNames() {
|
||||||
if (implicitNames == null) {
|
if (implicitNames == null) {
|
||||||
|
@ -143,15 +142,6 @@ public class CPPASTBinaryExpression extends ASTNode implements ICPPASTBinaryExpr
|
||||||
return implicitNames;
|
return implicitNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public IASTImplicitDestructorName[] getImplicitDestructorNames() {
|
|
||||||
if (implicitDestructorNames == null) {
|
|
||||||
implicitDestructorNames = CPPVisitor.getTemporariesDestructorCalls(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
return implicitDestructorNames;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean accept(ASTVisitor action) {
|
public boolean accept(ASTVisitor action) {
|
||||||
if (operand1 instanceof IASTBinaryExpression || operand2 instanceof IASTBinaryExpression) {
|
if (operand1 instanceof IASTBinaryExpression || operand2 instanceof IASTBinaryExpression) {
|
||||||
|
@ -169,15 +159,16 @@ public class CPPASTBinaryExpression extends ASTNode implements ICPPASTBinaryExpr
|
||||||
if (operand1 != null && !operand1.accept(action))
|
if (operand1 != null && !operand1.accept(action))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (action.shouldVisitImplicitNames && !acceptByNodes(getImplicitNames(), action))
|
if (action.shouldVisitImplicitNames) {
|
||||||
return false;
|
for (IASTImplicitName name : getImplicitNames()) {
|
||||||
|
if (!name.accept(action))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (operand2 != null && !operand2.accept(action))
|
if (operand2 != null && !operand2.accept(action))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (action.shouldVisitImplicitDestructorNames && !acceptByNodes(getImplicitDestructorNames(), action))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (action.shouldVisitExpressions && action.leave(this) == ASTVisitor.PROCESS_ABORT)
|
if (action.shouldVisitExpressions && action.leave(this) == ASTVisitor.PROCESS_ABORT)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -194,7 +185,7 @@ public class CPPASTBinaryExpression extends ASTNode implements ICPPASTBinaryExpr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean acceptWithoutRecursion(IASTBinaryExpression bexpr, ASTVisitor action) {
|
public static boolean acceptWithoutRecursion(IASTBinaryExpression bexpr, ASTVisitor action) {
|
||||||
N stack= new N(bexpr);
|
N stack= new N(bexpr);
|
||||||
while (stack != null) {
|
while (stack != null) {
|
||||||
IASTBinaryExpression expr= stack.fExpression;
|
IASTBinaryExpression expr= stack.fExpression;
|
||||||
|
@ -220,10 +211,12 @@ public class CPPASTBinaryExpression extends ASTNode implements ICPPASTBinaryExpr
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (stack.fState == 1) {
|
if (stack.fState == 1) {
|
||||||
if (action.shouldVisitImplicitNames &&
|
if (action.shouldVisitImplicitNames) {
|
||||||
!acceptByNodes(((IASTImplicitNameOwner) expr).getImplicitNames(), action)) {
|
for (IASTImplicitName name : ((IASTImplicitNameOwner) expr).getImplicitNames()) {
|
||||||
return false;
|
if (!name.accept(action))
|
||||||
}
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
stack.fState= 2;
|
stack.fState= 2;
|
||||||
|
|
||||||
IASTExpression op2 = expr.getOperand2();
|
IASTExpression op2 = expr.getOperand2();
|
||||||
|
@ -235,10 +228,6 @@ public class CPPASTBinaryExpression extends ASTNode implements ICPPASTBinaryExpr
|
||||||
}
|
}
|
||||||
if (op2 != null && !op2.accept(action))
|
if (op2 != null && !op2.accept(action))
|
||||||
return false;
|
return false;
|
||||||
if (action.shouldVisitImplicitDestructorNames &&
|
|
||||||
!acceptByNodes(((IASTImplicitDestructorNameOwner) expr).getImplicitDestructorNames(), action)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action.shouldVisitExpressions && action.leave(expr) == ASTVisitor.PROCESS_ABORT)
|
if (action.shouldVisitExpressions && action.leave(expr) == ASTVisitor.PROCESS_ABORT)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2015 IBM Corporation and others.
|
* Copyright (c) 2004, 2013 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,7 +8,6 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* John Camelon (IBM) - Initial API and implementation
|
* John Camelon (IBM) - Initial API and implementation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
* Sergey Prigogin (Google)
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
|
@ -16,7 +15,6 @@ import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.PRVALUE;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTBinaryTypeIdExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTBinaryTypeIdExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorName;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
|
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExpression;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExpression;
|
||||||
|
@ -147,9 +145,4 @@ public class CPPASTBinaryTypeIdExpression extends ASTNode implements ICPPASTExpr
|
||||||
public ValueCategory getValueCategory() {
|
public ValueCategory getValueCategory() {
|
||||||
return PRVALUE;
|
return PRVALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public IASTImplicitDestructorName[] getImplicitDestructorNames() {
|
|
||||||
return IASTImplicitDestructorName.EMPTY_NAME_ARRAY; // Binary type-id expressions don't call destructors.
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2015 IBM Corporation and others.
|
* Copyright (c) 2004, 2011 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,7 +8,6 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* John Camelon (IBM) - Initial API and implementation
|
* John Camelon (IBM) - Initial API and implementation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
* Sergey Prigogin (Google)
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
|
@ -16,7 +15,6 @@ import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorName;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
|
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
|
||||||
import org.eclipse.cdt.core.dom.ast.IProblemType;
|
import org.eclipse.cdt.core.dom.ast.IProblemType;
|
||||||
|
@ -33,17 +31,16 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalTypeId;
|
||||||
* Cast expression for C++
|
* Cast expression for C++
|
||||||
*/
|
*/
|
||||||
public class CPPASTCastExpression extends ASTNode implements ICPPASTCastExpression, IASTAmbiguityParent {
|
public class CPPASTCastExpression extends ASTNode implements ICPPASTCastExpression, IASTAmbiguityParent {
|
||||||
private int fOperator;
|
private int op;
|
||||||
private ICPPASTExpression fOperand;
|
private ICPPASTExpression operand;
|
||||||
private IASTTypeId fTypeId;
|
private IASTTypeId typeId;
|
||||||
private ICPPEvaluation fEvaluation;
|
private ICPPEvaluation fEvaluation;
|
||||||
private IASTImplicitDestructorName[] fImplicitDestructorNames;
|
|
||||||
|
|
||||||
public CPPASTCastExpression() {
|
public CPPASTCastExpression() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public CPPASTCastExpression(int operator, IASTTypeId typeId, IASTExpression operand) {
|
public CPPASTCastExpression(int operator, IASTTypeId typeId, IASTExpression operand) {
|
||||||
fOperator = operator;
|
op = operator;
|
||||||
setOperand(operand);
|
setOperand(operand);
|
||||||
setTypeId(typeId);
|
setTypeId(typeId);
|
||||||
}
|
}
|
||||||
|
@ -57,7 +54,7 @@ public class CPPASTCastExpression extends ASTNode implements ICPPASTCastExpressi
|
||||||
public CPPASTCastExpression copy(CopyStyle style) {
|
public CPPASTCastExpression copy(CopyStyle style) {
|
||||||
CPPASTCastExpression copy = new CPPASTCastExpression();
|
CPPASTCastExpression copy = new CPPASTCastExpression();
|
||||||
copy.setOperator(getOperator());
|
copy.setOperator(getOperator());
|
||||||
copy.setTypeId(fTypeId == null ? null : fTypeId.copy(style));
|
copy.setTypeId(typeId == null ? null : typeId.copy(style));
|
||||||
IASTExpression operand = getOperand();
|
IASTExpression operand = getOperand();
|
||||||
copy.setOperand(operand == null ? null : operand.copy(style));
|
copy.setOperand(operand == null ? null : operand.copy(style));
|
||||||
return copy(copy, style);
|
return copy(copy, style);
|
||||||
|
@ -66,7 +63,7 @@ public class CPPASTCastExpression extends ASTNode implements ICPPASTCastExpressi
|
||||||
@Override
|
@Override
|
||||||
public void setTypeId(IASTTypeId typeId) {
|
public void setTypeId(IASTTypeId typeId) {
|
||||||
assertNotFrozen();
|
assertNotFrozen();
|
||||||
this.fTypeId = typeId;
|
this.typeId = typeId;
|
||||||
if (typeId != null) {
|
if (typeId != null) {
|
||||||
typeId.setParent(this);
|
typeId.setParent(this);
|
||||||
typeId.setPropertyInParent(TYPE_ID);
|
typeId.setPropertyInParent(TYPE_ID);
|
||||||
|
@ -75,44 +72,35 @@ public class CPPASTCastExpression extends ASTNode implements ICPPASTCastExpressi
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IASTTypeId getTypeId() {
|
public IASTTypeId getTypeId() {
|
||||||
return fTypeId;
|
return typeId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getOperator() {
|
public int getOperator() {
|
||||||
return fOperator;
|
return op;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setOperator(int operator) {
|
public void setOperator(int operator) {
|
||||||
assertNotFrozen();
|
assertNotFrozen();
|
||||||
fOperator = operator;
|
op = operator;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IASTExpression getOperand() {
|
public IASTExpression getOperand() {
|
||||||
return fOperand;
|
return operand;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setOperand(IASTExpression expression) {
|
public void setOperand(IASTExpression expression) {
|
||||||
assertNotFrozen();
|
assertNotFrozen();
|
||||||
fOperand = (ICPPASTExpression) expression;
|
operand = (ICPPASTExpression) expression;
|
||||||
if (expression != null) {
|
if (expression != null) {
|
||||||
expression.setParent(this);
|
expression.setParent(this);
|
||||||
expression.setPropertyInParent(OPERAND);
|
expression.setPropertyInParent(OPERAND);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public IASTImplicitDestructorName[] getImplicitDestructorNames() {
|
|
||||||
if (fImplicitDestructorNames == null) {
|
|
||||||
fImplicitDestructorNames = CPPVisitor.getTemporariesDestructorCalls(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
return fImplicitDestructorNames;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean accept(ASTVisitor action) {
|
public boolean accept(ASTVisitor action) {
|
||||||
if (action.shouldVisitExpressions) {
|
if (action.shouldVisitExpressions) {
|
||||||
|
@ -123,13 +111,10 @@ public class CPPASTCastExpression extends ASTNode implements ICPPASTCastExpressi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fTypeId != null && !fTypeId.accept(action)) return false;
|
if (typeId != null && !typeId.accept(action)) return false;
|
||||||
IASTExpression op = getOperand();
|
IASTExpression op = getOperand();
|
||||||
if (op != null && !op.accept(action)) return false;
|
if (op != null && !op.accept(action)) return false;
|
||||||
|
|
||||||
if (action.shouldVisitImplicitDestructorNames && !acceptByNodes(fImplicitDestructorNames, action))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (action.shouldVisitExpressions) {
|
if (action.shouldVisitExpressions) {
|
||||||
switch (action.leave(this)) {
|
switch (action.leave(this)) {
|
||||||
case ASTVisitor.PROCESS_ABORT: return false;
|
case ASTVisitor.PROCESS_ABORT: return false;
|
||||||
|
@ -142,10 +127,10 @@ public class CPPASTCastExpression extends ASTNode implements ICPPASTCastExpressi
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void replace(IASTNode child, IASTNode other) {
|
public void replace(IASTNode child, IASTNode other) {
|
||||||
if (child == fOperand) {
|
if (child == operand) {
|
||||||
other.setPropertyInParent(child.getPropertyInParent());
|
other.setPropertyInParent(child.getPropertyInParent());
|
||||||
other.setParent(child.getParent());
|
other.setParent(child.getParent());
|
||||||
fOperand = (ICPPASTExpression) other;
|
operand = (ICPPASTExpression) other;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -159,14 +144,14 @@ public class CPPASTCastExpression extends ASTNode implements ICPPASTCastExpressi
|
||||||
}
|
}
|
||||||
|
|
||||||
private ICPPEvaluation computeEvaluation() {
|
private ICPPEvaluation computeEvaluation() {
|
||||||
if (fOperand == null)
|
if (operand == null)
|
||||||
return EvalFixed.INCOMPLETE;
|
return EvalFixed.INCOMPLETE;
|
||||||
|
|
||||||
IType type= CPPVisitor.createType(getTypeId());
|
IType type= CPPVisitor.createType(getTypeId());
|
||||||
if (type == null || type instanceof IProblemType)
|
if (type == null || type instanceof IProblemType)
|
||||||
return EvalFixed.INCOMPLETE;
|
return EvalFixed.INCOMPLETE;
|
||||||
|
|
||||||
return new EvalTypeId(type, this, fOperand.getEvaluation());
|
return new EvalTypeId(type, this, operand.getEvaluation());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2015 IBM Corporation and others.
|
* Copyright (c) 2004, 2011 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,7 +8,6 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* John Camelon (IBM) - Initial API and implementation
|
* John Camelon (IBM) - Initial API and implementation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
* Sergey Prigogin (Google)
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
|
@ -17,13 +16,11 @@ import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.PRVALUE;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpressionStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTExpressionStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorName;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExpression;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.gnu.IGNUASTCompoundStatementExpression;
|
import org.eclipse.cdt.core.dom.ast.gnu.IGNUASTCompoundStatementExpression;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
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.EvalCompound;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalCompound;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalFixed;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalFixed;
|
||||||
|
|
||||||
|
@ -31,13 +28,12 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalFixed;
|
||||||
* Gnu-extension: ({ ... })
|
* Gnu-extension: ({ ... })
|
||||||
*/
|
*/
|
||||||
public class CPPASTCompoundStatementExpression extends ASTNode implements IGNUASTCompoundStatementExpression, ICPPASTExpression {
|
public class CPPASTCompoundStatementExpression extends ASTNode implements IGNUASTCompoundStatementExpression, ICPPASTExpression {
|
||||||
private IASTCompoundStatement fStatement;
|
|
||||||
|
private IASTCompoundStatement statement;
|
||||||
private ICPPEvaluation fEval;
|
private ICPPEvaluation fEval;
|
||||||
private IASTImplicitDestructorName[] fImplicitDestructorNames;
|
|
||||||
|
|
||||||
public CPPASTCompoundStatementExpression() {
|
public CPPASTCompoundStatementExpression() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ICPPEvaluation getEvaluation() {
|
public ICPPEvaluation getEvaluation() {
|
||||||
if (fEval == null) {
|
if (fEval == null) {
|
||||||
|
@ -67,54 +63,42 @@ public class CPPASTCompoundStatementExpression extends ASTNode implements IGNUAS
|
||||||
@Override
|
@Override
|
||||||
public CPPASTCompoundStatementExpression copy(CopyStyle style) {
|
public CPPASTCompoundStatementExpression copy(CopyStyle style) {
|
||||||
CPPASTCompoundStatementExpression copy = new CPPASTCompoundStatementExpression();
|
CPPASTCompoundStatementExpression copy = new CPPASTCompoundStatementExpression();
|
||||||
copy.setCompoundStatement(fStatement == null ? null : fStatement.copy(style));
|
copy.setCompoundStatement(statement == null ? null : statement.copy(style));
|
||||||
return copy(copy, style);
|
return copy(copy, style);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IASTCompoundStatement getCompoundStatement() {
|
public IASTCompoundStatement getCompoundStatement() {
|
||||||
return fStatement;
|
return statement;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setCompoundStatement(IASTCompoundStatement statement) {
|
public void setCompoundStatement(IASTCompoundStatement statement) {
|
||||||
assertNotFrozen();
|
assertNotFrozen();
|
||||||
this.fStatement = statement;
|
this.statement = statement;
|
||||||
if (statement != null) {
|
if (statement != null) {
|
||||||
statement.setParent(this);
|
statement.setParent(this);
|
||||||
statement.setPropertyInParent(STATEMENT);
|
statement.setPropertyInParent(STATEMENT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public IASTImplicitDestructorName[] getImplicitDestructorNames() {
|
|
||||||
if (fImplicitDestructorNames == null) {
|
|
||||||
fImplicitDestructorNames = CPPVisitor.getTemporariesDestructorCalls(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
return fImplicitDestructorNames;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean accept(ASTVisitor action) {
|
public boolean accept( ASTVisitor action ){
|
||||||
if (action.shouldVisitExpressions) {
|
if( action.shouldVisitExpressions ){
|
||||||
switch (action.visit(this)) {
|
switch( action.visit( this ) ){
|
||||||
case ASTVisitor.PROCESS_ABORT: return false;
|
case ASTVisitor.PROCESS_ABORT : return false;
|
||||||
case ASTVisitor.PROCESS_SKIP: return true;
|
case ASTVisitor.PROCESS_SKIP : return true;
|
||||||
default: break;
|
default : break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fStatement != null && !fStatement.accept(action)) return false;
|
if( statement != null ) if( !statement.accept( action ) ) return false;
|
||||||
|
|
||||||
if (action.shouldVisitImplicitDestructorNames && !acceptByNodes(fImplicitDestructorNames, action))
|
if( action.shouldVisitExpressions ){
|
||||||
return false;
|
switch( action.leave( this ) ){
|
||||||
|
case ASTVisitor.PROCESS_ABORT : return false;
|
||||||
if (action.shouldVisitExpressions) {
|
case ASTVisitor.PROCESS_SKIP : return true;
|
||||||
switch (action.leave(this)) {
|
default : break;
|
||||||
case ASTVisitor.PROCESS_ABORT: return false;
|
|
||||||
case ASTVisitor.PROCESS_SKIP: return true;
|
|
||||||
default: break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2015 IBM Corporation and others.
|
* Copyright (c) 2004, 2012 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,7 +8,6 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* John Camelon (IBM) - Initial API and implementation
|
* John Camelon (IBM) - Initial API and implementation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
* Sergey Prigogin (Google)
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
|
@ -17,24 +16,21 @@ import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTConditionalExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTConditionalExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorName;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTUnaryExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTUnaryExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExpression;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExpression;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
|
import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalConditional;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalConditional;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalFixed;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalFixed;
|
||||||
|
|
||||||
public class CPPASTConditionalExpression extends ASTNode
|
public class CPPASTConditionalExpression extends ASTNode implements IASTConditionalExpression,
|
||||||
implements IASTConditionalExpression, ICPPASTExpression, IASTAmbiguityParent {
|
ICPPASTExpression, IASTAmbiguityParent {
|
||||||
private ICPPASTExpression fCondition;
|
private ICPPASTExpression fCondition;
|
||||||
private ICPPASTExpression fPositive;
|
private ICPPASTExpression fPositive;
|
||||||
private ICPPASTExpression fNegative;
|
private ICPPASTExpression fNegative;
|
||||||
private ICPPEvaluation fEval;
|
private ICPPEvaluation fEval;
|
||||||
private IASTImplicitDestructorName[] fImplicitDestructorNames;
|
|
||||||
|
|
||||||
public CPPASTConditionalExpression() {
|
public CPPASTConditionalExpression() {
|
||||||
}
|
}
|
||||||
|
@ -104,15 +100,6 @@ public class CPPASTConditionalExpression extends ASTNode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public IASTImplicitDestructorName[] getImplicitDestructorNames() {
|
|
||||||
if (fImplicitDestructorNames == null) {
|
|
||||||
fImplicitDestructorNames = CPPVisitor.getTemporariesDestructorCalls(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
return fImplicitDestructorNames;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean accept(ASTVisitor action) {
|
public boolean accept(ASTVisitor action) {
|
||||||
if (action.shouldVisitExpressions) {
|
if (action.shouldVisitExpressions) {
|
||||||
|
@ -130,9 +117,6 @@ public class CPPASTConditionalExpression extends ASTNode
|
||||||
if (fNegative != null && !fNegative.accept(action))
|
if (fNegative != null && !fNegative.accept(action))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (action.shouldVisitImplicitDestructorNames && !acceptByNodes(fImplicitDestructorNames, action))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (action.shouldVisitExpressions && action.leave(this) == ASTVisitor.PROCESS_ABORT)
|
if (action.shouldVisitExpressions && action.leave(this) == ASTVisitor.PROCESS_ABORT)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2015 IBM Corporation and others.
|
* Copyright (c) 2004, 2011 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,7 +8,6 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* John Camelon (IBM) - Initial API and implementation
|
* John Camelon (IBM) - Initial API and implementation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
* Sergey Prigogin (Google)
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
|
@ -19,7 +18,6 @@ import java.util.List;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorName;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitName;
|
import org.eclipse.cdt.core.dom.ast.IASTImplicitName;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
|
@ -29,7 +27,6 @@ import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
|
import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.Value;
|
import org.eclipse.cdt.internal.core.dom.parser.Value;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics;
|
||||||
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.EvalFixed;
|
||||||
|
|
||||||
|
|
||||||
|
@ -41,7 +38,6 @@ public class CPPASTDeleteExpression extends ASTNode implements ICPPASTDeleteExpr
|
||||||
private boolean isVectored;
|
private boolean isVectored;
|
||||||
|
|
||||||
private IASTImplicitName[] implicitNames;
|
private IASTImplicitName[] implicitNames;
|
||||||
private IASTImplicitDestructorName[] fImplicitDestructorNames;
|
|
||||||
|
|
||||||
public CPPASTDeleteExpression() {
|
public CPPASTDeleteExpression() {
|
||||||
}
|
}
|
||||||
|
@ -106,12 +102,12 @@ public class CPPASTDeleteExpression extends ASTNode implements ICPPASTDeleteExpr
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tries to resolve both the destructor and operator delete.
|
* Try to resolve both the destructor and operator delete.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public IASTImplicitName[] getImplicitNames() {
|
public IASTImplicitName[] getImplicitNames() {
|
||||||
if (implicitNames == null) {
|
if (implicitNames == null) {
|
||||||
List<IASTImplicitName> names = new ArrayList<>();
|
List<IASTImplicitName> names = new ArrayList<IASTImplicitName>();
|
||||||
|
|
||||||
if (!isVectored) {
|
if (!isVectored) {
|
||||||
ICPPFunction destructor = CPPSemantics.findImplicitlyCalledDestructor(this);
|
ICPPFunction destructor = CPPSemantics.findImplicitlyCalledDestructor(this);
|
||||||
|
@ -144,15 +140,6 @@ public class CPPASTDeleteExpression extends ASTNode implements ICPPASTDeleteExpr
|
||||||
return implicitNames;
|
return implicitNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public IASTImplicitDestructorName[] getImplicitDestructorNames() {
|
|
||||||
if (fImplicitDestructorNames == null) {
|
|
||||||
fImplicitDestructorNames = CPPVisitor.getTemporariesDestructorCalls(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
return fImplicitDestructorNames;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean accept(ASTVisitor action) {
|
public boolean accept(ASTVisitor action) {
|
||||||
if (action.shouldVisitExpressions) {
|
if (action.shouldVisitExpressions) {
|
||||||
|
@ -173,9 +160,6 @@ public class CPPASTDeleteExpression extends ASTNode implements ICPPASTDeleteExpr
|
||||||
if (operand != null && !operand.accept(action))
|
if (operand != null && !operand.accept(action))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (action.shouldVisitImplicitDestructorNames && !acceptByNodes(fImplicitDestructorNames, action))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (action.shouldVisitExpressions) {
|
if (action.shouldVisitExpressions) {
|
||||||
switch (action.leave(this)) {
|
switch (action.leave(this)) {
|
||||||
case ASTVisitor.PROCESS_ABORT: return false;
|
case ASTVisitor.PROCESS_ABORT: return false;
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* John Camelon (IBM) - Initial API and implementation
|
* John Camelon (IBM) - Initial API and implementation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
|
@ -33,7 +33,8 @@ public class CPPASTEqualsInitializer extends ASTEqualsInitializer {
|
||||||
@Override
|
@Override
|
||||||
public CPPASTEqualsInitializer copy(CopyStyle style) {
|
public CPPASTEqualsInitializer copy(CopyStyle style) {
|
||||||
IASTInitializerClause arg = getInitializerClause();
|
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);
|
return copy(copy, style);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2015 IBM Corporation and others.
|
* Copyright (c) 2004, 2011 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -9,7 +9,6 @@
|
||||||
* John Camelon (IBM) - Initial API and implementation
|
* John Camelon (IBM) - Initial API and implementation
|
||||||
* Mike Kucera (IBM) - implicit names
|
* Mike Kucera (IBM) - implicit names
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
* Sergey Prigogin (Google)
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
|
@ -17,7 +16,6 @@ import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorName;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitName;
|
import org.eclipse.cdt.core.dom.ast.IASTImplicitName;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
|
@ -27,20 +25,18 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
|
||||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
|
import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalComma;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalComma;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalFixed;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalFixed;
|
||||||
|
|
||||||
public class CPPASTExpressionList extends ASTNode implements ICPPASTExpressionList, IASTAmbiguityParent {
|
public class CPPASTExpressionList extends ASTNode implements ICPPASTExpressionList, IASTAmbiguityParent {
|
||||||
|
|
||||||
private IASTExpression[] expressions = new IASTExpression[2];
|
private IASTExpression[] expressions = new IASTExpression[2];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Caution: may contain nulls.
|
* Caution: may contain nulls.
|
||||||
* @see #computeImplicitNames
|
* @see CPPASTExpressionList#computeImplicitNames
|
||||||
*/
|
*/
|
||||||
private IASTImplicitName[] fImplicitNames;
|
private IASTImplicitName[] implicitNames;
|
||||||
|
|
||||||
private IASTImplicitDestructorName[] fImplicitDestructorNames;
|
|
||||||
|
|
||||||
private ICPPEvaluation fEvaluation;
|
private ICPPEvaluation fEvaluation;
|
||||||
|
|
||||||
|
@ -52,9 +48,8 @@ public class CPPASTExpressionList extends ASTNode implements ICPPASTExpressionLi
|
||||||
@Override
|
@Override
|
||||||
public CPPASTExpressionList copy(CopyStyle style) {
|
public CPPASTExpressionList copy(CopyStyle style) {
|
||||||
CPPASTExpressionList copy = new CPPASTExpressionList();
|
CPPASTExpressionList copy = new CPPASTExpressionList();
|
||||||
for (IASTExpression expr : getExpressions()) {
|
for(IASTExpression expr : getExpressions())
|
||||||
copy.addExpression(expr == null ? null : expr.copy(style));
|
copy.addExpression(expr == null ? null : expr.copy(style));
|
||||||
}
|
|
||||||
return copy(copy, style);
|
return copy(copy, style);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,9 +93,6 @@ public class CPPASTExpressionList extends ASTNode implements ICPPASTExpressionLi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action.shouldVisitImplicitDestructorNames && !acceptByNodes(fImplicitDestructorNames, action))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (action.shouldVisitExpressions) {
|
if (action.shouldVisitExpressions) {
|
||||||
switch (action.leave(this)) {
|
switch (action.leave(this)) {
|
||||||
case ASTVisitor.PROCESS_ABORT: return false;
|
case ASTVisitor.PROCESS_ABORT: return false;
|
||||||
|
@ -112,31 +104,32 @@ public class CPPASTExpressionList extends ASTNode implements ICPPASTExpressionLi
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an array of implicit names where each element of the array represents a comma between
|
* Returns an array of implicit names where each element of the array
|
||||||
* the expression in the same index and the next expression. This array contains null elements
|
* represents a comma between the expression in the same index and the
|
||||||
* as placeholders for commas that do not resolve to overloaded operators.
|
* next expression. This array contains null elements as placeholders
|
||||||
|
* for commas that do not resolve to overloaded operators.
|
||||||
*/
|
*/
|
||||||
private IASTImplicitName[] computeImplicitNames() {
|
private IASTImplicitName[] computeImplicitNames() {
|
||||||
if (fImplicitNames == null) {
|
if (implicitNames == null) {
|
||||||
IASTExpression[] exprs = getExpressions(); // has to be at least two
|
IASTExpression[] exprs = getExpressions(); // has to be at least two
|
||||||
if (exprs.length < 2)
|
if (exprs.length < 2)
|
||||||
return fImplicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
|
return implicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
|
||||||
|
|
||||||
fImplicitNames = new IASTImplicitName[exprs.length - 1];
|
implicitNames = new IASTImplicitName[exprs.length - 1];
|
||||||
|
|
||||||
ICPPFunction[] overloads = getOverloads();
|
ICPPFunction[] overloads = getOverloads();
|
||||||
for (int i = 0; i < overloads.length; i++) {
|
for(int i = 0; i < overloads.length; i++) {
|
||||||
ICPPFunction overload = overloads[i];
|
ICPPFunction overload = overloads[i];
|
||||||
if (overload != null && !(overload instanceof CPPImplicitFunction)) {
|
if (overload != null && !(overload instanceof CPPImplicitFunction)) {
|
||||||
CPPASTImplicitName operatorName = new CPPASTImplicitName(OverloadableOperator.COMMA, this);
|
CPPASTImplicitName operatorName = new CPPASTImplicitName(OverloadableOperator.COMMA, this);
|
||||||
operatorName.setBinding(overload);
|
operatorName.setBinding(overload);
|
||||||
operatorName.computeOperatorOffsets(exprs[i], true);
|
operatorName.computeOperatorOffsets(exprs[i], true);
|
||||||
fImplicitNames[i] = operatorName;
|
implicitNames[i] = operatorName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return fImplicitNames;
|
return implicitNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -144,15 +137,6 @@ public class CPPASTExpressionList extends ASTNode implements ICPPASTExpressionLi
|
||||||
return ArrayUtil.removeNulls(IASTImplicitName.class, computeImplicitNames());
|
return ArrayUtil.removeNulls(IASTImplicitName.class, computeImplicitNames());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public IASTImplicitDestructorName[] getImplicitDestructorNames() {
|
|
||||||
if (fImplicitDestructorNames == null) {
|
|
||||||
fImplicitDestructorNames = CPPVisitor.getTemporariesDestructorCalls(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
return fImplicitDestructorNames;
|
|
||||||
}
|
|
||||||
|
|
||||||
private ICPPFunction[] getOverloads() {
|
private ICPPFunction[] getOverloads() {
|
||||||
ICPPEvaluation eval = getEvaluation();
|
ICPPEvaluation eval = getEvaluation();
|
||||||
if (eval instanceof EvalComma) {
|
if (eval instanceof EvalComma) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2015 IBM Corporation and others.
|
* Copyright (c) 2004, 2011 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -10,7 +10,6 @@
|
||||||
* Bryan Wilkinson (QNX)
|
* Bryan Wilkinson (QNX)
|
||||||
* Mike Kucera (IBM)
|
* Mike Kucera (IBM)
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
* Sergey Prigogin (Google)
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
|
@ -22,7 +21,6 @@ import java.util.List;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.DOMException;
|
import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorName;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitName;
|
import org.eclipse.cdt.core.dom.ast.IASTImplicitName;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
|
@ -45,20 +43,18 @@ import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPFunctionSet;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPFunctionSet;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPTemplates;
|
||||||
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.EvalFixed;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalID;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalID;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalMemberAccess;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalMemberAccess;
|
||||||
|
|
||||||
public class CPPASTFieldReference extends ASTNode
|
public class CPPASTFieldReference extends ASTNode
|
||||||
implements ICPPASTFieldReference, IASTAmbiguityParent, ICPPASTCompletionContext {
|
implements ICPPASTFieldReference, IASTAmbiguityParent, ICPPASTCompletionContext {
|
||||||
private boolean fIsTemplate;
|
private boolean isTemplate;
|
||||||
private boolean fIsDeref;
|
private ICPPASTExpression owner;
|
||||||
private ICPPASTExpression fOwner;
|
private IASTName name;
|
||||||
private IASTName fName;
|
private boolean isDeref;
|
||||||
private IASTImplicitName[] fImplicitNames;
|
private IASTImplicitName[] implicitNames;
|
||||||
private ICPPEvaluation fEvaluation;
|
private ICPPEvaluation fEvaluation;
|
||||||
private IASTImplicitDestructorName[] fImplicitDestructorNames;
|
|
||||||
|
|
||||||
public CPPASTFieldReference() {
|
public CPPASTFieldReference() {
|
||||||
}
|
}
|
||||||
|
@ -76,33 +72,33 @@ public class CPPASTFieldReference extends ASTNode
|
||||||
@Override
|
@Override
|
||||||
public CPPASTFieldReference copy(CopyStyle style) {
|
public CPPASTFieldReference copy(CopyStyle style) {
|
||||||
CPPASTFieldReference copy = new CPPASTFieldReference();
|
CPPASTFieldReference copy = new CPPASTFieldReference();
|
||||||
copy.setFieldName(fName == null ? null : fName.copy(style));
|
copy.setFieldName(name == null ? null : name.copy(style));
|
||||||
copy.setFieldOwner(fOwner == null ? null : fOwner.copy(style));
|
copy.setFieldOwner(owner == null ? null : owner.copy(style));
|
||||||
copy.fIsTemplate = fIsTemplate;
|
copy.isTemplate = isTemplate;
|
||||||
copy.fIsDeref = fIsDeref;
|
copy.isDeref = isDeref;
|
||||||
return copy(copy, style);
|
return copy(copy, style);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isTemplate() {
|
public boolean isTemplate() {
|
||||||
return fIsTemplate;
|
return isTemplate;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setIsTemplate(boolean value) {
|
public void setIsTemplate(boolean value) {
|
||||||
assertNotFrozen();
|
assertNotFrozen();
|
||||||
fIsTemplate = value;
|
isTemplate = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ICPPASTExpression getFieldOwner() {
|
public ICPPASTExpression getFieldOwner() {
|
||||||
return fOwner;
|
return owner;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setFieldOwner(IASTExpression expression) {
|
public void setFieldOwner(IASTExpression expression) {
|
||||||
assertNotFrozen();
|
assertNotFrozen();
|
||||||
fOwner = (ICPPASTExpression) expression;
|
owner = (ICPPASTExpression) expression;
|
||||||
if (expression != null) {
|
if (expression != null) {
|
||||||
expression.setParent(this);
|
expression.setParent(this);
|
||||||
expression.setPropertyInParent(FIELD_OWNER);
|
expression.setPropertyInParent(FIELD_OWNER);
|
||||||
|
@ -111,13 +107,13 @@ public class CPPASTFieldReference extends ASTNode
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IASTName getFieldName() {
|
public IASTName getFieldName() {
|
||||||
return fName;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setFieldName(IASTName name) {
|
public void setFieldName(IASTName name) {
|
||||||
assertNotFrozen();
|
assertNotFrozen();
|
||||||
this.fName = name;
|
this.name = name;
|
||||||
if (name != null) {
|
if (name != null) {
|
||||||
name.setParent(this);
|
name.setParent(this);
|
||||||
name.setPropertyInParent(FIELD_NAME);
|
name.setPropertyInParent(FIELD_NAME);
|
||||||
|
@ -126,51 +122,42 @@ public class CPPASTFieldReference extends ASTNode
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isPointerDereference() {
|
public boolean isPointerDereference() {
|
||||||
return fIsDeref;
|
return isDeref;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setIsPointerDereference(boolean value) {
|
public void setIsPointerDereference(boolean value) {
|
||||||
assertNotFrozen();
|
assertNotFrozen();
|
||||||
fIsDeref = value;
|
isDeref = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IASTImplicitName[] getImplicitNames() {
|
public IASTImplicitName[] getImplicitNames() {
|
||||||
if (fImplicitNames == null) {
|
if (implicitNames == null) {
|
||||||
if (!fIsDeref)
|
if (!isDeref)
|
||||||
return fImplicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
|
return implicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
|
||||||
|
|
||||||
// Collect the function bindings
|
// Collect the function bindings
|
||||||
List<ICPPFunction> functionBindings = new ArrayList<ICPPFunction>();
|
List<ICPPFunction> functionBindings = new ArrayList<ICPPFunction>();
|
||||||
EvalMemberAccess.getFieldOwnerType(fOwner.getExpressionType(), fIsDeref, this, functionBindings, false);
|
EvalMemberAccess.getFieldOwnerType(owner.getExpressionType(), isDeref, this, functionBindings, false);
|
||||||
if (functionBindings.isEmpty())
|
if (functionBindings.isEmpty())
|
||||||
return fImplicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
|
return implicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
|
||||||
|
|
||||||
// Create a name to wrap each binding
|
// Create a name to wrap each binding
|
||||||
fImplicitNames = new IASTImplicitName[functionBindings.size()];
|
implicitNames = new IASTImplicitName[functionBindings.size()];
|
||||||
int i= -1;
|
int i= -1;
|
||||||
for (ICPPFunction op : functionBindings) {
|
for (ICPPFunction op : functionBindings) {
|
||||||
if (op != null && !(op instanceof CPPImplicitFunction)) {
|
if (op != null && !(op instanceof CPPImplicitFunction)) {
|
||||||
CPPASTImplicitName operatorName = new CPPASTImplicitName(OverloadableOperator.ARROW, this);
|
CPPASTImplicitName operatorName = new CPPASTImplicitName(OverloadableOperator.ARROW, this);
|
||||||
operatorName.setBinding(op);
|
operatorName.setBinding(op);
|
||||||
operatorName.computeOperatorOffsets(fOwner, true);
|
operatorName.computeOperatorOffsets(owner, true);
|
||||||
fImplicitNames[++i] = operatorName;
|
implicitNames[++i] = operatorName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fImplicitNames= ArrayUtil.trimAt(IASTImplicitName.class, fImplicitNames, i);
|
implicitNames= ArrayUtil.trimAt(IASTImplicitName.class, implicitNames, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
return fImplicitNames;
|
return implicitNames;
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IASTImplicitDestructorName[] getImplicitDestructorNames() {
|
|
||||||
if (fImplicitDestructorNames == null) {
|
|
||||||
fImplicitDestructorNames = CPPVisitor.getTemporariesDestructorCalls(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
return fImplicitDestructorNames;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -183,7 +170,7 @@ public class CPPASTFieldReference extends ASTNode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fOwner != null && !fOwner.accept(action))
|
if (owner != null && !owner.accept(action))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (action.shouldVisitImplicitNames) {
|
if (action.shouldVisitImplicitNames) {
|
||||||
|
@ -193,10 +180,7 @@ public class CPPASTFieldReference extends ASTNode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fName != null && !fName.accept(action))
|
if (name != null && !name.accept(action))
|
||||||
return false;
|
|
||||||
|
|
||||||
if (action.shouldVisitImplicitDestructorNames && !acceptByNodes(fImplicitDestructorNames, action))
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (action.shouldVisitExpressions) {
|
if (action.shouldVisitExpressions) {
|
||||||
|
@ -211,17 +195,17 @@ public class CPPASTFieldReference extends ASTNode
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getRoleForName(IASTName n) {
|
public int getRoleForName(IASTName n) {
|
||||||
if (n == fName)
|
if (n == name)
|
||||||
return r_reference;
|
return r_reference;
|
||||||
return r_unclear;
|
return r_unclear;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void replace(IASTNode child, IASTNode other) {
|
public void replace(IASTNode child, IASTNode other) {
|
||||||
if (child == fOwner) {
|
if (child == owner) {
|
||||||
other.setPropertyInParent(child.getPropertyInParent());
|
other.setPropertyInParent(child.getPropertyInParent());
|
||||||
other.setParent(child.getParent());
|
other.setParent(child.getParent());
|
||||||
fOwner = (ICPPASTExpression) other;
|
owner = (ICPPASTExpression) other;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -254,7 +238,7 @@ public class CPPASTFieldReference extends ASTNode
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public IType getFieldOwnerType() {
|
public IType getFieldOwnerType() {
|
||||||
return EvalMemberAccess.getFieldOwnerType(fOwner.getExpressionType(), fIsDeref, this, null, true);
|
return EvalMemberAccess.getFieldOwnerType(owner.getExpressionType(), isDeref, this, null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -266,24 +250,24 @@ public class CPPASTFieldReference extends ASTNode
|
||||||
}
|
}
|
||||||
|
|
||||||
private ICPPEvaluation createEvaluation() {
|
private ICPPEvaluation createEvaluation() {
|
||||||
ICPPEvaluation ownerEval = fOwner.getEvaluation();
|
ICPPEvaluation ownerEval = owner.getEvaluation();
|
||||||
if (!ownerEval.isTypeDependent()) {
|
if (!ownerEval.isTypeDependent()) {
|
||||||
IType ownerType= EvalMemberAccess.getFieldOwnerType(ownerEval.getTypeOrFunctionSet(this), fIsDeref, this, null, false);
|
IType ownerType= EvalMemberAccess.getFieldOwnerType(ownerEval.getTypeOrFunctionSet(this), isDeref, this, null, false);
|
||||||
if (ownerType != null) {
|
if (ownerType != null) {
|
||||||
IBinding binding = fName.resolvePreBinding();
|
IBinding binding = name.resolvePreBinding();
|
||||||
if (binding instanceof CPPFunctionSet)
|
if (binding instanceof CPPFunctionSet)
|
||||||
binding= fName.resolveBinding();
|
binding= name.resolveBinding();
|
||||||
|
|
||||||
if (binding instanceof IProblemBinding || binding instanceof IType || binding instanceof ICPPConstructor)
|
if (binding instanceof IProblemBinding || binding instanceof IType || binding instanceof ICPPConstructor)
|
||||||
return EvalFixed.INCOMPLETE;
|
return EvalFixed.INCOMPLETE;
|
||||||
|
|
||||||
return new EvalMemberAccess(ownerType, ownerEval.getValueCategory(this), binding, fIsDeref, this);
|
return new EvalMemberAccess(ownerType, ownerEval.getValueCategory(this), binding, isDeref, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IBinding qualifier= null;
|
IBinding qualifier= null;
|
||||||
ICPPTemplateArgument[] args= null;
|
ICPPTemplateArgument[] args= null;
|
||||||
IASTName n= fName;
|
IASTName n= name;
|
||||||
if (n instanceof ICPPASTQualifiedName) {
|
if (n instanceof ICPPASTQualifiedName) {
|
||||||
ICPPASTQualifiedName qn= (ICPPASTQualifiedName) n;
|
ICPPASTQualifiedName qn= (ICPPASTQualifiedName) n;
|
||||||
ICPPASTNameSpecifier[] ns= qn.getQualifier();
|
ICPPASTNameSpecifier[] ns= qn.getQualifier();
|
||||||
|
@ -301,7 +285,7 @@ public class CPPASTFieldReference extends ASTNode
|
||||||
return EvalFixed.INCOMPLETE;
|
return EvalFixed.INCOMPLETE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new EvalID(ownerEval, qualifier, fName.getSimpleID(), false, true, args, this);
|
return new EvalID(ownerEval, qualifier, name.getSimpleID(), false, true, args, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2015 IBM Corporation and others.
|
* Copyright (c) 2004, 2012 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -9,7 +9,6 @@
|
||||||
* John Camelon (IBM) - Initial API and implementation
|
* John Camelon (IBM) - Initial API and implementation
|
||||||
* Mike Kucera (IBM) - implicit names
|
* Mike Kucera (IBM) - implicit names
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
* Sergey Prigogin (Google)
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
|
@ -24,7 +23,6 @@ import org.eclipse.cdt.core.dom.ast.DOMException;
|
||||||
import org.eclipse.cdt.core.dom.ast.ExpansionOverlapsBoundaryException;
|
import org.eclipse.cdt.core.dom.ast.ExpansionOverlapsBoundaryException;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTIdExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTIdExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorName;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitName;
|
import org.eclipse.cdt.core.dom.ast.IASTImplicitName;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTInitializerClause;
|
import org.eclipse.cdt.core.dom.ast.IASTInitializerClause;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||||
|
@ -36,14 +34,12 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExpressionList;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionCallExpression;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionCallExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTInitializerClause;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTInitializerClause;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
|
||||||
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.ICPPFunction;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPMethod;
|
||||||
import org.eclipse.cdt.core.parser.IToken;
|
import org.eclipse.cdt.core.parser.IToken;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
|
import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics;
|
||||||
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.EvalFixed;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalFunctionCall;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalFunctionCall;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalTypeId;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalTypeId;
|
||||||
|
@ -51,12 +47,11 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.LookupData;
|
||||||
|
|
||||||
public class CPPASTFunctionCallExpression extends ASTNode
|
public class CPPASTFunctionCallExpression extends ASTNode
|
||||||
implements ICPPASTFunctionCallExpression, IASTAmbiguityParent {
|
implements ICPPASTFunctionCallExpression, IASTAmbiguityParent {
|
||||||
private ICPPASTExpression fFunctionName;
|
private ICPPASTExpression functionName;
|
||||||
private IASTInitializerClause[] fArguments;
|
private IASTInitializerClause[] fArguments;
|
||||||
|
|
||||||
private IASTImplicitName[] fImplicitNames;
|
private IASTImplicitName[] implicitNames;
|
||||||
private ICPPEvaluation fEvaluation;
|
private ICPPEvaluation evaluation;
|
||||||
private IASTImplicitDestructorName[] fImplicitDestructorNames;
|
|
||||||
|
|
||||||
public CPPASTFunctionCallExpression() {
|
public CPPASTFunctionCallExpression() {
|
||||||
setArguments(null);
|
setArguments(null);
|
||||||
|
@ -83,19 +78,19 @@ public class CPPASTFunctionCallExpression extends ASTNode
|
||||||
}
|
}
|
||||||
|
|
||||||
CPPASTFunctionCallExpression copy = new CPPASTFunctionCallExpression(null, args);
|
CPPASTFunctionCallExpression copy = new CPPASTFunctionCallExpression(null, args);
|
||||||
copy.setFunctionNameExpression(fFunctionName == null ? null : fFunctionName.copy(style));
|
copy.setFunctionNameExpression(functionName == null ? null : functionName.copy(style));
|
||||||
return copy(copy, style);
|
return copy(copy, style);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IASTExpression getFunctionNameExpression() {
|
public IASTExpression getFunctionNameExpression() {
|
||||||
return fFunctionName;
|
return functionName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setFunctionNameExpression(IASTExpression expression) {
|
public void setFunctionNameExpression(IASTExpression expression) {
|
||||||
assertNotFrozen();
|
assertNotFrozen();
|
||||||
this.fFunctionName = (ICPPASTExpression) expression;
|
this.functionName = (ICPPASTExpression) expression;
|
||||||
if (expression != null) {
|
if (expression != null) {
|
||||||
expression.setParent(this);
|
expression.setParent(this);
|
||||||
expression.setPropertyInParent(FUNCTION_NAME);
|
expression.setPropertyInParent(FUNCTION_NAME);
|
||||||
|
@ -123,21 +118,21 @@ public class CPPASTFunctionCallExpression extends ASTNode
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IASTImplicitName[] getImplicitNames() {
|
public IASTImplicitName[] getImplicitNames() {
|
||||||
if (fImplicitNames == null) {
|
if (implicitNames == null) {
|
||||||
ICPPFunction overload = getOverload();
|
ICPPFunction overload = getOverload();
|
||||||
if (overload == null)
|
if (overload == null)
|
||||||
return fImplicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
|
return implicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
|
||||||
|
|
||||||
if (getEvaluation() instanceof EvalTypeId) {
|
if (getEvaluation() instanceof EvalTypeId) {
|
||||||
CPPASTImplicitName n1 = new CPPASTImplicitName(overload.getNameCharArray(), this);
|
CPPASTImplicitName n1 = new CPPASTImplicitName(overload.getNameCharArray(), this);
|
||||||
n1.setOffsetAndLength((ASTNode) fFunctionName);
|
n1.setOffsetAndLength((ASTNode) functionName);
|
||||||
n1.setBinding(overload);
|
n1.setBinding(overload);
|
||||||
return fImplicitNames= new IASTImplicitName[] {n1};
|
return implicitNames= new IASTImplicitName[] {n1};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (overload instanceof CPPImplicitFunction) {
|
if (overload instanceof CPPImplicitFunction) {
|
||||||
if (!(overload instanceof ICPPMethod) || ((ICPPMethod) overload).isImplicit()) {
|
if (!(overload instanceof ICPPMethod) || ((ICPPMethod) overload).isImplicit()) {
|
||||||
return fImplicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
|
return implicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,9 +145,9 @@ public class CPPASTFunctionCallExpression extends ASTNode
|
||||||
n2.setAlternate(true);
|
n2.setAlternate(true);
|
||||||
|
|
||||||
if (fArguments.length == 0) {
|
if (fArguments.length == 0) {
|
||||||
int idEndOffset = ((ASTNode) fFunctionName).getOffset() + ((ASTNode) fFunctionName).getLength();
|
int idEndOffset = ((ASTNode) functionName).getOffset() + ((ASTNode) functionName).getLength();
|
||||||
try {
|
try {
|
||||||
IToken lparen = fFunctionName.getTrailingSyntax();
|
IToken lparen = functionName.getTrailingSyntax();
|
||||||
IToken rparen = lparen.getNext();
|
IToken rparen = lparen.getNext();
|
||||||
|
|
||||||
if (lparen.getType() == IToken.tLPAREN) {
|
if (lparen.getType() == IToken.tLPAREN) {
|
||||||
|
@ -171,24 +166,15 @@ public class CPPASTFunctionCallExpression extends ASTNode
|
||||||
n2.setOffsetAndLength(idEndOffset, 0);
|
n2.setOffsetAndLength(idEndOffset, 0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
n1.computeOperatorOffsets(fFunctionName, true);
|
n1.computeOperatorOffsets(functionName, true);
|
||||||
n2.computeOperatorOffsets(fArguments[fArguments.length - 1], true);
|
n2.computeOperatorOffsets(fArguments[fArguments.length - 1], true);
|
||||||
}
|
}
|
||||||
|
|
||||||
fImplicitNames = new IASTImplicitName[] { n1, n2 };
|
implicitNames = new IASTImplicitName[] { n1, n2 };
|
||||||
}
|
}
|
||||||
return fImplicitNames;
|
return implicitNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public IASTImplicitDestructorName[] getImplicitDestructorNames() {
|
|
||||||
if (fImplicitDestructorNames == null) {
|
|
||||||
fImplicitDestructorNames = CPPVisitor.getTemporariesDestructorCalls(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
return fImplicitDestructorNames;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean accept(ASTVisitor action) {
|
public boolean accept(ASTVisitor action) {
|
||||||
if (action.shouldVisitExpressions) {
|
if (action.shouldVisitExpressions) {
|
||||||
|
@ -199,7 +185,7 @@ public class CPPASTFunctionCallExpression extends ASTNode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fFunctionName != null && !fFunctionName.accept(action))
|
if (functionName != null && !functionName.accept(action))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
IASTImplicitName[] implicits = action.shouldVisitImplicitNames ? getImplicitNames() : null;
|
IASTImplicitName[] implicits = action.shouldVisitImplicitNames ? getImplicitNames() : null;
|
||||||
|
@ -215,9 +201,6 @@ public class CPPASTFunctionCallExpression extends ASTNode
|
||||||
if (implicits != null && implicits.length > 1 && !implicits[1].accept(action))
|
if (implicits != null && implicits.length > 1 && !implicits[1].accept(action))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (action.shouldVisitImplicitDestructorNames && !acceptByNodes(fImplicitDestructorNames, action))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (action.shouldVisitExpressions && action.leave(this) == ASTVisitor.PROCESS_ABORT)
|
if (action.shouldVisitExpressions && action.leave(this) == ASTVisitor.PROCESS_ABORT)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -226,10 +209,10 @@ public class CPPASTFunctionCallExpression extends ASTNode
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void replace(IASTNode child, IASTNode other) {
|
public void replace(IASTNode child, IASTNode other) {
|
||||||
if (child == fFunctionName) {
|
if (child == functionName) {
|
||||||
other.setPropertyInParent(child.getPropertyInParent());
|
other.setPropertyInParent(child.getPropertyInParent());
|
||||||
other.setParent(child.getParent());
|
other.setParent(child.getParent());
|
||||||
fFunctionName = (ICPPASTExpression) other;
|
functionName = (ICPPASTExpression) other;
|
||||||
}
|
}
|
||||||
for (int i = 0; i < fArguments.length; ++i) {
|
for (int i = 0; i < fArguments.length; ++i) {
|
||||||
if (child == fArguments[i]) {
|
if (child == fArguments[i]) {
|
||||||
|
@ -240,8 +223,8 @@ public class CPPASTFunctionCallExpression extends ASTNode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public IASTExpression getParameterExpression() {
|
public IASTExpression getParameterExpression() {
|
||||||
if (fArguments.length == 0)
|
if (fArguments.length == 0)
|
||||||
return null;
|
return null;
|
||||||
|
@ -263,8 +246,8 @@ public class CPPASTFunctionCallExpression extends ASTNode
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public void setParameterExpression(IASTExpression expression) {
|
public void setParameterExpression(IASTExpression expression) {
|
||||||
assertNotFrozen();
|
assertNotFrozen();
|
||||||
if (expression == null) {
|
if (expression == null) {
|
||||||
|
@ -287,10 +270,9 @@ public class CPPASTFunctionCallExpression extends ASTNode
|
||||||
IType t= getNestedType(((EvalTypeId) eval).getInputType(), TDEF | CVTYPE | REF);
|
IType t= getNestedType(((EvalTypeId) eval).getInputType(), TDEF | CVTYPE | REF);
|
||||||
if (t instanceof ICPPClassType && !(t instanceof ICPPUnknownBinding)) {
|
if (t instanceof ICPPClassType && !(t instanceof ICPPUnknownBinding)) {
|
||||||
ICPPClassType cls= (ICPPClassType) t;
|
ICPPClassType cls= (ICPPClassType) t;
|
||||||
LookupData data= CPPSemantics.createLookupData(((IASTIdExpression) fFunctionName).getName());
|
LookupData data= CPPSemantics.createLookupData(((IASTIdExpression) functionName).getName());
|
||||||
try {
|
try {
|
||||||
ICPPConstructor[] constructors = ClassTypeHelper.getConstructors(cls, data.getLookupPoint());
|
IBinding b= CPPSemantics.resolveFunction(data, ClassTypeHelper.getConstructors(cls, data.getLookupPoint()), true);
|
||||||
IBinding b= CPPSemantics.resolveFunction(data, constructors, true);
|
|
||||||
if (b instanceof ICPPFunction)
|
if (b instanceof ICPPFunction)
|
||||||
return (ICPPFunction) b;
|
return (ICPPFunction) b;
|
||||||
} catch (DOMException e) {
|
} catch (DOMException e) {
|
||||||
|
@ -303,14 +285,14 @@ public class CPPASTFunctionCallExpression extends ASTNode
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ICPPEvaluation getEvaluation() {
|
public ICPPEvaluation getEvaluation() {
|
||||||
if (fEvaluation == null)
|
if (evaluation == null)
|
||||||
fEvaluation= computeEvaluation();
|
evaluation= computeEvaluation();
|
||||||
|
|
||||||
return fEvaluation;
|
return evaluation;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ICPPEvaluation computeEvaluation() {
|
private ICPPEvaluation computeEvaluation() {
|
||||||
if (fFunctionName == null || fArguments == null)
|
if (functionName == null || fArguments == null)
|
||||||
return EvalFixed.INCOMPLETE;
|
return EvalFixed.INCOMPLETE;
|
||||||
|
|
||||||
ICPPEvaluation conversion= checkForExplicitTypeConversion();
|
ICPPEvaluation conversion= checkForExplicitTypeConversion();
|
||||||
|
@ -318,7 +300,7 @@ public class CPPASTFunctionCallExpression extends ASTNode
|
||||||
return conversion;
|
return conversion;
|
||||||
|
|
||||||
ICPPEvaluation[] args= new ICPPEvaluation[fArguments.length + 1];
|
ICPPEvaluation[] args= new ICPPEvaluation[fArguments.length + 1];
|
||||||
args[0]= fFunctionName.getEvaluation();
|
args[0]= functionName.getEvaluation();
|
||||||
for (int i = 1; i < args.length; i++) {
|
for (int i = 1; i < args.length; i++) {
|
||||||
args[i]= ((ICPPASTInitializerClause) fArguments[i - 1]).getEvaluation();
|
args[i]= ((ICPPASTInitializerClause) fArguments[i - 1]).getEvaluation();
|
||||||
}
|
}
|
||||||
|
@ -326,8 +308,8 @@ public class CPPASTFunctionCallExpression extends ASTNode
|
||||||
}
|
}
|
||||||
|
|
||||||
private ICPPEvaluation checkForExplicitTypeConversion() {
|
private ICPPEvaluation checkForExplicitTypeConversion() {
|
||||||
if (fFunctionName instanceof IASTIdExpression) {
|
if (functionName instanceof IASTIdExpression) {
|
||||||
final IASTName name = ((IASTIdExpression) fFunctionName).getName();
|
final IASTName name = ((IASTIdExpression) functionName).getName();
|
||||||
IBinding b= name.resolvePreBinding();
|
IBinding b= name.resolvePreBinding();
|
||||||
if (b instanceof IType) {
|
if (b instanceof IType) {
|
||||||
ICPPEvaluation[] args= new ICPPEvaluation[fArguments.length];
|
ICPPEvaluation[] args= new ICPPEvaluation[fArguments.length];
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2015 IBM Corporation and others.
|
* Copyright (c) 2004, 2011 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -9,7 +9,6 @@
|
||||||
* John Camelon (IBM) - Initial API and implementation
|
* John Camelon (IBM) - Initial API and implementation
|
||||||
* Bryan Wilkinson (QNX)
|
* Bryan Wilkinson (QNX)
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
* Sergey Prigogin (Google)
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
|
@ -17,7 +16,6 @@ import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTIdExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTIdExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorName;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
import org.eclipse.cdt.core.dom.ast.ICPPASTCompletionContext;
|
import org.eclipse.cdt.core.dom.ast.ICPPASTCompletionContext;
|
||||||
|
@ -27,16 +25,13 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExpression;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ProblemType;
|
import org.eclipse.cdt.internal.core.dom.parser.ProblemType;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPSemantics;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalID;
|
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.FunctionSetType;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.SemanticUtil;
|
||||||
|
|
||||||
public class CPPASTIdExpression extends ASTNode
|
public class CPPASTIdExpression extends ASTNode implements IASTIdExpression, ICPPASTExpression, ICPPASTCompletionContext {
|
||||||
implements IASTIdExpression, ICPPASTExpression, ICPPASTCompletionContext {
|
private IASTName name;
|
||||||
private IASTName fName;
|
|
||||||
private ICPPEvaluation fEvaluation;
|
private ICPPEvaluation fEvaluation;
|
||||||
private IASTImplicitDestructorName[] fImplicitDestructorNames;
|
|
||||||
|
|
||||||
public CPPASTIdExpression() {
|
public CPPASTIdExpression() {
|
||||||
}
|
}
|
||||||
|
@ -52,34 +47,25 @@ public class CPPASTIdExpression extends ASTNode
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CPPASTIdExpression copy(CopyStyle style) {
|
public CPPASTIdExpression copy(CopyStyle style) {
|
||||||
CPPASTIdExpression copy = new CPPASTIdExpression(fName == null ? null : fName.copy(style));
|
CPPASTIdExpression copy = new CPPASTIdExpression(name == null ? null : name.copy(style));
|
||||||
return copy(copy, style);
|
return copy(copy, style);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IASTName getName() {
|
public IASTName getName() {
|
||||||
return fName;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setName(IASTName name) {
|
public void setName(IASTName name) {
|
||||||
assertNotFrozen();
|
assertNotFrozen();
|
||||||
this.fName = name;
|
this.name = name;
|
||||||
if (name != null) {
|
if (name != null) {
|
||||||
name.setParent(this);
|
name.setParent(this);
|
||||||
name.setPropertyInParent(ID_NAME);
|
name.setPropertyInParent(ID_NAME);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public IASTImplicitDestructorName[] getImplicitDestructorNames() {
|
|
||||||
if (fImplicitDestructorNames == null) {
|
|
||||||
fImplicitDestructorNames = CPPVisitor.getTemporariesDestructorCalls(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
return fImplicitDestructorNames;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean accept(ASTVisitor action) {
|
public boolean accept(ASTVisitor action) {
|
||||||
if (action.shouldVisitExpressions) {
|
if (action.shouldVisitExpressions) {
|
||||||
|
@ -90,10 +76,7 @@ public class CPPASTIdExpression extends ASTNode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fName != null && !fName.accept(action)) return false;
|
if (name != null && !name.accept(action)) return false;
|
||||||
|
|
||||||
if (action.shouldVisitImplicitDestructorNames && !acceptByNodes(fImplicitDestructorNames, action))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (action.shouldVisitExpressions) {
|
if (action.shouldVisitExpressions) {
|
||||||
switch (action.leave(this)) {
|
switch (action.leave(this)) {
|
||||||
|
@ -107,7 +90,7 @@ public class CPPASTIdExpression extends ASTNode
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getRoleForName(IASTName n) {
|
public int getRoleForName(IASTName n) {
|
||||||
if (fName == n)
|
if (name == n)
|
||||||
return r_reference;
|
return r_reference;
|
||||||
return r_unclear;
|
return r_unclear;
|
||||||
}
|
}
|
||||||
|
@ -119,7 +102,7 @@ public class CPPASTIdExpression extends ASTNode
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return fName != null ? fName.toString() : "<unnamed>"; //$NON-NLS-1$
|
return name != null ? name.toString() : "<unnamed>"; //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -139,7 +122,7 @@ public class CPPASTIdExpression extends ASTNode
|
||||||
public IType getExpressionType() {
|
public IType getExpressionType() {
|
||||||
IType type= getEvaluation().getTypeOrFunctionSet(this);
|
IType type= getEvaluation().getTypeOrFunctionSet(this);
|
||||||
if (type instanceof FunctionSetType) {
|
if (type instanceof FunctionSetType) {
|
||||||
IBinding binding= fName.resolveBinding();
|
IBinding binding= name.resolveBinding();
|
||||||
if (binding instanceof IFunction) {
|
if (binding instanceof IFunction) {
|
||||||
return SemanticUtil.mapToAST(((IFunction) binding).getType(), this);
|
return SemanticUtil.mapToAST(((IFunction) binding).getType(), this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,32 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright (c) 2015 Google, Inc 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:
|
|
||||||
* Sergey Prigogin (Google) - initial API and implementation
|
|
||||||
*******************************************************************************/
|
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorName;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorNameOwner;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitName;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
|
||||||
|
|
||||||
|
|
||||||
public class CPPASTImplicitDestructorName extends CPPASTImplicitName implements IASTImplicitDestructorName {
|
|
||||||
private final IASTImplicitName constructionPoint;
|
|
||||||
|
|
||||||
public CPPASTImplicitDestructorName(char[] name, IASTNode parent, IASTImplicitName constructionPoint) {
|
|
||||||
super(name, parent);
|
|
||||||
this.constructionPoint = constructionPoint;
|
|
||||||
setPropertyInParent(IASTImplicitDestructorNameOwner.IMPLICIT_DESTRUCTOR_NAME);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IASTImplicitName getConstructionPoint() {
|
|
||||||
return constructionPoint;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2010, 2015 Wind River Systems, Inc. and others.
|
* Copyright (c) 2010, 2011 Wind River Systems, Inc. and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -7,7 +7,6 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
* Sergey Prigogin (Google)
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
|
@ -15,7 +14,6 @@ import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.PRVALUE;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement;
|
import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorName;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitName;
|
import org.eclipse.cdt.core.dom.ast.IASTImplicitName;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCapture;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTCapture;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDeclarator;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDeclarator;
|
||||||
|
@ -73,6 +71,11 @@ public class CPPASTLambdaExpression extends ASTNode implements ICPPASTLambdaExpr
|
||||||
return copy(copy, style);
|
return copy(copy, style);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IASTImplicitName[] getImplicitNames() {
|
||||||
|
return new IASTImplicitName[] {getFunctionCallOperatorName()};
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IASTImplicitName getClosureTypeName() {
|
public IASTImplicitName getClosureTypeName() {
|
||||||
if (fClosureTypeName == null) {
|
if (fClosureTypeName == null) {
|
||||||
|
@ -106,16 +109,6 @@ public class CPPASTLambdaExpression extends ASTNode implements ICPPASTLambdaExpr
|
||||||
return fImplicitFunctionCallName;
|
return fImplicitFunctionCallName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public IASTImplicitName[] getImplicitNames() {
|
|
||||||
return new IASTImplicitName[] {getFunctionCallOperatorName()};
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IASTImplicitDestructorName[] getImplicitDestructorNames() {
|
|
||||||
return IASTImplicitDestructorName.EMPTY_NAME_ARRAY; // Lambda expression is never a full-expression.
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean accept(ASTVisitor visitor) {
|
public boolean accept(ASTVisitor visitor) {
|
||||||
if (visitor.shouldVisitExpressions) {
|
if (visitor.shouldVisitExpressions) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2015 IBM Corporation and others.
|
* Copyright (c) 2004, 2011 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,7 +8,6 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* John Camelon (IBM) - Initial API and implementation
|
* John Camelon (IBM) - Initial API and implementation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
* Sergey Prigogin (Google)
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
|
@ -16,7 +15,6 @@ import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE;
|
||||||
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.PRVALUE;
|
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.PRVALUE;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorName;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IBasicType;
|
import org.eclipse.cdt.core.dom.ast.IBasicType;
|
||||||
import org.eclipse.cdt.core.dom.ast.IBasicType.Kind;
|
import org.eclipse.cdt.core.dom.ast.IBasicType.Kind;
|
||||||
import org.eclipse.cdt.core.dom.ast.IScope;
|
import org.eclipse.cdt.core.dom.ast.IScope;
|
||||||
|
@ -42,17 +40,17 @@ public class CPPASTLiteralExpression extends ASTNode implements ICPPASTLiteralEx
|
||||||
public static final CPPASTLiteralExpression INT_ZERO =
|
public static final CPPASTLiteralExpression INT_ZERO =
|
||||||
new CPPASTLiteralExpression(lk_integer_constant, new char[] {'0'});
|
new CPPASTLiteralExpression(lk_integer_constant, new char[] {'0'});
|
||||||
|
|
||||||
private int fKind;
|
private int kind;
|
||||||
private char[] fValue = CharArrayUtils.EMPTY;
|
private char[] value = CharArrayUtils.EMPTY;
|
||||||
private int fStringLiteralSize = -1; // Accounting for escape sequences and the null terminator.
|
private int fStringLiteralSize = -1; // accounting for escape sequences and the null terminator
|
||||||
private ICPPEvaluation fEvaluation;
|
private ICPPEvaluation fEvaluation;
|
||||||
|
|
||||||
public CPPASTLiteralExpression() {
|
public CPPASTLiteralExpression() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public CPPASTLiteralExpression(int kind, char[] value) {
|
public CPPASTLiteralExpression(int kind, char[] value) {
|
||||||
this.fKind = kind;
|
this.kind = kind;
|
||||||
this.fValue = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -63,42 +61,37 @@ public class CPPASTLiteralExpression extends ASTNode implements ICPPASTLiteralEx
|
||||||
@Override
|
@Override
|
||||||
public CPPASTLiteralExpression copy(CopyStyle style) {
|
public CPPASTLiteralExpression copy(CopyStyle style) {
|
||||||
CPPASTLiteralExpression copy =
|
CPPASTLiteralExpression copy =
|
||||||
new CPPASTLiteralExpression(fKind, fValue == null ? null : fValue.clone());
|
new CPPASTLiteralExpression(kind, value == null ? null : value.clone());
|
||||||
return copy(copy, style);
|
return copy(copy, style);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getKind() {
|
public int getKind() {
|
||||||
return fKind;
|
return kind;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setKind(int value) {
|
public void setKind(int value) {
|
||||||
assertNotFrozen();
|
assertNotFrozen();
|
||||||
fKind = value;
|
kind = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public char[] getValue() {
|
public char[] getValue() {
|
||||||
return fValue;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setValue(char[] value) {
|
public void setValue(char[] value) {
|
||||||
assertNotFrozen();
|
assertNotFrozen();
|
||||||
this.fValue= value;
|
this.value= value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new String(fValue);
|
return new String(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public IASTImplicitDestructorName[] getImplicitDestructorNames() {
|
|
||||||
return IASTImplicitDestructorName.EMPTY_NAME_ARRAY; // Literal expression does not call destructors.
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean accept(ASTVisitor action) {
|
public boolean accept(ASTVisitor action) {
|
||||||
if (action.shouldVisitExpressions) {
|
if (action.shouldVisitExpressions) {
|
||||||
|
@ -119,22 +112,22 @@ public class CPPASTLiteralExpression extends ASTNode implements ICPPASTLiteralEx
|
||||||
}
|
}
|
||||||
|
|
||||||
private int computeStringLiteralSize() {
|
private int computeStringLiteralSize() {
|
||||||
int start = 0, end = fValue.length - 1;
|
int start = 0, end = value.length - 1;
|
||||||
boolean isRaw = false;
|
boolean isRaw = false;
|
||||||
|
|
||||||
// Skip past a prefix affecting the character type.
|
// Skip past a prefix affecting the character type.
|
||||||
if (fValue[0] == 'L' || fValue[0] == 'u' || fValue[0] == 'U') {
|
if (value[0] == 'L' || value[0] == 'u' || value[0] == 'U') {
|
||||||
++start;
|
++start;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If there is an 'R' prefix, skip past it but take note of it.
|
// If there is an 'R' prefix, skip past it but take note of it.
|
||||||
if (fValue[start] == 'R') {
|
if (value[start] == 'R') {
|
||||||
++start;
|
++start;
|
||||||
isRaw = true;
|
isRaw = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now we should have a quote-enclosed string. Skip past the quotes.
|
// Now we should have a quote-enclosed string. Skip past the quotes.
|
||||||
if (!(fValue[start] == '"' && fValue[end] == '"')) {
|
if (!(value[start] == '"' && value[end] == '"')) {
|
||||||
// Unexpected!
|
// Unexpected!
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -143,13 +136,13 @@ public class CPPASTLiteralExpression extends ASTNode implements ICPPASTLiteralEx
|
||||||
|
|
||||||
// If we have a raw string, skip past the raw prefix.
|
// If we have a raw string, skip past the raw prefix.
|
||||||
if (isRaw) {
|
if (isRaw) {
|
||||||
while (fValue[start] != '(' && start <= end) {
|
while (value[start] != '(' && start <= end) {
|
||||||
++start;
|
++start;
|
||||||
--end;
|
--end;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now we should have a parenthesis-enclosed string.
|
// Now we should have a parenthesis-enclosed string.
|
||||||
if (!(fValue[start] == '(' && fValue[end] == ')')) {
|
if (!(value[start] == '(' && value[end] == ')')) {
|
||||||
// Unexpected!
|
// Unexpected!
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -168,7 +161,7 @@ public class CPPASTLiteralExpression extends ASTNode implements ICPPASTLiteralEx
|
||||||
if (escaping) {
|
if (escaping) {
|
||||||
escaping = false;
|
escaping = false;
|
||||||
++length;
|
++length;
|
||||||
} else if (fValue[start] == '\\') {
|
} else if (value[start] == '\\') {
|
||||||
escaping = true;
|
escaping = true;
|
||||||
} else {
|
} else {
|
||||||
++length;
|
++length;
|
||||||
|
@ -260,7 +253,7 @@ public class CPPASTLiteralExpression extends ASTNode implements ICPPASTLiteralEx
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public void setValue(String value) {
|
public void setValue(String value) {
|
||||||
assertNotFrozen();
|
assertNotFrozen();
|
||||||
this.fValue = value.toCharArray();
|
this.value = value.toCharArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -279,7 +272,7 @@ public class CPPASTLiteralExpression extends ASTNode implements ICPPASTLiteralEx
|
||||||
}
|
}
|
||||||
|
|
||||||
private ICPPEvaluation createEvaluation() {
|
private ICPPEvaluation createEvaluation() {
|
||||||
switch (fKind) {
|
switch (kind) {
|
||||||
case lk_this: {
|
case lk_this: {
|
||||||
IScope scope = CPPVisitor.getContainingScope(this);
|
IScope scope = CPPVisitor.getContainingScope(this);
|
||||||
IType type= CPPVisitor.getImpliedObjectType(scope);
|
IType type= CPPVisitor.getImpliedObjectType(scope);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2015 IBM Corporation and others.
|
* Copyright (c) 2004, 2014 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -21,7 +21,6 @@ import org.eclipse.cdt.core.dom.ast.IASTArrayModifier;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
import org.eclipse.cdt.core.dom.ast.IASTDeclarator;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpressionList;
|
import org.eclipse.cdt.core.dom.ast.IASTExpressionList;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorName;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitName;
|
import org.eclipse.cdt.core.dom.ast.IASTImplicitName;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTInitializer;
|
import org.eclipse.cdt.core.dom.ast.IASTInitializer;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTInitializerClause;
|
import org.eclipse.cdt.core.dom.ast.IASTInitializerClause;
|
||||||
|
@ -49,16 +48,15 @@ import org.eclipse.core.runtime.Assert;
|
||||||
* Represents a new expression [expr.new].
|
* Represents a new expression [expr.new].
|
||||||
*/
|
*/
|
||||||
public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression, IASTAmbiguityParent {
|
public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression, IASTAmbiguityParent {
|
||||||
private IASTInitializerClause[] fPlacement;
|
private IASTInitializerClause[] placement;
|
||||||
private IASTTypeId fTypeId;
|
private IASTTypeId typeId;
|
||||||
private IASTInitializer fInitializer;
|
private IASTInitializer initializer;
|
||||||
private boolean fIsGlobal;
|
private IASTImplicitName[] implicitNames;
|
||||||
private boolean fIsNewTypeId;
|
private boolean isGlobal;
|
||||||
|
private boolean isNewTypeId;
|
||||||
|
|
||||||
private IASTExpression[] fCachedArraySizes;
|
private IASTExpression[] cachedArraySizes;
|
||||||
private ICPPEvaluation fEvaluation;
|
private ICPPEvaluation fEvaluation;
|
||||||
private IASTImplicitName[] fImplicitNames;
|
|
||||||
private IASTImplicitDestructorName[] fImplicitDestructorNames;
|
|
||||||
|
|
||||||
public CPPASTNewExpression() {
|
public CPPASTNewExpression() {
|
||||||
}
|
}
|
||||||
|
@ -77,40 +75,40 @@ public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression
|
||||||
@Override
|
@Override
|
||||||
public CPPASTNewExpression copy(CopyStyle style) {
|
public CPPASTNewExpression copy(CopyStyle style) {
|
||||||
CPPASTNewExpression copy = new CPPASTNewExpression();
|
CPPASTNewExpression copy = new CPPASTNewExpression();
|
||||||
copy.setIsGlobal(fIsGlobal);
|
copy.setIsGlobal(isGlobal);
|
||||||
copy.setIsNewTypeId(fIsNewTypeId);
|
copy.setIsNewTypeId(isNewTypeId);
|
||||||
if (fPlacement != null) {
|
if (placement != null) {
|
||||||
IASTInitializerClause[] plcmt = new IASTInitializerClause[fPlacement.length];
|
IASTInitializerClause[] plcmt = new IASTInitializerClause[placement.length];
|
||||||
for (int i = 0; i < fPlacement.length; i++) {
|
for (int i = 0; i < placement.length; i++) {
|
||||||
plcmt[i] = fPlacement[i].copy(style);
|
plcmt[i] = placement[i].copy(style);
|
||||||
}
|
}
|
||||||
copy.setPlacementArguments(plcmt);
|
copy.setPlacementArguments(plcmt);
|
||||||
}
|
}
|
||||||
copy.setTypeId(fTypeId == null ? null : fTypeId.copy(style));
|
copy.setTypeId(typeId == null ? null : typeId.copy(style));
|
||||||
copy.setInitializer(fInitializer == null ? null : fInitializer.copy(style));
|
copy.setInitializer(initializer == null ? null : initializer.copy(style));
|
||||||
return copy(copy, style);
|
return copy(copy, style);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isGlobal() {
|
public boolean isGlobal() {
|
||||||
return fIsGlobal;
|
return isGlobal;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setIsGlobal(boolean value) {
|
public void setIsGlobal(boolean value) {
|
||||||
assertNotFrozen();
|
assertNotFrozen();
|
||||||
fIsGlobal = value;
|
isGlobal = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IASTInitializerClause[] getPlacementArguments() {
|
public IASTInitializerClause[] getPlacementArguments() {
|
||||||
return fPlacement;
|
return placement;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setPlacementArguments(IASTInitializerClause[] args) {
|
public void setPlacementArguments(IASTInitializerClause[] args) {
|
||||||
assertNotFrozen();
|
assertNotFrozen();
|
||||||
fPlacement = args;
|
placement = args;
|
||||||
if (args != null) {
|
if (args != null) {
|
||||||
for (IASTInitializerClause arg : args) {
|
for (IASTInitializerClause arg : args) {
|
||||||
arg.setParent(this);
|
arg.setParent(this);
|
||||||
|
@ -121,13 +119,13 @@ public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IASTInitializer getInitializer() {
|
public IASTInitializer getInitializer() {
|
||||||
return fInitializer;
|
return initializer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setInitializer(IASTInitializer expression) {
|
public void setInitializer(IASTInitializer expression) {
|
||||||
assertNotFrozen();
|
assertNotFrozen();
|
||||||
fInitializer = expression;
|
initializer = expression;
|
||||||
if (expression != null) {
|
if (expression != null) {
|
||||||
expression.setParent(this);
|
expression.setParent(this);
|
||||||
expression.setPropertyInParent(NEW_INITIALIZER);
|
expression.setPropertyInParent(NEW_INITIALIZER);
|
||||||
|
@ -136,13 +134,13 @@ public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IASTTypeId getTypeId() {
|
public IASTTypeId getTypeId() {
|
||||||
return fTypeId;
|
return typeId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setTypeId(IASTTypeId typeId) {
|
public void setTypeId(IASTTypeId typeId) {
|
||||||
assertNotFrozen();
|
assertNotFrozen();
|
||||||
fTypeId = typeId;
|
this.typeId = typeId;
|
||||||
if (typeId != null) {
|
if (typeId != null) {
|
||||||
typeId.setParent(this);
|
typeId.setParent(this);
|
||||||
typeId.setPropertyInParent(TYPE_ID);
|
typeId.setPropertyInParent(TYPE_ID);
|
||||||
|
@ -151,13 +149,13 @@ public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isNewTypeId() {
|
public boolean isNewTypeId() {
|
||||||
return fIsNewTypeId;
|
return isNewTypeId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setIsNewTypeId(boolean value) {
|
public void setIsNewTypeId(boolean value) {
|
||||||
assertNotFrozen();
|
assertNotFrozen();
|
||||||
fIsNewTypeId = value;
|
isNewTypeId = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -165,7 +163,7 @@ public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public IASTImplicitName[] getImplicitNames() {
|
public IASTImplicitName[] getImplicitNames() {
|
||||||
if (fImplicitNames == null) {
|
if (implicitNames == null) {
|
||||||
CPPASTImplicitName operatorName = null;
|
CPPASTImplicitName operatorName = null;
|
||||||
ICPPFunction operatorFunction = CPPSemantics.findOverloadedOperator(this);
|
ICPPFunction operatorFunction = CPPSemantics.findOverloadedOperator(this);
|
||||||
if (operatorFunction != null && !(operatorFunction instanceof CPPImplicitFunction)) {
|
if (operatorFunction != null && !(operatorFunction instanceof CPPImplicitFunction)) {
|
||||||
|
@ -185,31 +183,22 @@ public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression
|
||||||
|
|
||||||
if (operatorName != null) {
|
if (operatorName != null) {
|
||||||
if (constructorName != null) {
|
if (constructorName != null) {
|
||||||
fImplicitNames = new IASTImplicitName[] { operatorName, constructorName };
|
implicitNames = new IASTImplicitName[] { operatorName, constructorName };
|
||||||
} else {
|
} else {
|
||||||
fImplicitNames = new IASTImplicitName[] { operatorName };
|
implicitNames = new IASTImplicitName[] { operatorName };
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (constructorName != null) {
|
if (constructorName != null) {
|
||||||
fImplicitNames = new IASTImplicitName[] { constructorName };
|
implicitNames = new IASTImplicitName[] { constructorName };
|
||||||
} else {
|
} else {
|
||||||
fImplicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
|
implicitNames = IASTImplicitName.EMPTY_NAME_ARRAY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return fImplicitNames;
|
return implicitNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public IASTImplicitDestructorName[] getImplicitDestructorNames() {
|
|
||||||
if (fImplicitDestructorNames == null) {
|
|
||||||
fImplicitDestructorNames = CPPVisitor.getTemporariesDestructorCalls(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
return fImplicitDestructorNames;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if this expression is allocating an array.
|
* Returns true if this expression is allocating an array.
|
||||||
* @since 5.1
|
* @since 5.1
|
||||||
|
@ -243,21 +232,18 @@ public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fPlacement != null) {
|
if (placement != null) {
|
||||||
for (IASTInitializerClause arg : fPlacement) {
|
for (IASTInitializerClause arg : placement) {
|
||||||
if (!arg.accept(action))
|
if (!arg.accept(action))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (fTypeId != null && !fTypeId.accept(action))
|
if (typeId != null && !typeId.accept(action))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (fInitializer != null && !fInitializer.accept(action))
|
if (initializer != null && !initializer.accept(action))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (action.shouldVisitImplicitDestructorNames && !acceptByNodes(fImplicitDestructorNames, action))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (action.shouldVisitExpressions) {
|
if (action.shouldVisitExpressions) {
|
||||||
switch (action.leave(this)) {
|
switch (action.leave(this)) {
|
||||||
case ASTVisitor.PROCESS_ABORT: return false;
|
case ASTVisitor.PROCESS_ABORT: return false;
|
||||||
|
@ -270,12 +256,12 @@ public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void replace(IASTNode child, IASTNode other) {
|
public void replace(IASTNode child, IASTNode other) {
|
||||||
if (fPlacement != null) {
|
if (placement != null) {
|
||||||
for (int i = 0; i < fPlacement.length; ++i) {
|
for (int i = 0; i < placement.length; ++i) {
|
||||||
if (child == fPlacement[i]) {
|
if (child == placement[i]) {
|
||||||
other.setPropertyInParent(child.getPropertyInParent());
|
other.setPropertyInParent(child.getPropertyInParent());
|
||||||
other.setParent(child.getParent());
|
other.setParent(child.getParent());
|
||||||
fPlacement[i] = (IASTExpression) other;
|
placement[i] = (IASTExpression) other;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -284,13 +270,13 @@ public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression
|
||||||
@Override
|
@Override
|
||||||
public ICPPEvaluation getEvaluation() {
|
public ICPPEvaluation getEvaluation() {
|
||||||
if (fEvaluation == null) {
|
if (fEvaluation == null) {
|
||||||
IType t = fTypeId != null ? CPPVisitor.createType(fTypeId) : ProblemType.UNKNOWN_FOR_EXPRESSION;
|
IType t = typeId != null ? CPPVisitor.createType(typeId) : ProblemType.UNKNOWN_FOR_EXPRESSION;
|
||||||
if (t instanceof IArrayType) {
|
if (t instanceof IArrayType) {
|
||||||
t = ((IArrayType) t).getType();
|
t = ((IArrayType) t).getType();
|
||||||
}
|
}
|
||||||
ICPPEvaluation[] arguments = ICPPEvaluation.EMPTY_ARRAY;
|
ICPPEvaluation[] arguments = ICPPEvaluation.EMPTY_ARRAY;
|
||||||
if (fInitializer instanceof ICPPASTConstructorInitializer) {
|
if (initializer instanceof ICPPASTConstructorInitializer) {
|
||||||
IASTInitializerClause[] args = ((ICPPASTConstructorInitializer) fInitializer).getArguments();
|
IASTInitializerClause[] args = ((ICPPASTConstructorInitializer) initializer).getArguments();
|
||||||
arguments= new ICPPEvaluation[args.length];
|
arguments= new ICPPEvaluation[args.length];
|
||||||
for (int i = 0; i < arguments.length; i++) {
|
for (int i = 0; i < arguments.length; i++) {
|
||||||
arguments[i] = ((ICPPASTInitializerClause) args[i]).getEvaluation();
|
arguments[i] = ((ICPPASTInitializerClause) args[i]).getEvaluation();
|
||||||
|
@ -319,40 +305,40 @@ public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression
|
||||||
@Override
|
@Override
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public IASTExpression[] getNewTypeIdArrayExpressions() {
|
public IASTExpression[] getNewTypeIdArrayExpressions() {
|
||||||
if (fCachedArraySizes == null) {
|
if (cachedArraySizes == null) {
|
||||||
if (fTypeId != null) {
|
if (typeId != null) {
|
||||||
IASTDeclarator dtor = ASTQueries.findInnermostDeclarator(fTypeId.getAbstractDeclarator());
|
IASTDeclarator dtor = ASTQueries.findInnermostDeclarator(typeId.getAbstractDeclarator());
|
||||||
if (dtor instanceof IASTArrayDeclarator) {
|
if (dtor instanceof IASTArrayDeclarator) {
|
||||||
IASTArrayDeclarator ad = (IASTArrayDeclarator) dtor;
|
IASTArrayDeclarator ad = (IASTArrayDeclarator) dtor;
|
||||||
IASTArrayModifier[] ams = ad.getArrayModifiers();
|
IASTArrayModifier[] ams = ad.getArrayModifiers();
|
||||||
fCachedArraySizes = new IASTExpression[ams.length];
|
cachedArraySizes = new IASTExpression[ams.length];
|
||||||
for (int i = 0; i < ams.length; i++) {
|
for (int i = 0; i < ams.length; i++) {
|
||||||
IASTArrayModifier am = ams[i];
|
IASTArrayModifier am = ams[i];
|
||||||
fCachedArraySizes[i] = am.getConstantExpression();
|
cachedArraySizes[i] = am.getConstantExpression();
|
||||||
}
|
}
|
||||||
return fCachedArraySizes;
|
return cachedArraySizes;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fCachedArraySizes = IASTExpression.EMPTY_EXPRESSION_ARRAY;
|
cachedArraySizes = IASTExpression.EMPTY_EXPRESSION_ARRAY;
|
||||||
}
|
}
|
||||||
return fCachedArraySizes;
|
return cachedArraySizes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public void addNewTypeIdArrayExpression(IASTExpression expression) {
|
public void addNewTypeIdArrayExpression(IASTExpression expression) {
|
||||||
assertNotFrozen();
|
assertNotFrozen();
|
||||||
Assert.isNotNull(fTypeId);
|
Assert.isNotNull(typeId);
|
||||||
IASTDeclarator dtor= ASTQueries.findInnermostDeclarator(fTypeId.getAbstractDeclarator());
|
IASTDeclarator dtor= ASTQueries.findInnermostDeclarator(typeId.getAbstractDeclarator());
|
||||||
if (dtor instanceof IASTArrayDeclarator == false) {
|
if (dtor instanceof IASTArrayDeclarator == false) {
|
||||||
Assert.isNotNull(dtor);
|
Assert.isNotNull(dtor);
|
||||||
Assert.isTrue(dtor.getParent() == fTypeId);
|
Assert.isTrue(dtor.getParent() == typeId);
|
||||||
IASTArrayDeclarator adtor= new CPPASTArrayDeclarator(dtor.getName());
|
IASTArrayDeclarator adtor= new CPPASTArrayDeclarator(dtor.getName());
|
||||||
IASTPointerOperator[] ptrOps= dtor.getPointerOperators();
|
IASTPointerOperator[] ptrOps= dtor.getPointerOperators();
|
||||||
for (IASTPointerOperator ptr : ptrOps) {
|
for (IASTPointerOperator ptr : ptrOps) {
|
||||||
adtor.addPointerOperator(ptr);
|
adtor.addPointerOperator(ptr);
|
||||||
}
|
}
|
||||||
fTypeId.setAbstractDeclarator(adtor);
|
typeId.setAbstractDeclarator(adtor);
|
||||||
dtor= adtor;
|
dtor= adtor;
|
||||||
}
|
}
|
||||||
IASTArrayModifier mod= new CPPASTArrayModifier(expression);
|
IASTArrayModifier mod= new CPPASTArrayModifier(expression);
|
||||||
|
@ -363,16 +349,16 @@ public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression
|
||||||
@Override
|
@Override
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public IASTExpression getNewPlacement() {
|
public IASTExpression getNewPlacement() {
|
||||||
if (fPlacement == null || fPlacement.length == 0)
|
if (placement == null || placement.length == 0)
|
||||||
return null;
|
return null;
|
||||||
if (fPlacement.length == 1) {
|
if (placement.length == 1) {
|
||||||
if (fPlacement[0] instanceof IASTExpression)
|
if (placement[0] instanceof IASTExpression)
|
||||||
return (IASTExpression) fPlacement[0];
|
return (IASTExpression) placement[0];
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
CASTExpressionList result= new CASTExpressionList();
|
CASTExpressionList result= new CASTExpressionList();
|
||||||
for (IASTInitializerClause arg : fPlacement) {
|
for (IASTInitializerClause arg : placement) {
|
||||||
if (arg instanceof IASTExpression) {
|
if (arg instanceof IASTExpression) {
|
||||||
result.addExpression(((IASTExpression) arg).copy());
|
result.addExpression(((IASTExpression) arg).copy());
|
||||||
}
|
}
|
||||||
|
@ -398,11 +384,11 @@ public class CPPASTNewExpression extends ASTNode implements ICPPASTNewExpression
|
||||||
@Override
|
@Override
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public IASTExpression getNewInitializer() {
|
public IASTExpression getNewInitializer() {
|
||||||
if (fInitializer == null || fInitializer instanceof IASTExpression) {
|
if (initializer == null || initializer instanceof IASTExpression) {
|
||||||
return (IASTExpression) fInitializer;
|
return (IASTExpression) initializer;
|
||||||
}
|
}
|
||||||
if (fInitializer instanceof ICPPASTConstructorInitializer) {
|
if (initializer instanceof ICPPASTConstructorInitializer) {
|
||||||
IASTExpression expr= ((ICPPASTConstructorInitializer) fInitializer).getExpression();
|
IASTExpression expr= ((ICPPASTConstructorInitializer) initializer).getExpression();
|
||||||
if (expr == null) {
|
if (expr == null) {
|
||||||
expr= new CPPASTExpressionList();
|
expr= new CPPASTExpressionList();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2009, 2015 Wind River Systems, Inc. and others.
|
* Copyright (c) 2009, 2013 Wind River Systems, Inc. and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,13 +8,11 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
* Natan Ridge
|
* Natan Ridge
|
||||||
* Sergey Prigogin (Google)
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorName;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExpression;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExpression;
|
||||||
|
@ -84,11 +82,6 @@ public class CPPASTPackExpansionExpression extends ASTNode implements ICPPASTPac
|
||||||
return fPattern.getValueCategory();
|
return fPattern.getValueCategory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public IASTImplicitDestructorName[] getImplicitDestructorNames() {
|
|
||||||
return IASTImplicitDestructorName.EMPTY_NAME_ARRAY; // Pack expression is never a full-expression.
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean accept(ASTVisitor visitor) {
|
public boolean accept(ASTVisitor visitor) {
|
||||||
if (visitor.shouldVisitExpressions) {
|
if (visitor.shouldVisitExpressions) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2015 IBM Corporation and others.
|
* Copyright (c) 2004, 2011 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,14 +8,12 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* John Camelon (IBM) - Initial API and implementation
|
* John Camelon (IBM) - Initial API and implementation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
* Sergey Prigogin (Google)
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE;
|
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorName;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTProblem;
|
import org.eclipse.cdt.core.dom.ast.IASTProblem;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTProblemExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTProblemExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
|
@ -36,18 +34,12 @@ public class CPPASTProblemExpression extends CPPASTProblemOwner implements IASTP
|
||||||
public CPPASTProblemExpression copy() {
|
public CPPASTProblemExpression copy() {
|
||||||
return copy(CopyStyle.withoutLocations);
|
return copy(CopyStyle.withoutLocations);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CPPASTProblemExpression copy(CopyStyle style) {
|
public CPPASTProblemExpression copy(CopyStyle style) {
|
||||||
CPPASTProblemExpression copy = new CPPASTProblemExpression();
|
CPPASTProblemExpression copy = new CPPASTProblemExpression();
|
||||||
return copy(copy, style);
|
return copy(copy, style);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public IASTImplicitDestructorName[] getImplicitDestructorNames() {
|
|
||||||
return IASTImplicitDestructorName.EMPTY_NAME_ARRAY;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean accept(ASTVisitor action) {
|
public boolean accept(ASTVisitor action) {
|
||||||
if (action.shouldVisitExpressions) {
|
if (action.shouldVisitExpressions) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2015 IBM Corporation and others.
|
* Copyright (c) 2004, 2011 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,13 +8,11 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* John Camelon (IBM) - Initial API and implementation
|
* John Camelon (IBM) - Initial API and implementation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
* Sergey Prigogin (Google)
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorName;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTInitializer;
|
import org.eclipse.cdt.core.dom.ast.IASTInitializer;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTInitializerClause;
|
import org.eclipse.cdt.core.dom.ast.IASTInitializerClause;
|
||||||
import org.eclipse.cdt.core.dom.ast.IBasicType.Kind;
|
import org.eclipse.cdt.core.dom.ast.IBasicType.Kind;
|
||||||
|
@ -35,7 +33,6 @@ public class CPPASTSimpleTypeConstructorExpression extends ASTNode
|
||||||
private ICPPASTDeclSpecifier fDeclSpec;
|
private ICPPASTDeclSpecifier fDeclSpec;
|
||||||
private IASTInitializer fInitializer;
|
private IASTInitializer fInitializer;
|
||||||
private ICPPEvaluation fEvaluation;
|
private ICPPEvaluation fEvaluation;
|
||||||
private IASTImplicitDestructorName[] fImplicitDestructorNames;
|
|
||||||
|
|
||||||
public CPPASTSimpleTypeConstructorExpression() {
|
public CPPASTSimpleTypeConstructorExpression() {
|
||||||
}
|
}
|
||||||
|
@ -125,15 +122,6 @@ public class CPPASTSimpleTypeConstructorExpression extends ASTNode
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public IASTImplicitDestructorName[] getImplicitDestructorNames() {
|
|
||||||
if (fImplicitDestructorNames == null) {
|
|
||||||
fImplicitDestructorNames = CPPVisitor.getTemporariesDestructorCalls(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
return fImplicitDestructorNames;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean accept(ASTVisitor action) {
|
public boolean accept(ASTVisitor action) {
|
||||||
if (action.shouldVisitExpressions) {
|
if (action.shouldVisitExpressions) {
|
||||||
|
@ -150,9 +138,6 @@ public class CPPASTSimpleTypeConstructorExpression extends ASTNode
|
||||||
if (fInitializer != null && !fInitializer.accept(action))
|
if (fInitializer != null && !fInitializer.accept(action))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (action.shouldVisitImplicitDestructorNames && !acceptByNodes(fImplicitDestructorNames, action))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (action.shouldVisitExpressions) {
|
if (action.shouldVisitExpressions) {
|
||||||
switch (action.leave(this)) {
|
switch (action.leave(this)) {
|
||||||
case ASTVisitor.PROCESS_ABORT: return false;
|
case ASTVisitor.PROCESS_ABORT: return false;
|
||||||
|
@ -163,8 +148,8 @@ public class CPPASTSimpleTypeConstructorExpression extends ASTNode
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public int getSimpleType() {
|
public int getSimpleType() {
|
||||||
IType type= getExpressionType();
|
IType type= getExpressionType();
|
||||||
if (type instanceof ICPPBasicType) {
|
if (type instanceof ICPPBasicType) {
|
||||||
|
@ -200,8 +185,8 @@ public class CPPASTSimpleTypeConstructorExpression extends ASTNode
|
||||||
return t_unspecified;
|
return t_unspecified;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public void setSimpleType(int value) {
|
public void setSimpleType(int value) {
|
||||||
CPPASTSimpleDeclSpecifier declspec = new CPPASTSimpleDeclSpecifier();
|
CPPASTSimpleDeclSpecifier declspec = new CPPASTSimpleDeclSpecifier();
|
||||||
switch(value) {
|
switch(value) {
|
||||||
|
@ -249,8 +234,8 @@ public class CPPASTSimpleTypeConstructorExpression extends ASTNode
|
||||||
setDeclSpecifier(declspec);
|
setDeclSpecifier(declspec);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public IASTExpression getInitialValue() {
|
public IASTExpression getInitialValue() {
|
||||||
if (fInitializer instanceof ICPPASTConstructorInitializer) {
|
if (fInitializer instanceof ICPPASTConstructorInitializer) {
|
||||||
return ((ICPPASTConstructorInitializer) fInitializer).getExpression();
|
return ((ICPPASTConstructorInitializer) fInitializer).getExpression();
|
||||||
|
@ -258,8 +243,8 @@ public class CPPASTSimpleTypeConstructorExpression extends ASTNode
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
@Override
|
@Override
|
||||||
|
@Deprecated
|
||||||
public void setInitialValue(IASTExpression expression) {
|
public void setInitialValue(IASTExpression expression) {
|
||||||
ICPPASTConstructorInitializer init= new CPPASTConstructorInitializer();
|
ICPPASTConstructorInitializer init= new CPPASTConstructorInitializer();
|
||||||
init.setExpression(expression);
|
init.setExpression(expression);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2011, 2015 Wind River Systems, Inc. and others.
|
* Copyright (c) 2011, 2014 Wind River Systems, Inc. and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -17,7 +17,6 @@ import java.util.List;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorName;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
import org.eclipse.cdt.core.dom.ast.IBinding;
|
||||||
|
@ -175,9 +174,4 @@ public class CPPASTTemplateIDAmbiguity extends ASTAmbiguousNode
|
||||||
public IASTExpression[] getExpressions() {
|
public IASTExpression[] getExpressions() {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public IASTImplicitDestructorName[] getImplicitDestructorNames() {
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,6 @@ package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE;
|
import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorName;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
|
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
|
||||||
import org.eclipse.cdt.core.dom.ast.IProblemType;
|
import org.eclipse.cdt.core.dom.ast.IProblemType;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
|
@ -25,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;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalUnaryTypeID;
|
||||||
|
|
||||||
public class CPPASTTypeIdExpression extends ASTNode implements ICPPASTTypeIdExpression {
|
public class CPPASTTypeIdExpression extends ASTNode implements ICPPASTTypeIdExpression {
|
||||||
private int fOperator;
|
private int op;
|
||||||
private IASTTypeId fTypeId;
|
private IASTTypeId typeId;
|
||||||
private ICPPEvaluation fEvaluation;
|
private ICPPEvaluation fEvaluation;
|
||||||
|
|
||||||
public CPPASTTypeIdExpression() {
|
public CPPASTTypeIdExpression() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public CPPASTTypeIdExpression(int op, IASTTypeId typeId) {
|
public CPPASTTypeIdExpression(int op, IASTTypeId typeId) {
|
||||||
this.fOperator = op;
|
this.op = op;
|
||||||
setTypeId(typeId);
|
setTypeId(typeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,25 +44,25 @@ public class CPPASTTypeIdExpression extends ASTNode implements ICPPASTTypeIdExpr
|
||||||
@Override
|
@Override
|
||||||
public CPPASTTypeIdExpression copy(CopyStyle style) {
|
public CPPASTTypeIdExpression copy(CopyStyle style) {
|
||||||
CPPASTTypeIdExpression copy =
|
CPPASTTypeIdExpression copy =
|
||||||
new CPPASTTypeIdExpression(fOperator, fTypeId == null ? null : fTypeId.copy(style));
|
new CPPASTTypeIdExpression(op, typeId == null ? null : typeId.copy(style));
|
||||||
return copy(copy, style);
|
return copy(copy, style);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getOperator() {
|
public int getOperator() {
|
||||||
return fOperator;
|
return op;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setOperator(int value) {
|
public void setOperator(int value) {
|
||||||
assertNotFrozen();
|
assertNotFrozen();
|
||||||
fOperator = value;
|
this.op = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setTypeId(IASTTypeId typeId) {
|
public void setTypeId(IASTTypeId typeId) {
|
||||||
assertNotFrozen();
|
assertNotFrozen();
|
||||||
this.fTypeId = typeId;
|
this.typeId = typeId;
|
||||||
if (typeId != null) {
|
if (typeId != null) {
|
||||||
typeId.setParent(this);
|
typeId.setParent(this);
|
||||||
typeId.setPropertyInParent(TYPE_ID);
|
typeId.setPropertyInParent(TYPE_ID);
|
||||||
|
@ -72,14 +71,9 @@ public class CPPASTTypeIdExpression extends ASTNode implements ICPPASTTypeIdExpr
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IASTTypeId getTypeId() {
|
public IASTTypeId getTypeId() {
|
||||||
return fTypeId;
|
return typeId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public IASTImplicitDestructorName[] getImplicitDestructorNames() {
|
|
||||||
return IASTImplicitDestructorName.EMPTY_NAME_ARRAY; // Type-id expression does not call destructors.
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean accept(ASTVisitor action) {
|
public boolean accept(ASTVisitor action) {
|
||||||
if (action.shouldVisitExpressions) {
|
if (action.shouldVisitExpressions) {
|
||||||
|
@ -90,7 +84,7 @@ public class CPPASTTypeIdExpression extends ASTNode implements ICPPASTTypeIdExpr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fTypeId != null && !fTypeId.accept(action)) return false;
|
if (typeId != null && !typeId.accept(action)) return false;
|
||||||
|
|
||||||
if (action.shouldVisitExpressions) {
|
if (action.shouldVisitExpressions) {
|
||||||
switch (action.leave(this)) {
|
switch (action.leave(this)) {
|
||||||
|
@ -105,11 +99,11 @@ public class CPPASTTypeIdExpression extends ASTNode implements ICPPASTTypeIdExpr
|
||||||
@Override
|
@Override
|
||||||
public ICPPEvaluation getEvaluation() {
|
public ICPPEvaluation getEvaluation() {
|
||||||
if (fEvaluation == null) {
|
if (fEvaluation == null) {
|
||||||
IType type= CPPVisitor.createType(fTypeId);
|
IType type= CPPVisitor.createType(typeId);
|
||||||
if (type == null || type instanceof IProblemType) {
|
if (type == null || type instanceof IProblemType) {
|
||||||
fEvaluation= EvalFixed.INCOMPLETE;
|
fEvaluation= EvalFixed.INCOMPLETE;
|
||||||
} else {
|
} else {
|
||||||
fEvaluation= new EvalUnaryTypeID(fOperator, type, this);
|
fEvaluation= new EvalUnaryTypeID(op, type, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return fEvaluation;
|
return fEvaluation;
|
||||||
|
|
|
@ -1,20 +1,15 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2005, 2015 IBM Corporation and others.
|
* Copyright (c) 2009, 2011 Wind River Systems, Inc. and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* John Camelon (IBM Rational Software) - Initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
* Yuan Zhang / Beth Tibbitts (IBM Research)
|
|
||||||
* Markus Schorn (Wind River Systems)
|
|
||||||
* Sergey Prigogin (Google)
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorName;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTInitializer;
|
import org.eclipse.cdt.core.dom.ast.IASTInitializer;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
|
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTTypeIdInitializerExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTTypeIdInitializerExpression;
|
||||||
|
@ -22,97 +17,23 @@ import org.eclipse.cdt.core.dom.ast.IProblemType;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExpression;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTInitializerClause;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTInitializerClause;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
import org.eclipse.cdt.internal.core.dom.parser.ASTTypeIdInitializerExpression;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
|
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.EvalFixed;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalTypeId;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalTypeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type id initializer expression for C++, type-id { initializer }
|
* C++ variant of type id initializer expression. type-id { initializer }
|
||||||
*/
|
*/
|
||||||
public class CPPASTTypeIdInitializerExpression extends ASTNode
|
public class CPPASTTypeIdInitializerExpression extends ASTTypeIdInitializerExpression implements ICPPASTExpression {
|
||||||
implements IASTTypeIdInitializerExpression, ICPPASTExpression {
|
|
||||||
private IASTTypeId fTypeId;
|
|
||||||
private IASTInitializer fInitializer;
|
|
||||||
private ICPPEvaluation fEvaluation;
|
private ICPPEvaluation fEvaluation;
|
||||||
private IASTImplicitDestructorName[] fImplicitDestructorNames;
|
|
||||||
|
|
||||||
public CPPASTTypeIdInitializerExpression() {
|
private CPPASTTypeIdInitializerExpression() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public CPPASTTypeIdInitializerExpression(IASTTypeId t, IASTInitializer i) {
|
public CPPASTTypeIdInitializerExpression(IASTTypeId typeId, IASTInitializer initializer) {
|
||||||
setTypeId(t);
|
super(typeId, initializer);
|
||||||
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 IASTImplicitDestructorName[] getImplicitDestructorNames() {
|
|
||||||
if (fImplicitDestructorNames == null) {
|
|
||||||
fImplicitDestructorNames = CPPVisitor.getTemporariesDestructorCalls(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
return fImplicitDestructorNames;
|
|
||||||
}
|
|
||||||
|
|
||||||
@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.shouldVisitImplicitDestructorNames && !acceptByNodes(getImplicitDestructorNames(), 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
|
@Override
|
||||||
|
@ -122,10 +43,9 @@ public class CPPASTTypeIdInitializerExpression extends ASTNode
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IASTTypeIdInitializerExpression copy(CopyStyle style) {
|
public IASTTypeIdInitializerExpression copy(CopyStyle style) {
|
||||||
CPPASTTypeIdInitializerExpression copy =new CPPASTTypeIdInitializerExpression(
|
CPPASTTypeIdInitializerExpression expr = new CPPASTTypeIdInitializerExpression();
|
||||||
fTypeId == null ? null : fTypeId.copy(style),
|
initializeCopy(expr, style);
|
||||||
fInitializer == null ? null : fInitializer.copy(style));
|
return expr;
|
||||||
return copy(copy, style);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -148,13 +68,13 @@ public class CPPASTTypeIdInitializerExpression extends ASTNode
|
||||||
return new EvalTypeId(type, this, ((ICPPASTInitializerClause) initializer).getEvaluation());
|
return new EvalTypeId(type, this, ((ICPPASTInitializerClause) initializer).getEvaluation());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IType getExpressionType() {
|
public IType getExpressionType() {
|
||||||
return getEvaluation().getTypeOrFunctionSet(this);
|
return getEvaluation().getTypeOrFunctionSet(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ValueCategory getValueCategory() {
|
public ValueCategory getValueCategory() {
|
||||||
return getEvaluation().getValueCategory(this);
|
return getEvaluation().getValueCategory(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2015 IBM Corporation and others.
|
* Copyright (c) 2004, 2012 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying masterials
|
* All rights reserved. This program and the accompanying masterials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -10,7 +10,6 @@
|
||||||
* Sergey Prigogin (Google)
|
* Sergey Prigogin (Google)
|
||||||
* Mike Kucera (IBM)
|
* Mike Kucera (IBM)
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
* Sergey Prigogin (Google)
|
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||||
|
|
||||||
|
@ -19,7 +18,6 @@ import static org.eclipse.cdt.core.dom.ast.IASTExpression.ValueCategory.LVALUE;
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTIdExpression;
|
import org.eclipse.cdt.core.dom.ast.IASTIdExpression;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorName;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitName;
|
import org.eclipse.cdt.core.dom.ast.IASTImplicitName;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
import org.eclipse.cdt.core.dom.ast.IASTName;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
|
@ -33,7 +31,6 @@ 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.ICPPMethod;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
|
import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent;
|
||||||
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.EvalFixed;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalUnary;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.EvalUnary;
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.FunctionSetType;
|
import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.FunctionSetType;
|
||||||
|
@ -44,9 +41,8 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.FunctionSetType;
|
||||||
public class CPPASTUnaryExpression extends ASTNode implements ICPPASTUnaryExpression, IASTAmbiguityParent {
|
public class CPPASTUnaryExpression extends ASTNode implements ICPPASTUnaryExpression, IASTAmbiguityParent {
|
||||||
private int fOperator;
|
private int fOperator;
|
||||||
private ICPPASTExpression fOperand;
|
private ICPPASTExpression fOperand;
|
||||||
private ICPPEvaluation fEvaluation;
|
|
||||||
private IASTImplicitName[] fImplicitNames;
|
private IASTImplicitName[] fImplicitNames;
|
||||||
private IASTImplicitDestructorName[] fImplicitDestructorNames;
|
private ICPPEvaluation fEvaluation;
|
||||||
|
|
||||||
public CPPASTUnaryExpression() {
|
public CPPASTUnaryExpression() {
|
||||||
}
|
}
|
||||||
|
@ -98,6 +94,9 @@ public class CPPASTUnaryExpression extends ASTNode implements ICPPASTUnaryExpres
|
||||||
return fOperator == op_postFixDecr || fOperator == op_postFixIncr;
|
return fOperator == op_postFixDecr || fOperator == op_postFixIncr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see org.eclipse.cdt.core.dom.ast.IASTImplicitNameOwner#getImplicitNames()
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public IASTImplicitName[] getImplicitNames() {
|
public IASTImplicitName[] getImplicitNames() {
|
||||||
if (fImplicitNames == null) {
|
if (fImplicitNames == null) {
|
||||||
|
@ -116,15 +115,6 @@ public class CPPASTUnaryExpression extends ASTNode implements ICPPASTUnaryExpres
|
||||||
return fImplicitNames;
|
return fImplicitNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public IASTImplicitDestructorName[] getImplicitDestructorNames() {
|
|
||||||
if (fImplicitDestructorNames == null) {
|
|
||||||
fImplicitDestructorNames = CPPVisitor.getTemporariesDestructorCalls(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
return fImplicitDestructorNames;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean accept(ASTVisitor action) {
|
public boolean accept(ASTVisitor action) {
|
||||||
if (action.shouldVisitExpressions) {
|
if (action.shouldVisitExpressions) {
|
||||||
|
@ -154,9 +144,6 @@ public class CPPASTUnaryExpression extends ASTNode implements ICPPASTUnaryExpres
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action.shouldVisitImplicitDestructorNames && !acceptByNodes(fImplicitDestructorNames, action))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (action.shouldVisitExpressions) {
|
if (action.shouldVisitExpressions) {
|
||||||
switch (action.leave(this)) {
|
switch (action.leave(this)) {
|
||||||
case ASTVisitor.PROCESS_ABORT: return false;
|
case ASTVisitor.PROCESS_ABORT: return false;
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class CPPBlockScope extends CPPNamespaceScope implements ICPPBlockScope {
|
||||||
if (node instanceof IASTCompoundStatement) {
|
if (node instanceof IASTCompoundStatement) {
|
||||||
final IASTNode parent= node.getParent();
|
final IASTNode parent= node.getParent();
|
||||||
if (parent instanceof IASTFunctionDefinition) {
|
if (parent instanceof IASTFunctionDefinition) {
|
||||||
IASTDeclarator dtor= ((IASTFunctionDefinition) parent).getDeclarator();
|
IASTDeclarator dtor= ((IASTFunctionDefinition)parent).getDeclarator();
|
||||||
dtor = ASTQueries.findInnermostDeclarator(dtor);
|
dtor = ASTQueries.findInnermostDeclarator(dtor);
|
||||||
return dtor.getName();
|
return dtor.getName();
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,12 +52,12 @@ public class CPPFunctionScope extends CPPScope implements ICPPFunctionScope {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addBinding(IBinding binding) {
|
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))
|
if (!(binding instanceof ILabel))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (labels == CharArrayObjectMap.EMPTY_MAP)
|
if (labels == CharArrayObjectMap.EMPTY_MAP)
|
||||||
labels = new CharArrayObjectMap<>(2);
|
labels = new CharArrayObjectMap<ILabel>(2);
|
||||||
|
|
||||||
labels.put(binding.getNameCharArray(), (ILabel) binding);
|
labels.put(binding.getNameCharArray(), (ILabel) binding);
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ public class CPPFunctionScope extends CPPScope implements ICPPFunctionScope {
|
||||||
@Override
|
@Override
|
||||||
public IBinding[] find(String name) {
|
public IBinding[] find(String name) {
|
||||||
char[] n = name.toCharArray();
|
char[] n = name.toCharArray();
|
||||||
List<IBinding> bindings = new ArrayList<>();
|
List<IBinding> bindings = new ArrayList<IBinding>();
|
||||||
|
|
||||||
for (int i = 0; i < labels.size(); i++) {
|
for (int i = 0; i < labels.size(); i++) {
|
||||||
char[] key = labels.keyAt(i);
|
char[] key = labels.keyAt(i);
|
||||||
|
@ -84,8 +84,8 @@ public class CPPFunctionScope extends CPPScope implements ICPPFunctionScope {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IScope getParent() {
|
public IScope getParent() {
|
||||||
// We can't just resolve the function and get its parent scope, since there are cases where that
|
//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.
|
//could loop since resolving functions requires resolving their parameter types
|
||||||
IASTFunctionDeclarator fdtor = (IASTFunctionDeclarator) getPhysicalNode();
|
IASTFunctionDeclarator fdtor = (IASTFunctionDeclarator) getPhysicalNode();
|
||||||
IASTName name = fdtor.getName().getLastName();
|
IASTName name = fdtor.getName().getLastName();
|
||||||
return CPPVisitor.getContainingNonTemplateScope(name);
|
return CPPVisitor.getContainingNonTemplateScope(name);
|
||||||
|
@ -96,9 +96,9 @@ public class CPPFunctionScope extends CPPScope implements ICPPFunctionScope {
|
||||||
IASTFunctionDeclarator fnDtor = (IASTFunctionDeclarator) getPhysicalNode();
|
IASTFunctionDeclarator fnDtor = (IASTFunctionDeclarator) getPhysicalNode();
|
||||||
IASTNode parent = fnDtor.getParent();
|
IASTNode parent = fnDtor.getParent();
|
||||||
if (parent instanceof IASTFunctionDefinition) {
|
if (parent instanceof IASTFunctionDefinition) {
|
||||||
IASTStatement body = ((IASTFunctionDefinition) parent).getBody();
|
IASTStatement body = ((IASTFunctionDefinition)parent).getBody();
|
||||||
if (body instanceof IASTCompoundStatement)
|
if (body instanceof IASTCompoundStatement)
|
||||||
return ((IASTCompoundStatement) body).getScope();
|
return ((IASTCompoundStatement)body).getScope();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@ public class CPPFunctionScope extends CPPScope implements ICPPFunctionScope {
|
||||||
public IName getScopeName() {
|
public IName getScopeName() {
|
||||||
IASTNode node = getPhysicalNode();
|
IASTNode node = getPhysicalNode();
|
||||||
if (node instanceof IASTDeclarator) {
|
if (node instanceof IASTDeclarator) {
|
||||||
return ((IASTDeclarator) node).getName();
|
return ((IASTDeclarator)node).getName();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,60 +0,0 @@
|
||||||
/*******************************************************************************
|
|
||||||
* Copyright (c) 2015 Google, Inc 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:
|
|
||||||
* Sergey Prigogin (Google) - initial API and implementation
|
|
||||||
*******************************************************************************/
|
|
||||||
package org.eclipse.cdt.internal.core.dom.parser.cpp.semantics;
|
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorName;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitDestructorNameOwner;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTImplicitName;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTName;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IBinding;
|
|
||||||
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.ICPPMethod;
|
|
||||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPASTImplicitDestructorName;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ClassTypeHelper;
|
|
||||||
import org.eclipse.cdt.internal.core.dom.parser.cpp.ClassTypeHelper.MethodKind;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A visitor that collects temporaries that have destructors.
|
|
||||||
*/
|
|
||||||
public class DestructableTemporariesCollector extends ASTVisitor {
|
|
||||||
private final IASTImplicitDestructorNameOwner owner;
|
|
||||||
private IASTImplicitDestructorName[] destructorNames = IASTImplicitDestructorName.EMPTY_NAME_ARRAY;
|
|
||||||
|
|
||||||
public DestructableTemporariesCollector(IASTImplicitDestructorNameOwner owner) {
|
|
||||||
this.owner = owner;
|
|
||||||
shouldVisitImplicitNames = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int visit(IASTName name) {
|
|
||||||
if (name instanceof IASTImplicitName) {
|
|
||||||
IBinding binding = name.resolveBinding();
|
|
||||||
if (binding instanceof ICPPConstructor) {
|
|
||||||
ICPPClassType classType = ((ICPPConstructor) binding).getClassOwner();
|
|
||||||
ICPPMethod destructor = ClassTypeHelper.getMethodInClass(classType, MethodKind.DTOR, name);
|
|
||||||
if (destructor != null) {
|
|
||||||
CPPASTImplicitDestructorName destructorName =
|
|
||||||
new CPPASTImplicitDestructorName(destructor.getNameCharArray(), owner, (IASTImplicitName) name);
|
|
||||||
destructorNames = ArrayUtil.append(destructorNames, destructorName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return PROCESS_CONTINUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IASTImplicitDestructorName[] getDestructorCalls() {
|
|
||||||
destructorNames = ArrayUtil.trim(destructorNames);
|
|
||||||
return destructorNames;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#Mon Oct 17 17:37:10 PDT 2011
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
||||||
|
@ -81,7 +82,6 @@ org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
|
||||||
org.eclipse.jdt.core.compiler.source=1.7
|
org.eclipse.jdt.core.compiler.source=1.7
|
||||||
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
|
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_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_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_explicit_constructor_call=16
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
|
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
|
||||||
|
@ -89,21 +89,18 @@ 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_assignment=0
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
|
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_compact_if=16
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
|
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=16
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
|
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_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_multiple_fields=16
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=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_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_selector_in_method_invocation=16
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=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_enum_declaration=16
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_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_constructor_declaration=16
|
||||||
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_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_imports=1
|
||||||
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
|
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
|
||||||
org.eclipse.jdt.core.formatter.blank_lines_before_field=0
|
org.eclipse.jdt.core.formatter.blank_lines_before_field=0
|
||||||
|
@ -123,7 +120,6 @@ 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_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_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_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_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_switch=end_of_line
|
||||||
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
|
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
|
||||||
|
@ -139,17 +135,11 @@ 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.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_before_root_tags=insert
|
||||||
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
|
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
|
||||||
org.eclipse.jdt.core.formatter.comment.line_length=80
|
org.eclipse.jdt.core.formatter.comment.line_length=110
|
||||||
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.compact_else_if=true
|
||||||
org.eclipse.jdt.core.formatter.continuation_indentation=2
|
org.eclipse.jdt.core.formatter.continuation_indentation=2
|
||||||
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=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_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_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_constant_header=true
|
||||||
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
|
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
|
||||||
|
@ -167,9 +157,7 @@ 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_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_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_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_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_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_catch_in_try_statement=do not insert
|
||||||
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
|
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
|
||||||
|
@ -217,7 +205,6 @@ 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_arguments=insert
|
||||||
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=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_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_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_arguments=do not insert
|
||||||
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
|
||||||
|
@ -236,14 +223,12 @@ 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_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_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_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_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_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_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_conditional=insert
|
||||||
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not 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_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_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_and_in_type_parameter=insert
|
||||||
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
|
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
|
||||||
|
@ -267,7 +252,6 @@ 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_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_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_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_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_assert=insert
|
||||||
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
|
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
|
||||||
|
@ -295,7 +279,6 @@ 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_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_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_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_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_arguments=do not insert
|
||||||
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
|
||||||
|
@ -324,7 +307,6 @@ 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_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_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_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_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_return=insert
|
||||||
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
|
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
|
||||||
|
@ -334,7 +316,6 @@ 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_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=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_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_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_brackets_in_array_type_reference=do not insert
|
||||||
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
|
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
|
||||||
|
@ -358,8 +339,5 @@ 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.put_empty_statement_on_new_line=true
|
||||||
org.eclipse.jdt.core.formatter.tabulation.char=tab
|
org.eclipse.jdt.core.formatter.tabulation.char=tab
|
||||||
org.eclipse.jdt.core.formatter.tabulation.size=4
|
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.use_tabs_only_for_leading_indentations=false
|
||||||
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
|
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,6 +1,7 @@
|
||||||
|
#Wed Jan 28 12:19:09 CET 2009
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
formatter_profile=_CDT
|
formatter_profile=_CDT
|
||||||
formatter_settings_version=12
|
formatter_settings_version=11
|
||||||
org.eclipse.jdt.ui.ignorelowercasenames=true
|
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.importorder=java;javax;org;com;org.eclipse.cdt;org.eclipse.cdt.internal;org.eclipse.cdt.internal.ui;
|
||||||
org.eclipse.jdt.ui.ondemandthreshold=99
|
org.eclipse.jdt.ui.ondemandthreshold=99
|
||||||
|
|
Loading…
Add table
Reference in a new issue