This is a first draft of unittests for the CTF Lexer and Parser.
The coverage of these tests is still incomplete. More unittests
are to come.
Some tests are commented and need to fix the grammars.
The plan is to fix them in future commits to limits the
amount of refactoring.
Change-Id: I2d8e06560314ef22710985915b726a74974bbb1c
Signed-off-by: Etienne Bergeron <etienne.bergeron@gmail.com>
Reviewed-on: https://git.eclipse.org/r/19485
Tested-by: Hudson CI
Reviewed-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
IP-Clean: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.ctf.parser.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
--- /dev/null
+eclipse.preferences.version=1
+line.separator=\n
--- /dev/null
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.doc.comment.support=enabled
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=enabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=enabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags
+org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=warning
+org.eclipse.jdt.core.compiler.problem.nullReference=error
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=warning
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=disabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=disabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=0
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=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_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=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_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=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_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=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_ellipsis=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_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=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_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=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_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=false
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=250
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=space
+org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
--- /dev/null
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_tmf-style
+formatter_settings_version=12
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=false
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=false
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=false
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=false
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=false
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=false
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_blocks=true
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
--- /dev/null
+ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Error
+ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Error
+ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Error
+API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Error
+API_USE_SCAN_FIELD_SEVERITY=Error
+API_USE_SCAN_METHOD_SEVERITY=Error
+API_USE_SCAN_TYPE_SEVERITY=Error
+CLASS_ELEMENT_TYPE_ADDED_METHOD=Error
+CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Error
+CLASS_ELEMENT_TYPE_REMOVED_FIELD=Error
+CLASS_ELEMENT_TYPE_REMOVED_METHOD=Error
+CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Error
+ENUM_ELEMENT_TYPE_REMOVED_FIELD=Error
+ENUM_ELEMENT_TYPE_REMOVED_METHOD=Error
+ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+FIELD_ELEMENT_TYPE_ADDED_VALUE=Error
+FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+FIELD_ELEMENT_TYPE_CHANGED_TYPE=Error
+FIELD_ELEMENT_TYPE_CHANGED_VALUE=Error
+FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Error
+FIELD_ELEMENT_TYPE_REMOVED_VALUE=Error
+ILLEGAL_EXTEND=Warning
+ILLEGAL_IMPLEMENT=Warning
+ILLEGAL_INSTANTIATE=Warning
+ILLEGAL_OVERRIDE=Warning
+ILLEGAL_REFERENCE=Warning
+INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Error
+INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Error
+INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Error
+INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+INVALID_JAVADOC_TAG=Warning
+INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Warning
+LEAK_EXTEND=Warning
+LEAK_FIELD_DECL=Warning
+LEAK_IMPLEMENT=Warning
+LEAK_METHOD_PARAM=Warning
+LEAK_METHOD_RETURN_TYPE=Warning
+METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Error
+METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Error
+METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Error
+METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Error
+METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Error
+METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Error
+METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Error
+MISSING_EE_DESCRIPTIONS=Ignore
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Error
+TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Error
+UNUSED_PROBLEM_FILTERS=Warning
+automatically_removed_unused_problem_filters=false
+eclipse.preferences.version=1
+incompatible_api_component_version=Error
+incompatible_api_component_version_include_major_without_breaking_change=Disabled
+incompatible_api_component_version_include_minor_without_api_change=Disabled
+invalid_since_tag_version=Ignore
+malformed_since_tag=Error
+missing_since_tag=Ignore
+report_api_breakage_when_major_version_incremented=Disabled
+report_resolution_errors_api_component=Warning
--- /dev/null
+compilers.f.unresolved-features=1
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=1
+compilers.p.build=1
+compilers.p.build.bin.includes=1
+compilers.p.build.encodings=2
+compilers.p.build.java.compiler=2
+compilers.p.build.java.compliance=1
+compilers.p.build.missing.output=2
+compilers.p.build.output.library=1
+compilers.p.build.source.library=1
+compilers.p.build.src.includes=1
+compilers.p.deprecated=1
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=1
+compilers.p.missing-version-export-package=2
+compilers.p.missing-version-import-package=2
+compilers.p.missing-version-require-bundle=2
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=2
+compilers.p.unknown-attribute=1
+compilers.p.unknown-class=1
+compilers.p.unknown-element=1
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=1
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+eclipse.preferences.version=1
--- /dev/null
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-Vendor: %Bundle-Vendor
+Bundle-Version: 3.0.0.qualifier
+Bundle-Localization: plugin
+Bundle-SymbolicName: org.eclipse.linuxtools.ctf.parser.tests;singleton:=true
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Require-Bundle: org.junit;bundle-version="4.0.0",
+ org.eclipse.core.runtime,
+ org.eclipse.linuxtools.ctf.parser;bundle-version="3.0.0"
+Export-Package: org.eclipse.linuxtools.ctf.parser.tests
+Import-Package: org.antlr.runtime;version="3.2.0",
+ org.antlr.runtime.tree;version="3.2.0"
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2006</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
\ No newline at end of file
--- /dev/null
+###############################################################################
+# Copyright (c) 2013 Ericsson
+#
+# 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:
+# Etienne Bergeron - Initial API and implementation
+###############################################################################
+
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.properties
+src.includes = about.html
--- /dev/null
+###############################################################################
+# Copyright (c) 2013 Ericsson
+#
+# 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:
+# Etienne Bergeron - Initial API and implementation
+###############################################################################
+
+#Properties file for org.eclipse.linuxtools.ctf.parser.tests
+Bundle-Vendor = Eclipse Linux Tools
+Bundle-Name = Linux Tools CTF Parser Tests Plug-in
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2013 Ericsson
+
+ 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
+-->
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>linuxtools-lttng-parent</artifactId>
+ <groupId>org.eclipse.linuxtools.lttng</groupId>
+ <version>3.0.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>org.eclipse.linuxtools.ctf.parser.tests</artifactId>
+ <groupId>org.eclipse.linuxtools.ctf</groupId>
+ <version>3.0.0-SNAPSHOT</version>
+ <packaging>eclipse-test-plugin</packaging>
+
+ <name>Linux Tools CTF Parser Tests Plug-in</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-surefire-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <configuration>
+ <testSuite>org.eclipse.linuxtools.ctf.parser.tests</testSuite>
+ <testClass>org.eclipse.linuxtools.ctf.parser.tests.AllCtfParserTests</testClass>
+ <useUIHarness>false</useUIHarness>
+ <useUIThread>false</useUIThread>
+ <product>org.eclipse.platform.ide</product>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2013 Ericsson
+ *
+ * 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:
+ * Etienne Bergeron - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.ctf.parser.tests;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+/**
+ * Master test suite for CTF parser.
+ */
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+ CtfLexerTest.class,
+ CtfParserTest.class
+})
+
+public class AllCtfParserTests {
+
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2013 Etienne Bergeron
+ *
+ * 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:
+ * Etienne Bergeron - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.ctf.parser.tests;
+
+import static org.junit.Assert.fail;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.antlr.runtime.ANTLRStringStream;
+import org.antlr.runtime.CharStream;
+import org.antlr.runtime.Token;
+import org.eclipse.linuxtools.ctf.parser.CTFLexer;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * This test validates the CTF-Lexer implementation.
+ *
+ * The test splits a string into tokens with the compiled lexer and
+ * validates the sequences of tokens produced by comparing their type
+ * and content.
+ *
+ * @author Etienne Bergeron
+ */
+public class CtfLexerTest {
+
+ // ------------------------------------------------------------------------
+ // Attributes
+ // ------------------------------------------------------------------------
+
+ private final List<Token> tokens = new LinkedList<Token>();
+
+ // ------------------------------------------------------------------------
+ // Operations
+ // ------------------------------------------------------------------------
+
+ private void tokenize(String content) {
+ CharStream cs = new ANTLRStringStream(content);
+ CTFLexer lexer = new CTFLexer(cs);
+
+ tokens.clear();
+ for (;;) {
+ Token token = lexer.nextToken();
+ if (token == Token.EOF_TOKEN) {
+ return;
+ }
+ tokens.add(token);
+ }
+ }
+
+ private void checkToken(int type, String content) {
+ Token token = tokens.remove(0);
+ if (token.getType() != type) {
+ fail("Invalid type [value " + token.getType()
+ + " but expect " + type + "]."
+ + " Fail to tokenize:" + content);
+ } else if (token.getText().compareTo(content) != 0) {
+ fail("Invalid content [value " + token.getText()
+ + " but expect " + content + "].");
+ }
+ }
+
+ private void checkSingle(int type, String content) {
+ tokenize(content);
+ checkToken(type, content);
+ }
+
+ // ------------------------------------------------------------------------
+ // Test cases
+ // ------------------------------------------------------------------------
+
+ /**
+ * Validate the parsing of keywords
+ */
+ @Test
+ public void testKeywords() {
+ checkSingle(CTFLexer.ALIGNTOK, "align");
+ checkSingle(CTFLexer.CONSTTOK, "const");
+ checkSingle(CTFLexer.CHARTOK, "char");
+ checkSingle(CTFLexer.DOUBLETOK, "double");
+ checkSingle(CTFLexer.ENUMTOK, "enum");
+ checkSingle(CTFLexer.EVENTTOK, "event");
+ checkSingle(CTFLexer.FLOATINGPOINTTOK, "floating_point");
+ checkSingle(CTFLexer.FLOATTOK, "float");
+ checkSingle(CTFLexer.INTEGERTOK, "integer");
+ checkSingle(CTFLexer.INTTOK, "int");
+ checkSingle(CTFLexer.LONGTOK, "long");
+ checkSingle(CTFLexer.SHORTTOK, "short");
+ checkSingle(CTFLexer.SIGNEDTOK, "signed");
+ checkSingle(CTFLexer.STREAMTOK, "stream");
+ checkSingle(CTFLexer.STRINGTOK, "string");
+ checkSingle(CTFLexer.STRUCTTOK, "struct");
+ checkSingle(CTFLexer.TRACETOK, "trace");
+ checkSingle(CTFLexer.TYPEALIASTOK, "typealias");
+ checkSingle(CTFLexer.TYPEDEFTOK, "typedef");
+ checkSingle(CTFLexer.UNSIGNEDTOK, "unsigned");
+ checkSingle(CTFLexer.VARIANTTOK, "variant");
+ checkSingle(CTFLexer.VOIDTOK, "void");
+ checkSingle(CTFLexer.BOOLTOK, "_Bool");
+ checkSingle(CTFLexer.COMPLEXTOK, "_Complex");
+ checkSingle(CTFLexer.IMAGINARYTOK, "_Imaginary");
+ checkSingle(CTFLexer.ENVTOK, "env");
+ checkSingle(CTFLexer.CLOCKTOK, "clock");
+ checkSingle(CTFLexer.CALLSITETOK, "callsite");
+ checkSingle(CTFLexer.NANNUMBERTOK, "NaN");
+ checkSingle(CTFLexer.INFINITYTOK, "+inf");
+ checkSingle(CTFLexer.NINFINITYTOK, "-inf");
+ }
+
+ /**
+ * Validate the parsing of symbols
+ */
+ @Test
+ public void testSymbols() {
+ tokenize(" , : ... ");
+ checkToken(CTFLexer.WS, " ");
+ checkToken(CTFLexer.SEPARATOR, ",");
+ checkToken(CTFLexer.WS, " ");
+ checkToken(CTFLexer.COLON, ":");
+ checkToken(CTFLexer.WS, " ");
+ checkToken(CTFLexer.ELIPSES, "...");
+ checkToken(CTFLexer.WS, " ");
+
+ tokenize(" = := = ");
+ checkToken(CTFLexer.WS, " ");
+ checkToken(CTFLexer.ASSIGNMENT, "=");
+ checkToken(CTFLexer.WS, " ");
+ checkToken(CTFLexer.TYPE_ASSIGNMENT, ":=");
+ checkToken(CTFLexer.WS, " ");
+
+ tokenize(" <<>> ");
+ checkToken(CTFLexer.WS, " ");
+ checkToken(CTFLexer.LT, "<");
+ checkToken(CTFLexer.LT, "<");
+ checkToken(CTFLexer.GT, ">");
+ checkToken(CTFLexer.GT, ">");
+ checkToken(CTFLexer.WS, " ");
+
+ tokenize(" ({[]}) ");
+ checkToken(CTFLexer.WS, " ");
+ checkToken(CTFLexer.LPAREN, "(");
+ checkToken(CTFLexer.LCURL, "{");
+ checkToken(CTFLexer.OPENBRAC, "[");
+ checkToken(CTFLexer.CLOSEBRAC, "]");
+ checkToken(CTFLexer.RCURL, "}");
+ checkToken(CTFLexer.RPAREN, ")");
+ checkToken(CTFLexer.WS, " ");
+
+ tokenize(";;");
+ checkToken(CTFLexer.TERM, ";");
+ checkToken(CTFLexer.TERM, ";");
+
+ tokenize(" ++ -- ");
+ checkToken(CTFLexer.WS, " ");
+ checkToken(CTFLexer.SIGN, "+");
+ checkToken(CTFLexer.SIGN, "+");
+ checkToken(CTFLexer.WS, " ");
+ checkToken(CTFLexer.SIGN, "-");
+ checkToken(CTFLexer.SIGN, "-");
+ checkToken(CTFLexer.WS, " ");
+
+ tokenize("-> .*.");
+ checkToken(CTFLexer.ARROW, "->");
+ checkToken(CTFLexer.WS, " ");
+ checkToken(CTFLexer.DOT, ".");
+ checkToken(CTFLexer.POINTER, "*");
+ checkToken(CTFLexer.DOT, ".");
+ }
+
+ /**
+ * Validate the parsing of literals
+ */
+ @Test
+ public void testLiterals() {
+ tokenize("01 02 010");
+ checkToken(CTFLexer.OCTAL_LITERAL, "01");
+ checkToken(CTFLexer.WS, " ");
+ checkToken(CTFLexer.OCTAL_LITERAL, "02");
+ checkToken(CTFLexer.WS, " ");
+ checkToken(CTFLexer.OCTAL_LITERAL, "010");
+
+ tokenize("1 2 10 1024 ");
+ checkToken(CTFLexer.DECIMAL_LITERAL, "1");
+ checkToken(CTFLexer.WS, " ");
+ checkToken(CTFLexer.DECIMAL_LITERAL, "2");
+ checkToken(CTFLexer.WS, " ");
+ checkToken(CTFLexer.DECIMAL_LITERAL, "10");
+ checkToken(CTFLexer.WS, " ");
+ checkToken(CTFLexer.DECIMAL_LITERAL, "1024");
+ checkToken(CTFLexer.WS, " ");
+
+ tokenize("0x01 0x02 0x0F0");
+ checkToken(CTFLexer.HEX_LITERAL, "0x01");
+ checkToken(CTFLexer.WS, " ");
+ checkToken(CTFLexer.HEX_LITERAL, "0x02");
+ checkToken(CTFLexer.WS, " ");
+ checkToken(CTFLexer.HEX_LITERAL, "0x0F0");
+ }
+
+ /**
+ * Validate the parsing of literals with hexa prefix
+ */
+ @Test
+ public void testLiteralPrefixes() {
+ checkSingle(CTFLexer.HEX_LITERAL, "0x1");
+ checkSingle(CTFLexer.HEX_LITERAL, "0X1");
+ }
+
+ /**
+ * Validate the parsing of literals with type suffix
+ */
+ @Test
+ public void testLiteralSuffixes() {
+ checkSingle(CTFLexer.DECIMAL_LITERAL, "0l");
+ checkSingle(CTFLexer.DECIMAL_LITERAL, "0L");
+ checkSingle(CTFLexer.DECIMAL_LITERAL, "0ll");
+ checkSingle(CTFLexer.DECIMAL_LITERAL, "0LL");
+ checkSingle(CTFLexer.DECIMAL_LITERAL, "0ul");
+ checkSingle(CTFLexer.DECIMAL_LITERAL, "0uL");
+ checkSingle(CTFLexer.DECIMAL_LITERAL, "0ull");
+ checkSingle(CTFLexer.DECIMAL_LITERAL, "0uLL");
+ checkSingle(CTFLexer.DECIMAL_LITERAL, "0Ul");
+ checkSingle(CTFLexer.DECIMAL_LITERAL, "0UL");
+ checkSingle(CTFLexer.DECIMAL_LITERAL, "0Ull");
+ checkSingle(CTFLexer.DECIMAL_LITERAL, "0ULL");
+ }
+
+ /**
+ * Validate the accepted characters in literals.
+ */
+ @Test
+ public void testLiteralDigits() {
+ checkSingle(CTFLexer.OCTAL_LITERAL, "001234567");
+
+ checkSingle(CTFLexer.DECIMAL_LITERAL, "123456");
+ checkSingle(CTFLexer.DECIMAL_LITERAL, "987654");
+
+ checkSingle(CTFLexer.HEX_LITERAL, "0x012345");
+ checkSingle(CTFLexer.HEX_LITERAL, "0x678990");
+ checkSingle(CTFLexer.HEX_LITERAL, "0xABCDEF");
+ checkSingle(CTFLexer.HEX_LITERAL, "0xabcdef");
+ }
+
+ /**
+ * Validate zero literal to be the right token.
+ */
+ @Test
+ public void testLiteralZero() {
+ checkSingle(CTFLexer.OCTAL_LITERAL, "00");
+ checkSingle(CTFLexer.DECIMAL_LITERAL, "0");
+ checkSingle(CTFLexer.HEX_LITERAL, "0x0");
+ }
+
+ /**
+ * Validate character literals
+ */
+ @Test
+ public void testCharLiteral() {
+ checkSingle(CTFLexer.CHARACTER_LITERAL, "'x'");
+ checkSingle(CTFLexer.CHARACTER_LITERAL, "'\\''");
+ checkSingle(CTFLexer.CHARACTER_LITERAL, "' '");
+ checkSingle(CTFLexer.CHARACTER_LITERAL, "L'1'");
+ }
+
+ /**
+ * Validate escaped character literals
+ */
+ @Test
+ public void testEscapeCharLiteral() {
+ checkSingle(CTFLexer.CHARACTER_LITERAL, "'\\a'");
+ checkSingle(CTFLexer.CHARACTER_LITERAL, "'\\b'");
+ checkSingle(CTFLexer.CHARACTER_LITERAL, "'\\f'");
+ checkSingle(CTFLexer.CHARACTER_LITERAL, "'\\n'");
+ checkSingle(CTFLexer.CHARACTER_LITERAL, "'\\r'");
+ checkSingle(CTFLexer.CHARACTER_LITERAL, "'\\t'");
+ checkSingle(CTFLexer.CHARACTER_LITERAL, "'\\v'");
+ checkSingle(CTFLexer.CHARACTER_LITERAL, "'\\''");
+ checkSingle(CTFLexer.CHARACTER_LITERAL, "'\\\"'");
+ checkSingle(CTFLexer.CHARACTER_LITERAL, "'\\\\'");
+
+ checkSingle(CTFLexer.CHARACTER_LITERAL, "'\001'");
+ checkSingle(CTFLexer.CHARACTER_LITERAL, "'\01'");
+ checkSingle(CTFLexer.CHARACTER_LITERAL, "'\1'");
+
+ checkSingle(CTFLexer.CHARACTER_LITERAL, "'\\x1A'");
+ checkSingle(CTFLexer.CHARACTER_LITERAL, "'\\x1a'");
+ checkSingle(CTFLexer.CHARACTER_LITERAL, "'\\xa'");
+ checkSingle(CTFLexer.CHARACTER_LITERAL, "'\\x0'");
+
+ checkSingle(CTFLexer.CHARACTER_LITERAL, "'\uABCD'");
+ checkSingle(CTFLexer.CHARACTER_LITERAL, "'\u0123'");
+ checkSingle(CTFLexer.CHARACTER_LITERAL, "'\u012345678'");
+ checkSingle(CTFLexer.CHARACTER_LITERAL, "'\uFEDCBA987'");
+ }
+
+ /**
+ * Validate string literals
+ */
+ @Test
+ public void testStringLiteral() {
+ checkSingle(CTFLexer.STRING_LITERAL, "\"\"");
+ checkSingle(CTFLexer.STRING_LITERAL, "\"x\"");
+ checkSingle(CTFLexer.STRING_LITERAL, "\"\\\"\"");
+ checkSingle(CTFLexer.STRING_LITERAL, "\" \"");
+ checkSingle(CTFLexer.STRING_LITERAL, "L\"1\"");
+
+ checkSingle(CTFLexer.STRING_LITERAL, "\"This is \\n a multiline\\r\\n\"");
+ checkSingle(CTFLexer.STRING_LITERAL, "L\"This is \\n a multiline\\r\\n\"");
+ }
+
+ /**
+ * Validate string literals with escape sequence
+ */
+ @Test
+ public void testEscapeStringLiteral() {
+ checkSingle(CTFLexer.STRING_LITERAL, "\"\\a\"");
+ checkSingle(CTFLexer.STRING_LITERAL, "\"\\b\"");
+ checkSingle(CTFLexer.STRING_LITERAL, "\"\\f\"");
+ checkSingle(CTFLexer.STRING_LITERAL, "\"\\n\"");
+ checkSingle(CTFLexer.STRING_LITERAL, "\"\\r\"");
+ checkSingle(CTFLexer.STRING_LITERAL, "\"\\t\"");
+ checkSingle(CTFLexer.STRING_LITERAL, "\"\\v\"");
+ checkSingle(CTFLexer.STRING_LITERAL, "\"\\'\"");
+ checkSingle(CTFLexer.STRING_LITERAL, "\"\\\"\"");
+ checkSingle(CTFLexer.STRING_LITERAL, "\"\\\\\"");
+
+ checkSingle(CTFLexer.STRING_LITERAL, "\"\001\"");
+ checkSingle(CTFLexer.STRING_LITERAL, "\"\01\"");
+ checkSingle(CTFLexer.STRING_LITERAL, "\"\1\"");
+
+ checkSingle(CTFLexer.STRING_LITERAL, "\"\\x1A\"");
+ checkSingle(CTFLexer.STRING_LITERAL, "\"\\x1a\"");
+ checkSingle(CTFLexer.STRING_LITERAL, "\"\\xa\"");
+ checkSingle(CTFLexer.STRING_LITERAL, "\"\\x0\"");
+
+ checkSingle(CTFLexer.STRING_LITERAL, "\"\uABCD\"");
+ checkSingle(CTFLexer.STRING_LITERAL, "\"\u0123\"");
+ checkSingle(CTFLexer.STRING_LITERAL, "\"\u012345678\"");
+ checkSingle(CTFLexer.STRING_LITERAL, "\"\uFEDCBA987\"");
+ }
+
+ /**
+ * Validate spaces parsing
+ */
+ @Test
+ public void testWhitespaces() {
+ tokenize(" \r\t\n\u000C ");
+ checkToken(CTFLexer.WS, " ");
+ checkToken(CTFLexer.WS, " ");
+ checkToken(CTFLexer.WS, "\r");
+ checkToken(CTFLexer.WS, "\t");
+ checkToken(CTFLexer.WS, "\n");
+ checkToken(CTFLexer.WS, "\u000C");
+ checkToken(CTFLexer.WS, " ");
+ }
+
+ /**
+ * Validate comments parsing
+ */
+ @Test
+ public void testComment() {
+ tokenize(" /* test */ ");
+ checkToken(CTFLexer.WS, " ");
+ checkToken(CTFLexer.COMMENT, "/* test */");
+ checkToken(CTFLexer.WS, " ");
+ }
+
+ /**
+ * Validate complex nested comments parsing
+ */
+ @Test
+ public void testNestedComment() {
+ tokenize(" /* /* */ ");
+ checkToken(CTFLexer.WS, " ");
+ checkToken(CTFLexer.COMMENT, "/* /* */");
+ checkToken(CTFLexer.WS, " ");
+
+ tokenize(" /* /* * ** / */ ");
+ checkToken(CTFLexer.WS, " ");
+ checkToken(CTFLexer.COMMENT, "/* /* * ** / */");
+ checkToken(CTFLexer.WS, " ");
+ }
+
+ /**
+ * Validate multi-lines comments
+ */
+ @Test
+ public void testMultiLineComment() {
+ tokenize(" /*\ntest\n*/ ");
+ checkToken(CTFLexer.WS, " ");
+ checkToken(CTFLexer.COMMENT, "/*\ntest\n*/");
+ checkToken(CTFLexer.WS, " ");
+ }
+
+ /**
+ * Validate single line comments
+ */
+ @Test
+ public void testLineComment() {
+ tokenize(" // asdad\r\n ");
+ checkToken(CTFLexer.WS, " ");
+ checkToken(CTFLexer.LINE_COMMENT, "// asdad\r\n");
+ checkToken(CTFLexer.WS, " ");
+ }
+
+ /**
+ * Validate incomplete comments parsing
+ */
+ @Ignore("Lexer must be fixed first")
+ @Test
+ public void testLineCommentWithEOF() {
+ tokenize("//");
+ checkToken(CTFLexer.LINE_COMMENT, "//");
+ }
+
+ /**
+ * Validate parsing of mixed kind of comments
+ */
+ @Test
+ public void testMixedComment() {
+ tokenize(" // /*\n");
+ checkToken(CTFLexer.WS, " ");
+ checkToken(CTFLexer.LINE_COMMENT, "// /*\n");
+
+ tokenize(" /*\n//\n*/ ");
+ checkToken(CTFLexer.WS, " ");
+ checkToken(CTFLexer.COMMENT, "/*\n//\n*/");
+ checkToken(CTFLexer.WS, " ");
+ }
+
+ /**
+ * Validate parsing identifiers
+ */
+ @Test
+ public void testIdentifier() {
+ tokenize("_ a a1 B ");
+ checkToken(CTFLexer.IDENTIFIER, "_");
+ checkToken(CTFLexer.WS, " ");
+ checkToken(CTFLexer.IDENTIFIER, "a");
+ checkToken(CTFLexer.WS, " ");
+ checkToken(CTFLexer.IDENTIFIER, "a1");
+ checkToken(CTFLexer.WS, " ");
+ checkToken(CTFLexer.IDENTIFIER, "B");
+ checkToken(CTFLexer.WS, " ");
+ }
+
+ /**
+ * Validate accepted characters within an identifier
+ */
+ @Test
+ public void testIdentifierLetters() {
+ checkSingle(CTFLexer.IDENTIFIER, "ABCDEFGHI");
+ checkSingle(CTFLexer.IDENTIFIER, "JKLMNOPQR");
+ checkSingle(CTFLexer.IDENTIFIER, "STUVWXYZ");
+ checkSingle(CTFLexer.IDENTIFIER, "abcdefghi");
+ checkSingle(CTFLexer.IDENTIFIER, "jklmnopqr");
+ checkSingle(CTFLexer.IDENTIFIER, "stuvwxyz");
+ checkSingle(CTFLexer.IDENTIFIER, "_0123456789");
+ }
+}
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2013 Etienne Bergeron
+ *
+ * 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:
+ * Etienne Bergeron - Initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.ctf.parser.tests;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import org.antlr.runtime.ANTLRStringStream;
+import org.antlr.runtime.CharStream;
+import org.antlr.runtime.CommonTokenStream;
+import org.antlr.runtime.RecognitionException;
+import org.antlr.runtime.tree.CommonTree;
+import org.eclipse.linuxtools.ctf.parser.CTFLexer;
+import org.eclipse.linuxtools.ctf.parser.CTFParser;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * This test validates the CTF-Parser implementation.
+ *
+ * The goal of these tests is to validate syntactic rules and not the
+ * CTF semantic. Each test parses a string with a given rule of the
+ * compiled parser and validates the resulting tree by using match rules.
+ *
+ * @author Etienne Bergeron
+ */
+public class CtfParserTest {
+
+ // ------------------------------------------------------------------------
+ // Attributes
+ // ------------------------------------------------------------------------
+
+ private CTFParser parser;
+
+ // ------------------------------------------------------------------------
+ // Matches - Helper class and functions to match a parsed tree.
+ // ------------------------------------------------------------------------
+
+ private class TreeMatcher {
+ int fType;
+ String fText;
+ TreeMatcher[] fChild;
+
+ TreeMatcher(int type, String text, TreeMatcher child[]) {
+ fType = type;
+ fText = text;
+ fChild = child;
+ }
+
+ void matches(CommonTree tree) {
+ if (fType == -1) {
+ return;
+ }
+ if (tree.getType() != fType) {
+ fail("Type mismatch!" +
+ " expected:" + fType +
+ " actual:" + tree.getType());
+ }
+
+ if (fText != null) {
+ if (tree.getText().compareTo(fText) != 0) {
+ fail("Text mismatch!" +
+ " expected:" + fText +
+ " actual:" + tree.getText());
+ }
+ }
+
+ if (fChild != null) {
+ int size = fChild.length;
+ if (tree.getChildren() == null) {
+ if (size != 0) {
+ fail("Invalid children!"
+ + "Expect: " + size + "child");
+ }
+ } else {
+ if (tree.getChildren().size() != size) {
+ fail("Invalid number of childs!"
+ + " expected:" + size
+ + " actual:" + tree.getChildren().size());
+ }
+
+ for (int i = 0; i < size; ++i) {
+ fChild[i].matches((CommonTree) tree.getChild(i));
+ }
+ }
+ }
+ }
+ }
+
+ void Matches(TreeMatcher matcher, CommonTree tree) {
+ if (tree == null) {
+ fail("Parsing failed!");
+ }
+ matcher.matches(tree);
+ }
+
+ TreeMatcher All() {
+ return new TreeMatcher(-1, null, null);
+ }
+
+ TreeMatcher Node(int type, TreeMatcher... child) {
+ return new TreeMatcher(type, null, child);
+ }
+
+ TreeMatcher Node(int type, String text, TreeMatcher... child) {
+ return new TreeMatcher(type, text, child);
+ }
+
+ TreeMatcher List(TreeMatcher... child) {
+ return new TreeMatcher(0, null, child);
+ }
+
+ // ------------------------------------------------------------------------
+ // Operations
+ // ------------------------------------------------------------------------
+
+ private void setInput(String content) {
+ CharStream cs = new ANTLRStringStream(content);
+ CTFLexer lexer = new CTFLexer(cs);
+ CommonTokenStream tokens = new CommonTokenStream(lexer);
+ parser = new CTFParser(tokens, false);
+ }
+
+ private CommonTree primaryExpression(String content) {
+ try {
+ setInput(content);
+ return (CommonTree) parser.primaryExpression().getTree();
+ } catch (RecognitionException e) {
+ return null;
+ }
+ }
+
+ private CommonTree unaryExpression(String content) {
+ try {
+ setInput(content);
+ return (CommonTree) parser.unaryExpression().getTree();
+ } catch (RecognitionException e) {
+ return null;
+ }
+ }
+
+ private CommonTree declaration(String content) {
+ try {
+ setInput(content);
+ return (CommonTree) parser.declaration().getTree();
+ } catch (RecognitionException e) {
+ return null;
+ }
+ }
+
+ // ------------------------------------------------------------------------
+ // Test cases
+ // ------------------------------------------------------------------------
+
+
+ /**
+ * Validate that parsing of an empty expression is invalid.
+ */
+ @Test
+ public void testPrimaryExpression() {
+ CommonTree tree_empty = primaryExpression("");
+ assertEquals(null, tree_empty);
+ }
+
+ /**
+ * Validate parsing of literals through a primary expression
+ */
+ @Test
+ public void testIntegerLiteralPrimaryExpression() {
+ Matches(Node(CTFParser.UNARY_EXPRESSION_DEC,
+ Node(CTFParser.DECIMAL_LITERAL, "123")),
+ primaryExpression("123"));
+
+ Matches(Node(CTFParser.UNARY_EXPRESSION_HEX,
+ Node(CTFParser.HEX_LITERAL, "0x123")),
+ primaryExpression("0x123"));
+
+ Matches(Node(CTFParser.UNARY_EXPRESSION_OCT,
+ Node(CTFParser.OCTAL_LITERAL, "0123")),
+ primaryExpression("0123"));
+
+ Matches(Node(CTFParser.UNARY_EXPRESSION_DEC,
+ Node(CTFParser.DECIMAL_LITERAL, "123"),
+ Node(CTFParser.SIGN, "-")),
+ primaryExpression("-123"));
+
+ Matches(Node(CTFParser.UNARY_EXPRESSION_DEC,
+ Node(CTFParser.DECIMAL_LITERAL, "123"),
+ Node(CTFParser.SIGN, "-")),
+ primaryExpression(" - 123"));
+
+ Matches(Node(CTFParser.UNARY_EXPRESSION_DEC,
+ Node(CTFParser.DECIMAL_LITERAL, "123"),
+ Node(CTFParser.SIGN, "-"),
+ Node(CTFParser.SIGN, "-"),
+ Node(CTFParser.SIGN, "+")),
+ primaryExpression(" - - + 123"));
+
+ Matches(Node(CTFParser.UNARY_EXPRESSION_HEX,
+ Node(CTFParser.HEX_LITERAL, "0x123"),
+ Node(CTFParser.SIGN, "+"),
+ Node(CTFParser.SIGN, "-")),
+ primaryExpression("+ - 0x123"));
+
+ Matches(Node(CTFParser.UNARY_EXPRESSION_OCT,
+ Node(CTFParser.OCTAL_LITERAL, "0123"),
+ Node(CTFParser.SIGN, "+"),
+ Node(CTFParser.SIGN, "-")),
+ primaryExpression("+ - 0123"));
+ }
+
+ /**
+ * Validate parsing of a character literals through a primary expression
+ */
+ @Test
+ public void testCharacterLiteralPrimaryExpression() {
+ Matches(Node(CTFParser.CHARACTER_LITERAL, "'a'"),
+ primaryExpression("'a'"));
+
+ Matches(Node(CTFParser.CHARACTER_LITERAL, "'\\n'"),
+ primaryExpression("'\\n'"));
+ }
+
+ /**
+ * Validate parsing of a string literals through a primary expression
+ */
+ @Test
+ public void testStringLiteralPrimaryExpression() {
+ Matches(Node(CTFParser.UNARY_EXPRESSION_STRING_QUOTES,
+ Node(CTFParser.STRING_LITERAL, "\"aaa\"")),
+ primaryExpression("\"aaa\""));
+
+ Matches(Node(CTFParser.UNARY_EXPRESSION_STRING_QUOTES,
+ Node(CTFParser.STRING_LITERAL, "L\"aaa\"")),
+ primaryExpression("L\"aaa\""));
+
+ Matches(Node(CTFParser.UNARY_EXPRESSION_STRING_QUOTES,
+ Node(CTFParser.STRING_LITERAL, "\"aaa\\n\"")),
+ primaryExpression("\"aaa\\n\""));
+ }
+
+ /**
+ * Validate parsing of keywords through a primary expression
+ */
+ @Test
+ public void testKeywordPrimaryExpression() {
+ Matches(Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.SIGNEDTOK, "signed")),
+ primaryExpression("signed"));
+ Matches(Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.ALIGNTOK, "align")),
+ primaryExpression("align"));
+ }
+
+ /**
+ * Validate parsing of identifiers through a primary expression
+ */
+ @Test
+ public void testIdentifierPrimaryExpression() {
+ Matches(Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.IDENTIFIER, "x")),
+ primaryExpression("x"));
+ Matches(Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.IDENTIFIER, "_123")),
+ primaryExpression("_123"));
+ }
+
+ /**
+ * Validate that parsing of an empty unary expression is invalid.
+ */
+ @Test
+ public void testUnaryExpression() {
+ CommonTree tree_empty = unaryExpression("");
+ assertEquals(null, tree_empty);
+ }
+
+ /**
+ * Validate parsing primary expression through an unary expression
+ */
+ @Test
+ public void testSimpleUnaryExpression() {
+ Matches(Node(CTFParser.UNARY_EXPRESSION_DEC,
+ Node(CTFParser.DECIMAL_LITERAL, "123")),
+ unaryExpression("123"));
+
+ Matches(Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.IDENTIFIER, "x")),
+ unaryExpression("x"));
+ }
+
+ /**
+ * Validate parsing array through an unary expression
+ */
+ @Test
+ public void testArrayUnaryExpression() {
+ Matches(List(Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.IDENTIFIER, "x")),
+ Node(CTFParser.OPENBRAC),
+ Node(CTFParser.UNARY_EXPRESSION_DEC,
+ Node(CTFParser.DECIMAL_LITERAL, "1"))),
+ unaryExpression("x[1]"));
+
+ Matches(List(Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.IDENTIFIER, "x")),
+ Node(CTFParser.OPENBRAC),
+ Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.IDENTIFIER, "n"))),
+ unaryExpression("x[n]"));
+
+ Matches(List(Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.IDENTIFIER, "x")),
+ Node(CTFParser.OPENBRAC),
+ Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.IDENTIFIER, "n")),
+ Node(CTFParser.OPENBRAC),
+ Node(CTFParser.UNARY_EXPRESSION_DEC,
+ Node(CTFParser.DECIMAL_LITERAL, "1"))),
+ unaryExpression("x[n][1]"));
+
+ Matches(List(Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.IDENTIFIER, "x")),
+ Node(CTFParser.OPENBRAC),
+ Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.IDENTIFIER, "n")),
+ Node(CTFParser.OPENBRAC),
+ Node(CTFParser.UNARY_EXPRESSION_DEC,
+ Node(CTFParser.DECIMAL_LITERAL, "1"),
+ Node(CTFParser.SIGN, "+"))),
+ unaryExpression("x[n][+1]"));
+ }
+
+ /**
+ * Validate parsing array with keywords through an unary expression
+ */
+ @Test
+ public void testSpecialArrayUnaryExpression() {
+ // Added for CTF-v1.8
+ Matches(List(Node(CTFParser.TRACE),
+ Node(CTFParser.OPENBRAC),
+ Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.IDENTIFIER, "n"))),
+ unaryExpression("trace[n]"));
+
+ Matches(List(Node(CTFParser.CLOCK),
+ Node(CTFParser.OPENBRAC),
+ Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.IDENTIFIER, "n")),
+ Node(CTFParser.OPENBRAC),
+ Node(CTFParser.UNARY_EXPRESSION_DEC,
+ Node(CTFParser.DECIMAL_LITERAL, "1"))),
+ unaryExpression("clock[n][1]"));
+ }
+
+ /**
+ * Validate parsing member expression through an unary expression
+ */
+ @Test
+ public void testMemberUnaryExpression() {
+ Matches(List(Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.IDENTIFIER, "x")),
+ Node(CTFParser.DOT,
+ Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.IDENTIFIER, "y")))),
+ unaryExpression("x.y"));
+
+ Matches(List(Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.IDENTIFIER, "x")),
+ Node(CTFParser.DOT,
+ Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.IDENTIFIER, "y"))),
+ Node(CTFParser.DOT,
+ Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.IDENTIFIER, "z")))),
+ unaryExpression("x.y.z"));
+ }
+
+ /**
+ * Validate parsing pointer expression through an unary expression
+ */
+ @Test
+ public void testPointerUnaryExpression() {
+ Matches(List(Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.IDENTIFIER, "x")),
+ Node(CTFParser.ARROW,
+ Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.IDENTIFIER, "y")))),
+ unaryExpression("x->y"));
+
+ Matches(List(Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.IDENTIFIER, "x")),
+ Node(CTFParser.ARROW,
+ Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.IDENTIFIER, "y"))),
+ Node(CTFParser.ARROW,
+ Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.IDENTIFIER, "z")))),
+ unaryExpression("x->y->z"));
+ }
+
+ /**
+ * Validate complex expressions through an unary expression
+ */
+ @Test
+ public void testMixedUnaryExpression() {
+ Matches(List(Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.IDENTIFIER, "x")),
+ Node(CTFParser.OPENBRAC),
+ Node(CTFParser.UNARY_EXPRESSION_DEC,
+ Node(CTFParser.DECIMAL_LITERAL, "2")),
+ Node(CTFParser.ARROW,
+ Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.IDENTIFIER, "y"))),
+ Node(CTFParser.DOT,
+ Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.IDENTIFIER, "z"))),
+ Node(CTFParser.OPENBRAC),
+ Node(CTFParser.UNARY_EXPRESSION_DEC,
+ Node(CTFParser.DECIMAL_LITERAL, "1"))),
+ unaryExpression("x[2]->y.z[1]"));
+ }
+
+ /**
+ * Validate that parsing of an empty declaration is invalid.
+ */
+ @Test
+ public void testDeclaration() {
+ CommonTree tree_empty = declaration("");
+ assertEquals(null, tree_empty);
+ }
+
+ /**
+ * Validate parsing of integer declaration
+ */
+ @Test
+ public void testIntegerTypeAliasDeclaration() {
+ // TODO: replace the "all" match with a better tree matcher.
+ Matches(All(),
+ declaration("typealias integer { } := int;"));
+ Matches(All(),
+ declaration("typealias integer { signed=true; } := int;"));
+ }
+
+ /**
+ * Validate parsing of floating declaration
+ */
+ @Test
+ public void testFloatingTypeAliasDeclaration() {
+ // TODO: replace the "all" match with a better tree matcher.
+ Matches(All(),
+ declaration("typealias floating_point { } := float;"));
+ Matches(All(),
+ declaration("typealias floating_point { align = 32; } := float;"));
+ }
+
+ /**
+ * Validate parsing of typedef declaration
+ */
+ @Ignore("This need a fix to the grammar to support a dummy initial scope. ")
+ @Test
+ public void testTypedefDeclaration() {
+ // TODO: replace the "all" match with a better tree matcher.
+ Matches(All(),
+ declaration("typedef dummy int;"));
+ Matches(All(),
+ declaration("typedef integer { } int;"));
+ }
+
+ /**
+ * Validate parsing of an enum declaration
+ */
+ @Test
+ public void testEnumDeclaration() {
+ Matches(Node(CTFParser.DECLARATION,
+ Node(CTFParser.TYPE_SPECIFIER_LIST,
+ Node(CTFParser.ENUM,
+ Node(CTFParser.ENUM_NAME,
+ Node(CTFParser.IDENTIFIER, "name")),
+ Node(CTFParser.ENUM_BODY,
+ Node(CTFParser.ENUM_ENUMERATOR,
+ Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.IDENTIFIER, "A"))))))),
+ declaration("enum name { A };"));
+
+ Matches(Node(CTFParser.DECLARATION,
+ Node(CTFParser.TYPE_SPECIFIER_LIST,
+ Node(CTFParser.ENUM,
+ Node(CTFParser.ENUM_NAME, All()),
+ Node(CTFParser.ENUM_CONTAINER_TYPE,
+ Node(CTFParser.TYPE_SPECIFIER_LIST,
+ Node(CTFParser.INTTOK))),
+ Node(CTFParser.ENUM_BODY, All())))),
+ declaration("enum name : int { A };"));
+
+ Matches(Node(CTFParser.DECLARATION,
+ Node(CTFParser.TYPE_SPECIFIER_LIST,
+ Node(CTFParser.ENUM,
+ Node(CTFParser.ENUM_BODY, All())))),
+ declaration("enum { A };"));
+
+ Matches(Node(CTFParser.DECLARATION,
+ Node(CTFParser.TYPE_SPECIFIER_LIST,
+ Node(CTFParser.ENUM,
+ Node(CTFParser.ENUM_CONTAINER_TYPE,
+ Node(CTFParser.TYPE_SPECIFIER_LIST,
+ Node(CTFParser.INTTOK))),
+ Node(CTFParser.ENUM_BODY, All())))),
+ declaration("enum : int { A };"));
+ }
+
+ /**
+ * Validate parsing of an enumerator
+ */
+ @Ignore("The grammar needs to be fixed.")
+ @Test
+ public void testDeclaratorOfEnumDeclaration() {
+ /* TODO: This test crash the parser. */
+ Matches(All(),
+ declaration("enum { };"));
+
+ Matches(Node(CTFParser.DECLARATION,
+ Node(CTFParser.TYPE_SPECIFIER_LIST,
+ Node(CTFParser.ENUM,
+ Node(CTFParser.ENUM_BODY,
+ Node(CTFParser.ENUM_ENUMERATOR,
+ Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.IDENTIFIER, "A"))),
+ Node(CTFParser.ENUM_ENUMERATOR,
+ Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.IDENTIFIER, "B")),
+ Node(CTFParser.ENUM_VALUE,
+ Node(CTFParser.UNARY_EXPRESSION_DEC,
+ Node(CTFParser.DECIMAL_LITERAL, "2")))),
+ Node(CTFParser.ENUM_ENUMERATOR,
+ Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.IDENTIFIER, "C")),
+ Node(CTFParser.ENUM_VALUE_RANGE,
+ Node(CTFParser.UNARY_EXPRESSION_DEC,
+ Node(CTFParser.DECIMAL_LITERAL, "3")),
+ Node(CTFParser.UNARY_EXPRESSION_DEC,
+ Node(CTFParser.DECIMAL_LITERAL, "5")))))))),
+ declaration("enum { A, B=2, C=3...5 };"));
+
+ Matches(Node(CTFParser.DECLARATION,
+ Node(CTFParser.TYPE_SPECIFIER_LIST,
+ Node(CTFParser.ENUM,
+ Node(CTFParser.ENUM_BODY,
+ Node(CTFParser.ENUM_ENUMERATOR,
+ Node(CTFParser.UNARY_EXPRESSION_STRING_QUOTES,
+ Node(CTFParser.STRING_LITERAL, "\"A\""))),
+ Node(CTFParser.ENUM_ENUMERATOR,
+ Node(CTFParser.UNARY_EXPRESSION_STRING_QUOTES,
+ Node(CTFParser.STRING_LITERAL, "\"B\"")),
+ All()))))),
+ declaration("enum { \"A\", \"B\"=2 };"));
+ }
+
+ /**
+ * Validate parsing of empty declaration
+ */
+ @Ignore("The grammar need to be fixed to support empty ctf-body.")
+ @Test
+ public void testEmptyDeclaration() {
+ /* TODO: An exception is throw when building an common tree without
+ * assignments in the ctf-body.
+ */
+ Matches(All(),
+ declaration("env { };"));
+ Matches(All(),
+ declaration("trace { };"));
+ Matches(All(),
+ declaration("stream { };"));
+ Matches(All(),
+ declaration("event { };"));
+ }
+
+ /**
+ * Validate parsing of an environment declaration
+ */
+ @Test
+ public void testEnvDeclaration() {
+ Matches(Node(CTFParser.ENV,
+ Node(CTFParser.CTF_EXPRESSION_VAL,
+ Node(CTFParser.CTF_LEFT,
+ Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.IDENTIFIER, "pid"))),
+ Node(CTFParser.CTF_RIGHT,
+ Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.IDENTIFIER, "value"))))),
+ declaration("env { pid = value; };"));
+
+ Matches(Node(CTFParser.ENV,
+ Node(CTFParser.CTF_EXPRESSION_VAL, All(), All()),
+ Node(CTFParser.CTF_EXPRESSION_VAL, All(), All()),
+ Node(CTFParser.CTF_EXPRESSION_VAL, All(), All())),
+ declaration("env { pid = value; proc_name = \"name\"; x = y;};"));
+ }
+
+ /**
+ * Validate parsing of a trace declaration
+ */
+ @Ignore("The grammar need to be fixed.")
+ @Test
+ public void testTraceDeclaration() {
+ Matches(Node(CTFParser.TRACE,
+ Node(CTFParser.CTF_EXPRESSION_VAL,
+ Node(CTFParser.CTF_LEFT,
+ Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.IDENTIFIER, "major"))),
+ Node(CTFParser.CTF_RIGHT,
+ Node(CTFParser.UNARY_EXPRESSION_DEC,
+ Node(CTFParser.DECIMAL_LITERAL, "1"))))),
+ declaration("trace { major = 1; };"));
+
+ Matches(Node(CTFParser.TRACE,
+ Node(CTFParser.CTF_EXPRESSION_TYPE,
+ Node(CTFParser.CTF_LEFT,
+ Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.IDENTIFIER, "packet")),
+ Node(CTFParser.DOT,
+ Node(CTFParser.UNARY_EXPRESSION_STRING,
+ Node(CTFParser.IDENTIFIER, "header")))),
+ Node(CTFParser.CTF_RIGHT,
+ Node(CTFParser.TYPE_SPECIFIER_LIST,
+ Node(CTFParser.STRUCT,
+ Node(CTFParser.STRUCT_NAME,
+ Node(CTFParser.IDENTIFIER, "dummy"))))))),
+ declaration("trace { packet.header := struct dummy; };"));
+
+ /* TODO: This test crash the parser. */
+ Matches(Node(CTFParser.TRACE,
+ All()),
+ declaration("trace { typedef x y; };"));
+
+ Matches(Node(CTFParser.TRACE,
+ Node(CTFParser.CTF_EXPRESSION_VAL, All(), All()),
+ Node(CTFParser.CTF_EXPRESSION_VAL, All(), All()),
+ Node(CTFParser.CTF_EXPRESSION_TYPE, All(), All())),
+ declaration("trace { major = 1; minor = 1;"
+ + "packet.header := struct dummy; };"));
+ }
+
+}
Bundle-Localization: plugin
Bundle-SymbolicName: org.eclipse.linuxtools.ctf.parser
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Export-Package: org.eclipse.linuxtools.ctf.parser;x-friends:="org.eclipse.linuxtools.ctf.core"
+Export-Package: org.eclipse.linuxtools.ctf.parser;x-friends:="org.eclipse.linuxtools.ctf.core,org.eclipse.linuxtools.ctf.parser.tests"
Import-Package: org.antlr.runtime;version="3.2.0",
org.antlr.runtime.tree;version="3.2.0"
org.eclipse.linuxtools.lttng2.ust.core.tests;bundle-version="2.1.0",
org.eclipse.linuxtools.lttng2.ust.ui.tests;bundle-version="2.1.0",
org.eclipse.linuxtools.tmf.core.tests;bundle-version="2.1.0",
- org.eclipse.linuxtools.tmf.ui.tests;bundle-version="2.1.0"
+ org.eclipse.linuxtools.tmf.ui.tests;bundle-version="2.1.0",
+ org.eclipse.linuxtools.ctf.parser.tests;bundle-version="3.0.0"
Export-Package: org.eclipse.linuxtools.lttng.alltests;x-internal:=true
@RunWith(Suite.class)
@Suite.SuiteClasses({
org.eclipse.linuxtools.ctf.core.tests.AllCtfCoreTests.class,
+ org.eclipse.linuxtools.ctf.parser.tests.AllCtfParserTests.class,
org.eclipse.linuxtools.gdbtrace.core.tests.AllGdbTraceCoreTests.class,
org.eclipse.linuxtools.gdbtrace.ui.tests.AllGdbTraceUITests.class,
org.eclipse.linuxtools.lttng2.core.tests.AllTests.class,
<module>org.eclipse.linuxtools.ctf.core</module>
<module>org.eclipse.linuxtools.ctf.core.tests</module>
<module>org.eclipse.linuxtools.ctf.parser</module>
+ <module>org.eclipse.linuxtools.ctf.parser.tests</module>
<module>org.eclipse.linuxtools.tmf</module>
<module>org.eclipse.linuxtools.tmf.core</module>