mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-16 08:48:55 +00:00
[IDE] initial commit of IDE test project
This commit is contained in:
parent
4e808e3e4d
commit
937f675950
61 changed files with 11341 additions and 0 deletions
10
tests/org.eclipse.xtext.ide.tests/.classpath
Normal file
10
tests/org.eclipse.xtext.ide.tests/.classpath
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?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="src" path="xtend-gen"/>
|
||||
<classpathentry kind="src" path="testlang-src"/>
|
||||
<classpathentry kind="src" path="testlang-src-gen"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
46
tests/org.eclipse.xtext.ide.tests/.project
Normal file
46
tests/org.eclipse.xtext.ide.tests/.project
Normal file
|
@ -0,0 +1,46 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>org.eclipse.xtext.ide.tests</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
|
||||
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
|
@ -0,0 +1,3 @@
|
|||
#Tue Aug 18 18:37:57 CEST 2009
|
||||
eclipse.preferences.version=1
|
||||
encoding/<project>=ISO-8859-1
|
|
@ -0,0 +1,2 @@
|
|||
eclipse.preferences.version=1
|
||||
line.separator=\n
|
|
@ -0,0 +1,390 @@
|
|||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.builder.cleanOutputFolder=clean
|
||||
org.eclipse.jdt.core.builder.duplicateResourceTask=warning
|
||||
org.eclipse.jdt.core.builder.invalidClasspath=abort
|
||||
org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore
|
||||
org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch,*.xtend,*._trace,*.xtendbin
|
||||
org.eclipse.jdt.core.circularClasspath=error
|
||||
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
|
||||
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
|
||||
org.eclipse.jdt.core.codeComplete.argumentPrefixes=
|
||||
org.eclipse.jdt.core.codeComplete.argumentSuffixes=
|
||||
org.eclipse.jdt.core.codeComplete.fieldPrefixes=
|
||||
org.eclipse.jdt.core.codeComplete.fieldSuffixes=
|
||||
org.eclipse.jdt.core.codeComplete.localPrefixes=
|
||||
org.eclipse.jdt.core.codeComplete.localSuffixes=
|
||||
org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
|
||||
org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
|
||||
org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes=
|
||||
org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
|
||||
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.nonnullisdefault=disabled
|
||||
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
|
||||
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
|
||||
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.maxProblemPerUnit=100
|
||||
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=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
|
||||
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.includeFieldsInNullAnalysis=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
|
||||
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=error
|
||||
org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
|
||||
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
|
||||
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=no_tag
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
|
||||
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.nullReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.nullSpecInsufficientInfo=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
|
||||
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
|
||||
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
|
||||
org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
|
||||
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=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
|
||||
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
|
||||
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.syntheticAccessEmulation=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
|
||||
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
|
||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
|
||||
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=ignore
|
||||
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.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_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_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_selector_in_method_invocation=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
|
||||
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
|
||||
org.eclipse.jdt.core.formatter.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=false
|
||||
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=false
|
||||
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=140
|
||||
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.format_guardian_clause_on_one_line=false
|
||||
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=true
|
||||
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_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_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_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_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_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_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=true
|
||||
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=140
|
||||
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=tab
|
||||
org.eclipse.jdt.core.formatter.tabulation.size=4
|
||||
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.incompatibleJDKLevel=ignore
|
||||
org.eclipse.jdt.core.incompleteClasspath=error
|
|
@ -0,0 +1,3 @@
|
|||
#Wed Aug 12 21:10:17 CEST 2009
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.launching.PREF_STRICTLY_COMPATIBLE_JRE_NOT_AVAILABLE=ignore
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,4 @@
|
|||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
|
@ -0,0 +1,32 @@
|
|||
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=2
|
||||
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=2
|
||||
compilers.p.unresolved-import=0
|
||||
compilers.s.create-docs=false
|
||||
compilers.s.doc-folder=doc
|
||||
compilers.s.open-tags=1
|
||||
eclipse.preferences.version=1
|
14
tests/org.eclipse.xtext.ide.tests/META-INF/MANIFEST.MF
Normal file
14
tests/org.eclipse.xtext.ide.tests/META-INF/MANIFEST.MF
Normal file
|
@ -0,0 +1,14 @@
|
|||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: org.eclipse.xtext.ide.tests;singleton:=true
|
||||
Bundle-Version: 2.10.0.qualifier
|
||||
Bundle-Localization: plugin
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-Vendor: %providerName
|
||||
Require-Bundle: org.eclipse.xtext;visibility:=reexport,
|
||||
org.eclipse.xtend.lib,
|
||||
org.eclipse.core.runtime;bundle-version="3.6.0",
|
||||
org.eclipse.xtext.ide
|
||||
Import-Package: org.apache.log4j;version="1.2.15"
|
28
tests/org.eclipse.xtext.ide.tests/about.html
Normal file
28
tests/org.eclipse.xtext.ide.tests/about.html
Normal file
|
@ -0,0 +1,28 @@
|
|||
<!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, 2007</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>
|
18
tests/org.eclipse.xtext.ide.tests/build.properties
Normal file
18
tests/org.eclipse.xtext.ide.tests/build.properties
Normal file
|
@ -0,0 +1,18 @@
|
|||
source.. = src/,\
|
||||
xtend-gen/,\
|
||||
testlang-src/,\
|
||||
testlang-src-gen/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
plugin.properties,\
|
||||
about.html
|
||||
src.includes = about.html
|
||||
additional.bundles = org.eclipse.xtext.xtext.generator,\
|
||||
org.eclipse.emf.codegen.ecore,\
|
||||
org.eclipse.emf.mwe.utils,\
|
||||
org.eclipse.emf.mwe2.lib,\
|
||||
org.objectweb.asm,\
|
||||
org.apache.commons.logging,\
|
||||
org.apache.log4j,\
|
||||
com.ibm.icu,\
|
||||
org.eclipse.emf.mwe2.launch
|
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="testLanguage" nsURI="http://www.eclipse.org/xtext/ide/tests/testlanguage/TestLanguage"
|
||||
nsPrefix="testLanguage">
|
||||
<eClassifiers xsi:type="ecore:EClass" name="Model">
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="types" upperBound="-1"
|
||||
eType="#//TypeDeclaration" containment="true"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="TypeDeclaration">
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="properties" upperBound="-1"
|
||||
eType="#//Property" containment="true"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="Property">
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="type" eType="#//Type" containment="true"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="Type">
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="arrayDiemensions" unique="false"
|
||||
upperBound="-1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="TypeReference" eSuperTypes="#//Type">
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="typeRef" eType="#//Type"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="PrimitiveType" eSuperTypes="#//Type">
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
|
||||
</eClassifiers>
|
||||
</ecore:EPackage>
|
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
|
||||
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText="Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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"
|
||||
modelDirectory="/org.eclipse.xtext.ide.tests/testlang-src-gen" modelPluginID="org.eclipse.xtext.ide.tests"
|
||||
forceOverwrite="true" modelName="TestLanguage" updateClasspath="false" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container"
|
||||
complianceLevel="6.0" copyrightFields="false" runtimeVersion="2.11">
|
||||
<genPackages prefix="TestLanguage" basePackage="org.eclipse.xtext.ide.tests.testlanguage"
|
||||
disposableProviderFactory="true" fileExtensions="testlang" ecorePackage="TestLanguage.ecore#/">
|
||||
<genClasses ecoreClass="TestLanguage.ecore#//Model">
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TestLanguage.ecore#//Model/types"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TestLanguage.ecore#//TypeDeclaration">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TestLanguage.ecore#//TypeDeclaration/name"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TestLanguage.ecore#//TypeDeclaration/properties"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TestLanguage.ecore#//Property">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TestLanguage.ecore#//Property/name"/>
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference TestLanguage.ecore#//Property/type"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TestLanguage.ecore#//Type">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TestLanguage.ecore#//Type/arrayDiemensions"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TestLanguage.ecore#//TypeReference">
|
||||
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference TestLanguage.ecore#//TypeReference/typeRef"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="TestLanguage.ecore#//PrimitiveType">
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute TestLanguage.ecore#//PrimitiveType/name"/>
|
||||
</genClasses>
|
||||
</genPackages>
|
||||
</genmodel:GenModel>
|
11
tests/org.eclipse.xtext.ide.tests/plugin.properties
Normal file
11
tests/org.eclipse.xtext.ide.tests/plugin.properties
Normal file
|
@ -0,0 +1,11 @@
|
|||
###############################################################################
|
||||
# Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
pluginName = Xtext IDE Tests
|
||||
providerName = Eclipse Xtext
|
38
tests/org.eclipse.xtext.ide.tests/pom.xml
Normal file
38
tests/org.eclipse.xtext.ide.tests/pom.xml
Normal file
|
@ -0,0 +1,38 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.eclipse.xtext</groupId>
|
||||
<artifactId>org.eclipse.xtext.tycho.parent</artifactId>
|
||||
<version>2.10.0-SNAPSHOT</version>
|
||||
<relativePath>../../maven/org.eclipse.xtext.tycho.parent</relativePath>
|
||||
</parent>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
||||
<name>Xtext IDE Tests</name>
|
||||
<artifactId>org.eclipse.xtext.ide.tests</artifactId>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.eclipse.tycho</groupId>
|
||||
<artifactId>target-platform-configuration</artifactId>
|
||||
<version>${tycho-version}</version>
|
||||
<configuration>
|
||||
<pomDependencies>consider</pomDependencies>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.xtext</groupId>
|
||||
<artifactId>org.eclipse.xtext</artifactId>
|
||||
<version>[${project.version}]</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.xtext</groupId>
|
||||
<artifactId>org.eclipse.xtext.ide</artifactId>
|
||||
<version>[${project.version}]</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,198 @@
|
|||
/*
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.testlanguage;
|
||||
|
||||
import com.google.inject.Binder;
|
||||
import com.google.inject.Provider;
|
||||
import com.google.inject.name.Names;
|
||||
import java.util.Properties;
|
||||
import org.eclipse.xtext.Constants;
|
||||
import org.eclipse.xtext.IGrammarAccess;
|
||||
import org.eclipse.xtext.generator.IGenerator2;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.generator.TestLanguageGenerator;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.parser.antlr.TestLanguageAntlrTokenFileProvider;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.parser.antlr.TestLanguageParser;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.parser.antlr.internal.InternalTestLanguageLexer;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.scoping.TestLanguageScopeProvider;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.serializer.TestLanguageSemanticSequencer;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.serializer.TestLanguageSyntacticSequencer;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.services.TestLanguageGrammarAccess;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.validation.TestLanguageValidator;
|
||||
import org.eclipse.xtext.naming.DefaultDeclarativeQualifiedNameProvider;
|
||||
import org.eclipse.xtext.naming.IQualifiedNameProvider;
|
||||
import org.eclipse.xtext.parser.IParser;
|
||||
import org.eclipse.xtext.parser.ITokenToStringConverter;
|
||||
import org.eclipse.xtext.parser.antlr.AntlrTokenDefProvider;
|
||||
import org.eclipse.xtext.parser.antlr.AntlrTokenToStringConverter;
|
||||
import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider;
|
||||
import org.eclipse.xtext.parser.antlr.ITokenDefProvider;
|
||||
import org.eclipse.xtext.parser.antlr.Lexer;
|
||||
import org.eclipse.xtext.parser.antlr.LexerBindings;
|
||||
import org.eclipse.xtext.parser.antlr.LexerProvider;
|
||||
import org.eclipse.xtext.resource.IContainer;
|
||||
import org.eclipse.xtext.resource.IResourceDescriptions;
|
||||
import org.eclipse.xtext.resource.containers.IAllContainersState;
|
||||
import org.eclipse.xtext.resource.containers.ResourceSetBasedAllContainersStateProvider;
|
||||
import org.eclipse.xtext.resource.containers.StateBasedContainerManager;
|
||||
import org.eclipse.xtext.resource.impl.ResourceDescriptionsProvider;
|
||||
import org.eclipse.xtext.resource.impl.ResourceSetBasedResourceDescriptions;
|
||||
import org.eclipse.xtext.scoping.IGlobalScopeProvider;
|
||||
import org.eclipse.xtext.scoping.IScopeProvider;
|
||||
import org.eclipse.xtext.scoping.IgnoreCaseLinking;
|
||||
import org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider;
|
||||
import org.eclipse.xtext.scoping.impl.DefaultGlobalScopeProvider;
|
||||
import org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider;
|
||||
import org.eclipse.xtext.serializer.ISerializer;
|
||||
import org.eclipse.xtext.serializer.impl.Serializer;
|
||||
import org.eclipse.xtext.serializer.sequencer.ISemanticSequencer;
|
||||
import org.eclipse.xtext.serializer.sequencer.ISyntacticSequencer;
|
||||
import org.eclipse.xtext.service.DefaultRuntimeModule;
|
||||
import org.eclipse.xtext.service.SingletonBinding;
|
||||
|
||||
/**
|
||||
* Manual modifications go to {@link TestLanguageRuntimeModule}.
|
||||
*/
|
||||
@SuppressWarnings("all")
|
||||
public abstract class AbstractTestLanguageRuntimeModule extends DefaultRuntimeModule {
|
||||
|
||||
protected Properties properties = null;
|
||||
|
||||
@Override
|
||||
public void configure(Binder binder) {
|
||||
properties = tryBindProperties(binder, "org/eclipse/xtext/ide/tests/testlanguage/TestLanguage.properties");
|
||||
super.configure(binder);
|
||||
}
|
||||
|
||||
public void configureLanguageName(Binder binder) {
|
||||
binder.bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("org.eclipse.xtext.ide.tests.testlanguage.TestLanguage");
|
||||
}
|
||||
|
||||
public void configureFileExtensions(Binder binder) {
|
||||
if (properties == null || properties.getProperty(Constants.FILE_EXTENSIONS) == null)
|
||||
binder.bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("testlang");
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.grammarAccess.GrammarAccessFragment2
|
||||
public ClassLoader bindClassLoaderToInstance() {
|
||||
return getClass().getClassLoader();
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.grammarAccess.GrammarAccessFragment2
|
||||
public Class<? extends IGrammarAccess> bindIGrammarAccess() {
|
||||
return TestLanguageGrammarAccess.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2
|
||||
public Class<? extends ISemanticSequencer> bindISemanticSequencer() {
|
||||
return TestLanguageSemanticSequencer.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2
|
||||
public Class<? extends ISyntacticSequencer> bindISyntacticSequencer() {
|
||||
return TestLanguageSyntacticSequencer.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.serializer.SerializerFragment2
|
||||
public Class<? extends ISerializer> bindISerializer() {
|
||||
return Serializer.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
|
||||
public Class<? extends IParser> bindIParser() {
|
||||
return TestLanguageParser.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
|
||||
public Class<? extends ITokenToStringConverter> bindITokenToStringConverter() {
|
||||
return AntlrTokenToStringConverter.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
|
||||
public Class<? extends IAntlrTokenFileProvider> bindIAntlrTokenFileProvider() {
|
||||
return TestLanguageAntlrTokenFileProvider.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
|
||||
public Class<? extends Lexer> bindLexer() {
|
||||
return InternalTestLanguageLexer.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
|
||||
public Class<? extends ITokenDefProvider> bindITokenDefProvider() {
|
||||
return AntlrTokenDefProvider.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
|
||||
public Provider<InternalTestLanguageLexer> provideInternalTestLanguageLexer() {
|
||||
return LexerProvider.create(InternalTestLanguageLexer.class);
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment2
|
||||
public void configureRuntimeLexer(Binder binder) {
|
||||
binder.bind(Lexer.class)
|
||||
.annotatedWith(Names.named(LexerBindings.RUNTIME))
|
||||
.to(InternalTestLanguageLexer.class);
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.validation.ValidatorFragment2
|
||||
@SingletonBinding(eager=true)
|
||||
public Class<? extends TestLanguageValidator> bindTestLanguageValidator() {
|
||||
return TestLanguageValidator.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.scoping.ImportNamespacesScopingFragment2
|
||||
public Class<? extends IScopeProvider> bindIScopeProvider() {
|
||||
return TestLanguageScopeProvider.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.scoping.ImportNamespacesScopingFragment2
|
||||
public void configureIScopeProviderDelegate(Binder binder) {
|
||||
binder.bind(IScopeProvider.class).annotatedWith(Names.named(AbstractDeclarativeScopeProvider.NAMED_DELEGATE)).to(ImportedNamespaceAwareLocalScopeProvider.class);
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.scoping.ImportNamespacesScopingFragment2
|
||||
public Class<? extends IGlobalScopeProvider> bindIGlobalScopeProvider() {
|
||||
return DefaultGlobalScopeProvider.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.scoping.ImportNamespacesScopingFragment2
|
||||
public void configureIgnoreCaseLinking(Binder binder) {
|
||||
binder.bindConstant().annotatedWith(IgnoreCaseLinking.class).to(false);
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.exporting.QualifiedNamesFragment2
|
||||
public Class<? extends IQualifiedNameProvider> bindIQualifiedNameProvider() {
|
||||
return DefaultDeclarativeQualifiedNameProvider.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.builder.BuilderIntegrationFragment2
|
||||
public Class<? extends IContainer.Manager> bindIContainer$Manager() {
|
||||
return StateBasedContainerManager.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.builder.BuilderIntegrationFragment2
|
||||
public Class<? extends IAllContainersState.Provider> bindIAllContainersState$Provider() {
|
||||
return ResourceSetBasedAllContainersStateProvider.class;
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.builder.BuilderIntegrationFragment2
|
||||
public void configureIResourceDescriptions(Binder binder) {
|
||||
binder.bind(IResourceDescriptions.class).to(ResourceSetBasedResourceDescriptions.class);
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.builder.BuilderIntegrationFragment2
|
||||
public void configureIResourceDescriptionsPersisted(Binder binder) {
|
||||
binder.bind(IResourceDescriptions.class).annotatedWith(Names.named(ResourceDescriptionsProvider.PERSISTED_DESCRIPTIONS)).to(ResourceSetBasedResourceDescriptions.class);
|
||||
}
|
||||
|
||||
// contributed by org.eclipse.xtext.xtext.generator.generator.GeneratorFragment2
|
||||
public Class<? extends IGenerator2> bindIGenerator2() {
|
||||
return TestLanguageGenerator.class;
|
||||
}
|
||||
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.testlanguage;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
import org.eclipse.emf.ecore.EPackage;
|
||||
import org.eclipse.emf.ecore.resource.Resource;
|
||||
import org.eclipse.xtext.ISetup;
|
||||
import org.eclipse.xtext.common.TerminalsStandaloneSetup;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TestLanguagePackage;
|
||||
import org.eclipse.xtext.resource.IResourceFactory;
|
||||
import org.eclipse.xtext.resource.IResourceServiceProvider;
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public class TestLanguageStandaloneSetupGenerated implements ISetup {
|
||||
|
||||
@Override
|
||||
public Injector createInjectorAndDoEMFRegistration() {
|
||||
TerminalsStandaloneSetup.doSetup();
|
||||
|
||||
Injector injector = createInjector();
|
||||
register(injector);
|
||||
return injector;
|
||||
}
|
||||
|
||||
public Injector createInjector() {
|
||||
return Guice.createInjector(new TestLanguageRuntimeModule());
|
||||
}
|
||||
|
||||
public void register(Injector injector) {
|
||||
if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/xtext/ide/tests/testlanguage/TestLanguage")) {
|
||||
EPackage.Registry.INSTANCE.put("http://www.eclipse.org/xtext/ide/tests/testlanguage/TestLanguage", TestLanguagePackage.eINSTANCE);
|
||||
}
|
||||
IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
|
||||
IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);
|
||||
|
||||
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("testlang", resourceFactory);
|
||||
IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("testlang", serviceProvider);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.testlanguage.ide.contentassist.antlr;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import org.eclipse.xtext.AbstractRule;
|
||||
import org.eclipse.xtext.ide.editor.contentassist.antlr.FollowElement;
|
||||
import org.eclipse.xtext.ide.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser;
|
||||
import org.eclipse.xtext.ide.editor.partialEditing.IPartialEditingContentAssistParser;
|
||||
import org.eclipse.xtext.util.PolymorphicDispatcher;
|
||||
|
||||
public class PartialTestLanguageContentAssistParser extends TestLanguageParser implements IPartialEditingContentAssistParser {
|
||||
|
||||
private AbstractRule rule;
|
||||
|
||||
@Override
|
||||
public void initializeFor(AbstractRule rule) {
|
||||
this.rule = rule;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Collection<FollowElement> getFollowElements(AbstractInternalContentAssistParser parser) {
|
||||
if (rule == null || rule.eIsProxy())
|
||||
return Collections.emptyList();
|
||||
String methodName = "entryRule" + rule.getName();
|
||||
PolymorphicDispatcher<Collection<FollowElement>> dispatcher =
|
||||
new PolymorphicDispatcher<Collection<FollowElement>>(methodName, 0, 0, Collections.singletonList(parser));
|
||||
dispatcher.invoke();
|
||||
return parser.getFollowElements();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,85 @@
|
|||
/*
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.testlanguage.ide.contentassist.antlr;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.antlr.runtime.RecognitionException;
|
||||
import org.eclipse.xtext.AbstractElement;
|
||||
import org.eclipse.xtext.ide.editor.contentassist.antlr.AbstractContentAssistParser;
|
||||
import org.eclipse.xtext.ide.editor.contentassist.antlr.FollowElement;
|
||||
import org.eclipse.xtext.ide.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.ide.contentassist.antlr.internal.InternalTestLanguageParser;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.services.TestLanguageGrammarAccess;
|
||||
|
||||
public class TestLanguageParser extends AbstractContentAssistParser {
|
||||
|
||||
@Inject
|
||||
private TestLanguageGrammarAccess grammarAccess;
|
||||
|
||||
private Map<AbstractElement, String> nameMappings;
|
||||
|
||||
@Override
|
||||
protected InternalTestLanguageParser createParser() {
|
||||
InternalTestLanguageParser result = new InternalTestLanguageParser(null);
|
||||
result.setGrammarAccess(grammarAccess);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getRuleName(AbstractElement element) {
|
||||
if (nameMappings == null) {
|
||||
nameMappings = new HashMap<AbstractElement, String>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
{
|
||||
put(grammarAccess.getTypeAccess().getAlternatives_0(), "rule__Type__Alternatives_0");
|
||||
put(grammarAccess.getPrimitiveTypeAccess().getNameAlternatives_0(), "rule__PrimitiveType__NameAlternatives_0");
|
||||
put(grammarAccess.getTypeDeclarationAccess().getGroup(), "rule__TypeDeclaration__Group__0");
|
||||
put(grammarAccess.getPropertyAccess().getGroup(), "rule__Property__Group__0");
|
||||
put(grammarAccess.getTypeAccess().getGroup(), "rule__Type__Group__0");
|
||||
put(grammarAccess.getTypeAccess().getGroup_1(), "rule__Type__Group_1__0");
|
||||
put(grammarAccess.getModelAccess().getTypesAssignment(), "rule__Model__TypesAssignment");
|
||||
put(grammarAccess.getTypeDeclarationAccess().getNameAssignment_1(), "rule__TypeDeclaration__NameAssignment_1");
|
||||
put(grammarAccess.getTypeDeclarationAccess().getPropertiesAssignment_3(), "rule__TypeDeclaration__PropertiesAssignment_3");
|
||||
put(grammarAccess.getPropertyAccess().getNameAssignment_0(), "rule__Property__NameAssignment_0");
|
||||
put(grammarAccess.getPropertyAccess().getTypeAssignment_1(), "rule__Property__TypeAssignment_1");
|
||||
put(grammarAccess.getTypeAccess().getArrayDiemensionsAssignment_1_0(), "rule__Type__ArrayDiemensionsAssignment_1_0");
|
||||
put(grammarAccess.getTypeReferenceAccess().getTypeRefAssignment(), "rule__TypeReference__TypeRefAssignment");
|
||||
put(grammarAccess.getPrimitiveTypeAccess().getNameAssignment(), "rule__PrimitiveType__NameAssignment");
|
||||
}
|
||||
};
|
||||
}
|
||||
return nameMappings.get(element);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Collection<FollowElement> getFollowElements(AbstractInternalContentAssistParser parser) {
|
||||
try {
|
||||
InternalTestLanguageParser typedParser = (InternalTestLanguageParser) parser;
|
||||
typedParser.entryRuleModel();
|
||||
return typedParser.getFollowElements();
|
||||
} catch(RecognitionException ex) {
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String[] getInitialHiddenTokens() {
|
||||
return new String[] { "RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT" };
|
||||
}
|
||||
|
||||
public TestLanguageGrammarAccess getGrammarAccess() {
|
||||
return this.grammarAccess;
|
||||
}
|
||||
|
||||
public void setGrammarAccess(TestLanguageGrammarAccess grammarAccess) {
|
||||
this.grammarAccess = grammarAccess;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,691 @@
|
|||
/*
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
grammar InternalTestLanguage;
|
||||
|
||||
options {
|
||||
superClass=AbstractInternalContentAssistParser;
|
||||
}
|
||||
|
||||
@lexer::header {
|
||||
package org.eclipse.xtext.ide.tests.testlanguage.ide.contentassist.antlr.internal;
|
||||
|
||||
// Hack: Use our own Lexer superclass by means of import.
|
||||
// Currently there is no other way to specify the superclass for the lexer.
|
||||
import org.eclipse.xtext.ide.editor.contentassist.antlr.internal.Lexer;
|
||||
}
|
||||
|
||||
@parser::header {
|
||||
package org.eclipse.xtext.ide.tests.testlanguage.ide.contentassist.antlr.internal;
|
||||
|
||||
import java.io.InputStream;
|
||||
import org.eclipse.xtext.*;
|
||||
import org.eclipse.xtext.parser.*;
|
||||
import org.eclipse.xtext.parser.impl.*;
|
||||
import org.eclipse.emf.ecore.util.EcoreUtil;
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.xtext.parser.antlr.XtextTokenStream;
|
||||
import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens;
|
||||
import org.eclipse.xtext.ide.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser;
|
||||
import org.eclipse.xtext.ide.editor.contentassist.antlr.internal.DFA;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.services.TestLanguageGrammarAccess;
|
||||
|
||||
}
|
||||
@parser::members {
|
||||
private TestLanguageGrammarAccess grammarAccess;
|
||||
|
||||
public void setGrammarAccess(TestLanguageGrammarAccess grammarAccess) {
|
||||
this.grammarAccess = grammarAccess;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Grammar getGrammar() {
|
||||
return grammarAccess.getGrammar();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getValueForTokenName(String tokenName) {
|
||||
return tokenName;
|
||||
}
|
||||
}
|
||||
|
||||
// Entry rule entryRuleModel
|
||||
entryRuleModel
|
||||
:
|
||||
{ before(grammarAccess.getModelRule()); }
|
||||
ruleModel
|
||||
{ after(grammarAccess.getModelRule()); }
|
||||
EOF
|
||||
;
|
||||
|
||||
// Rule Model
|
||||
ruleModel
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getModelAccess().getTypesAssignment()); }
|
||||
(rule__Model__TypesAssignment)*
|
||||
{ after(grammarAccess.getModelAccess().getTypesAssignment()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
// Entry rule entryRuleTypeDeclaration
|
||||
entryRuleTypeDeclaration
|
||||
:
|
||||
{ before(grammarAccess.getTypeDeclarationRule()); }
|
||||
ruleTypeDeclaration
|
||||
{ after(grammarAccess.getTypeDeclarationRule()); }
|
||||
EOF
|
||||
;
|
||||
|
||||
// Rule TypeDeclaration
|
||||
ruleTypeDeclaration
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getTypeDeclarationAccess().getGroup()); }
|
||||
(rule__TypeDeclaration__Group__0)
|
||||
{ after(grammarAccess.getTypeDeclarationAccess().getGroup()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
// Entry rule entryRuleProperty
|
||||
entryRuleProperty
|
||||
:
|
||||
{ before(grammarAccess.getPropertyRule()); }
|
||||
ruleProperty
|
||||
{ after(grammarAccess.getPropertyRule()); }
|
||||
EOF
|
||||
;
|
||||
|
||||
// Rule Property
|
||||
ruleProperty
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getPropertyAccess().getGroup()); }
|
||||
(rule__Property__Group__0)
|
||||
{ after(grammarAccess.getPropertyAccess().getGroup()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
// Entry rule entryRuleType
|
||||
entryRuleType
|
||||
:
|
||||
{ before(grammarAccess.getTypeRule()); }
|
||||
ruleType
|
||||
{ after(grammarAccess.getTypeRule()); }
|
||||
EOF
|
||||
;
|
||||
|
||||
// Rule Type
|
||||
ruleType
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getTypeAccess().getGroup()); }
|
||||
(rule__Type__Group__0)
|
||||
{ after(grammarAccess.getTypeAccess().getGroup()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
// Entry rule entryRuleTypeReference
|
||||
entryRuleTypeReference
|
||||
:
|
||||
{ before(grammarAccess.getTypeReferenceRule()); }
|
||||
ruleTypeReference
|
||||
{ after(grammarAccess.getTypeReferenceRule()); }
|
||||
EOF
|
||||
;
|
||||
|
||||
// Rule TypeReference
|
||||
ruleTypeReference
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getTypeReferenceAccess().getTypeRefAssignment()); }
|
||||
(rule__TypeReference__TypeRefAssignment)
|
||||
{ after(grammarAccess.getTypeReferenceAccess().getTypeRefAssignment()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
// Entry rule entryRulePrimitiveType
|
||||
entryRulePrimitiveType
|
||||
:
|
||||
{ before(grammarAccess.getPrimitiveTypeRule()); }
|
||||
rulePrimitiveType
|
||||
{ after(grammarAccess.getPrimitiveTypeRule()); }
|
||||
EOF
|
||||
;
|
||||
|
||||
// Rule PrimitiveType
|
||||
rulePrimitiveType
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getPrimitiveTypeAccess().getNameAssignment()); }
|
||||
(rule__PrimitiveType__NameAssignment)
|
||||
{ after(grammarAccess.getPrimitiveTypeAccess().getNameAssignment()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__Type__Alternatives_0
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getTypeAccess().getTypeReferenceParserRuleCall_0_0()); }
|
||||
ruleTypeReference
|
||||
{ after(grammarAccess.getTypeAccess().getTypeReferenceParserRuleCall_0_0()); }
|
||||
)
|
||||
|
|
||||
(
|
||||
{ before(grammarAccess.getTypeAccess().getPrimitiveTypeParserRuleCall_0_1()); }
|
||||
rulePrimitiveType
|
||||
{ after(grammarAccess.getTypeAccess().getPrimitiveTypeParserRuleCall_0_1()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__PrimitiveType__NameAlternatives_0
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getPrimitiveTypeAccess().getNameStringKeyword_0_0()); }
|
||||
'string'
|
||||
{ after(grammarAccess.getPrimitiveTypeAccess().getNameStringKeyword_0_0()); }
|
||||
)
|
||||
|
|
||||
(
|
||||
{ before(grammarAccess.getPrimitiveTypeAccess().getNameIntKeyword_0_1()); }
|
||||
'int'
|
||||
{ after(grammarAccess.getPrimitiveTypeAccess().getNameIntKeyword_0_1()); }
|
||||
)
|
||||
|
|
||||
(
|
||||
{ before(grammarAccess.getPrimitiveTypeAccess().getNameBooleanKeyword_0_2()); }
|
||||
'boolean'
|
||||
{ after(grammarAccess.getPrimitiveTypeAccess().getNameBooleanKeyword_0_2()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__TypeDeclaration__Group__0
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
rule__TypeDeclaration__Group__0__Impl
|
||||
rule__TypeDeclaration__Group__1
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__TypeDeclaration__Group__0__Impl
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getTypeDeclarationAccess().getTypeKeyword_0()); }
|
||||
'type'
|
||||
{ after(grammarAccess.getTypeDeclarationAccess().getTypeKeyword_0()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__TypeDeclaration__Group__1
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
rule__TypeDeclaration__Group__1__Impl
|
||||
rule__TypeDeclaration__Group__2
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__TypeDeclaration__Group__1__Impl
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getTypeDeclarationAccess().getNameAssignment_1()); }
|
||||
(rule__TypeDeclaration__NameAssignment_1)
|
||||
{ after(grammarAccess.getTypeDeclarationAccess().getNameAssignment_1()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__TypeDeclaration__Group__2
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
rule__TypeDeclaration__Group__2__Impl
|
||||
rule__TypeDeclaration__Group__3
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__TypeDeclaration__Group__2__Impl
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getTypeDeclarationAccess().getLeftCurlyBracketKeyword_2()); }
|
||||
'{'
|
||||
{ after(grammarAccess.getTypeDeclarationAccess().getLeftCurlyBracketKeyword_2()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__TypeDeclaration__Group__3
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
rule__TypeDeclaration__Group__3__Impl
|
||||
rule__TypeDeclaration__Group__4
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__TypeDeclaration__Group__3__Impl
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getTypeDeclarationAccess().getPropertiesAssignment_3()); }
|
||||
(rule__TypeDeclaration__PropertiesAssignment_3)*
|
||||
{ after(grammarAccess.getTypeDeclarationAccess().getPropertiesAssignment_3()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__TypeDeclaration__Group__4
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
rule__TypeDeclaration__Group__4__Impl
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__TypeDeclaration__Group__4__Impl
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getTypeDeclarationAccess().getRightCurlyBracketKeyword_4()); }
|
||||
'}'
|
||||
{ after(grammarAccess.getTypeDeclarationAccess().getRightCurlyBracketKeyword_4()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
rule__Property__Group__0
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
rule__Property__Group__0__Impl
|
||||
rule__Property__Group__1
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__Property__Group__0__Impl
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getPropertyAccess().getNameAssignment_0()); }
|
||||
(rule__Property__NameAssignment_0)
|
||||
{ after(grammarAccess.getPropertyAccess().getNameAssignment_0()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__Property__Group__1
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
rule__Property__Group__1__Impl
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__Property__Group__1__Impl
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getPropertyAccess().getTypeAssignment_1()); }
|
||||
(rule__Property__TypeAssignment_1)
|
||||
{ after(grammarAccess.getPropertyAccess().getTypeAssignment_1()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
rule__Type__Group__0
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
rule__Type__Group__0__Impl
|
||||
rule__Type__Group__1
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__Type__Group__0__Impl
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getTypeAccess().getAlternatives_0()); }
|
||||
(rule__Type__Alternatives_0)
|
||||
{ after(grammarAccess.getTypeAccess().getAlternatives_0()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__Type__Group__1
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
rule__Type__Group__1__Impl
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__Type__Group__1__Impl
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getTypeAccess().getGroup_1()); }
|
||||
(rule__Type__Group_1__0)*
|
||||
{ after(grammarAccess.getTypeAccess().getGroup_1()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
rule__Type__Group_1__0
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
rule__Type__Group_1__0__Impl
|
||||
rule__Type__Group_1__1
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__Type__Group_1__0__Impl
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getTypeAccess().getArrayDiemensionsAssignment_1_0()); }
|
||||
(rule__Type__ArrayDiemensionsAssignment_1_0)
|
||||
{ after(grammarAccess.getTypeAccess().getArrayDiemensionsAssignment_1_0()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__Type__Group_1__1
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
rule__Type__Group_1__1__Impl
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__Type__Group_1__1__Impl
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getTypeAccess().getRightSquareBracketKeyword_1_1()); }
|
||||
']'
|
||||
{ after(grammarAccess.getTypeAccess().getRightSquareBracketKeyword_1_1()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
|
||||
rule__Model__TypesAssignment
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getModelAccess().getTypesTypeDeclarationParserRuleCall_0()); }
|
||||
ruleTypeDeclaration
|
||||
{ after(grammarAccess.getModelAccess().getTypesTypeDeclarationParserRuleCall_0()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__TypeDeclaration__NameAssignment_1
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getTypeDeclarationAccess().getNameIDTerminalRuleCall_1_0()); }
|
||||
RULE_ID
|
||||
{ after(grammarAccess.getTypeDeclarationAccess().getNameIDTerminalRuleCall_1_0()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__TypeDeclaration__PropertiesAssignment_3
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getTypeDeclarationAccess().getPropertiesPropertyParserRuleCall_3_0()); }
|
||||
ruleProperty
|
||||
{ after(grammarAccess.getTypeDeclarationAccess().getPropertiesPropertyParserRuleCall_3_0()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__Property__NameAssignment_0
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getPropertyAccess().getNameIDTerminalRuleCall_0_0()); }
|
||||
RULE_ID
|
||||
{ after(grammarAccess.getPropertyAccess().getNameIDTerminalRuleCall_0_0()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__Property__TypeAssignment_1
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getPropertyAccess().getTypeTypeParserRuleCall_1_0()); }
|
||||
ruleType
|
||||
{ after(grammarAccess.getPropertyAccess().getTypeTypeParserRuleCall_1_0()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__Type__ArrayDiemensionsAssignment_1_0
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getTypeAccess().getArrayDiemensionsLeftSquareBracketKeyword_1_0_0()); }
|
||||
(
|
||||
{ before(grammarAccess.getTypeAccess().getArrayDiemensionsLeftSquareBracketKeyword_1_0_0()); }
|
||||
'['
|
||||
{ after(grammarAccess.getTypeAccess().getArrayDiemensionsLeftSquareBracketKeyword_1_0_0()); }
|
||||
)
|
||||
{ after(grammarAccess.getTypeAccess().getArrayDiemensionsLeftSquareBracketKeyword_1_0_0()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__TypeReference__TypeRefAssignment
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getTypeReferenceAccess().getTypeRefTypeCrossReference_0()); }
|
||||
(
|
||||
{ before(grammarAccess.getTypeReferenceAccess().getTypeRefTypeIDTerminalRuleCall_0_1()); }
|
||||
RULE_ID
|
||||
{ after(grammarAccess.getTypeReferenceAccess().getTypeRefTypeIDTerminalRuleCall_0_1()); }
|
||||
)
|
||||
{ after(grammarAccess.getTypeReferenceAccess().getTypeRefTypeCrossReference_0()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
rule__PrimitiveType__NameAssignment
|
||||
@init {
|
||||
int stackSize = keepStackSize();
|
||||
}
|
||||
:
|
||||
(
|
||||
{ before(grammarAccess.getPrimitiveTypeAccess().getNameAlternatives_0()); }
|
||||
(rule__PrimitiveType__NameAlternatives_0)
|
||||
{ after(grammarAccess.getPrimitiveTypeAccess().getNameAlternatives_0()); }
|
||||
)
|
||||
;
|
||||
finally {
|
||||
restoreStackSize(stackSize);
|
||||
}
|
||||
|
||||
RULE_ID : '^'? ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*;
|
||||
|
||||
RULE_INT : ('0'..'9')+;
|
||||
|
||||
RULE_STRING : ('"' ('\\' .|~(('\\'|'"')))* '"'|'\'' ('\\' .|~(('\\'|'\'')))* '\'');
|
||||
|
||||
RULE_ML_COMMENT : '/*' ( options {greedy=false;} : . )*'*/';
|
||||
|
||||
RULE_SL_COMMENT : '//' ~(('\n'|'\r'))* ('\r'? '\n')?;
|
||||
|
||||
RULE_WS : (' '|'\t'|'\r'|'\n')+;
|
||||
|
||||
RULE_ANY_OTHER : .;
|
|
@ -0,0 +1,23 @@
|
|||
'['=18
|
||||
']'=17
|
||||
'boolean'=13
|
||||
'int'=12
|
||||
'string'=11
|
||||
'type'=14
|
||||
'{'=15
|
||||
'}'=16
|
||||
RULE_ANY_OTHER=10
|
||||
RULE_ID=4
|
||||
RULE_INT=5
|
||||
RULE_ML_COMMENT=7
|
||||
RULE_SL_COMMENT=8
|
||||
RULE_STRING=6
|
||||
RULE_WS=9
|
||||
T__11=11
|
||||
T__12=12
|
||||
T__13=13
|
||||
T__14=14
|
||||
T__15=15
|
||||
T__16=16
|
||||
T__17=17
|
||||
T__18=18
|
|
@ -0,0 +1,989 @@
|
|||
package org.eclipse.xtext.ide.tests.testlanguage.ide.contentassist.antlr.internal;
|
||||
|
||||
// Hack: Use our own Lexer superclass by means of import.
|
||||
// Currently there is no other way to specify the superclass for the lexer.
|
||||
import org.eclipse.xtext.ide.editor.contentassist.antlr.internal.Lexer;
|
||||
|
||||
|
||||
import org.antlr.runtime.*;
|
||||
import java.util.Stack;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public class InternalTestLanguageLexer extends Lexer {
|
||||
public static final int RULE_ID=4;
|
||||
public static final int RULE_STRING=6;
|
||||
public static final int T__16=16;
|
||||
public static final int T__15=15;
|
||||
public static final int T__18=18;
|
||||
public static final int T__17=17;
|
||||
public static final int T__12=12;
|
||||
public static final int T__11=11;
|
||||
public static final int T__14=14;
|
||||
public static final int T__13=13;
|
||||
public static final int RULE_ANY_OTHER=10;
|
||||
public static final int RULE_INT=5;
|
||||
public static final int RULE_WS=9;
|
||||
public static final int RULE_SL_COMMENT=8;
|
||||
public static final int EOF=-1;
|
||||
public static final int RULE_ML_COMMENT=7;
|
||||
|
||||
// delegates
|
||||
// delegators
|
||||
|
||||
public InternalTestLanguageLexer() {;}
|
||||
public InternalTestLanguageLexer(CharStream input) {
|
||||
this(input, new RecognizerSharedState());
|
||||
}
|
||||
public InternalTestLanguageLexer(CharStream input, RecognizerSharedState state) {
|
||||
super(input,state);
|
||||
|
||||
}
|
||||
public String getGrammarFileName() { return "InternalTestLanguage.g"; }
|
||||
|
||||
// $ANTLR start "T__11"
|
||||
public final void mT__11() throws RecognitionException {
|
||||
try {
|
||||
int _type = T__11;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalTestLanguage.g:11:7: ( 'string' )
|
||||
// InternalTestLanguage.g:11:9: 'string'
|
||||
{
|
||||
match("string");
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "T__11"
|
||||
|
||||
// $ANTLR start "T__12"
|
||||
public final void mT__12() throws RecognitionException {
|
||||
try {
|
||||
int _type = T__12;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalTestLanguage.g:12:7: ( 'int' )
|
||||
// InternalTestLanguage.g:12:9: 'int'
|
||||
{
|
||||
match("int");
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "T__12"
|
||||
|
||||
// $ANTLR start "T__13"
|
||||
public final void mT__13() throws RecognitionException {
|
||||
try {
|
||||
int _type = T__13;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalTestLanguage.g:13:7: ( 'boolean' )
|
||||
// InternalTestLanguage.g:13:9: 'boolean'
|
||||
{
|
||||
match("boolean");
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "T__13"
|
||||
|
||||
// $ANTLR start "T__14"
|
||||
public final void mT__14() throws RecognitionException {
|
||||
try {
|
||||
int _type = T__14;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalTestLanguage.g:14:7: ( 'type' )
|
||||
// InternalTestLanguage.g:14:9: 'type'
|
||||
{
|
||||
match("type");
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "T__14"
|
||||
|
||||
// $ANTLR start "T__15"
|
||||
public final void mT__15() throws RecognitionException {
|
||||
try {
|
||||
int _type = T__15;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalTestLanguage.g:15:7: ( '{' )
|
||||
// InternalTestLanguage.g:15:9: '{'
|
||||
{
|
||||
match('{');
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "T__15"
|
||||
|
||||
// $ANTLR start "T__16"
|
||||
public final void mT__16() throws RecognitionException {
|
||||
try {
|
||||
int _type = T__16;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalTestLanguage.g:16:7: ( '}' )
|
||||
// InternalTestLanguage.g:16:9: '}'
|
||||
{
|
||||
match('}');
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "T__16"
|
||||
|
||||
// $ANTLR start "T__17"
|
||||
public final void mT__17() throws RecognitionException {
|
||||
try {
|
||||
int _type = T__17;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalTestLanguage.g:17:7: ( ']' )
|
||||
// InternalTestLanguage.g:17:9: ']'
|
||||
{
|
||||
match(']');
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "T__17"
|
||||
|
||||
// $ANTLR start "T__18"
|
||||
public final void mT__18() throws RecognitionException {
|
||||
try {
|
||||
int _type = T__18;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalTestLanguage.g:18:7: ( '[' )
|
||||
// InternalTestLanguage.g:18:9: '['
|
||||
{
|
||||
match('[');
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "T__18"
|
||||
|
||||
// $ANTLR start "RULE_ID"
|
||||
public final void mRULE_ID() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_ID;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalTestLanguage.g:679:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* )
|
||||
// InternalTestLanguage.g:679:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
|
||||
{
|
||||
// InternalTestLanguage.g:679:11: ( '^' )?
|
||||
int alt1=2;
|
||||
int LA1_0 = input.LA(1);
|
||||
|
||||
if ( (LA1_0=='^') ) {
|
||||
alt1=1;
|
||||
}
|
||||
switch (alt1) {
|
||||
case 1 :
|
||||
// InternalTestLanguage.g:679:11: '^'
|
||||
{
|
||||
match('^');
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if ( (input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) {
|
||||
input.consume();
|
||||
|
||||
}
|
||||
else {
|
||||
MismatchedSetException mse = new MismatchedSetException(null,input);
|
||||
recover(mse);
|
||||
throw mse;}
|
||||
|
||||
// InternalTestLanguage.g:679:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
|
||||
loop2:
|
||||
do {
|
||||
int alt2=2;
|
||||
int LA2_0 = input.LA(1);
|
||||
|
||||
if ( ((LA2_0>='0' && LA2_0<='9')||(LA2_0>='A' && LA2_0<='Z')||LA2_0=='_'||(LA2_0>='a' && LA2_0<='z')) ) {
|
||||
alt2=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt2) {
|
||||
case 1 :
|
||||
// InternalTestLanguage.g:
|
||||
{
|
||||
if ( (input.LA(1)>='0' && input.LA(1)<='9')||(input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) {
|
||||
input.consume();
|
||||
|
||||
}
|
||||
else {
|
||||
MismatchedSetException mse = new MismatchedSetException(null,input);
|
||||
recover(mse);
|
||||
throw mse;}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop2;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_ID"
|
||||
|
||||
// $ANTLR start "RULE_INT"
|
||||
public final void mRULE_INT() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_INT;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalTestLanguage.g:681:10: ( ( '0' .. '9' )+ )
|
||||
// InternalTestLanguage.g:681:12: ( '0' .. '9' )+
|
||||
{
|
||||
// InternalTestLanguage.g:681:12: ( '0' .. '9' )+
|
||||
int cnt3=0;
|
||||
loop3:
|
||||
do {
|
||||
int alt3=2;
|
||||
int LA3_0 = input.LA(1);
|
||||
|
||||
if ( ((LA3_0>='0' && LA3_0<='9')) ) {
|
||||
alt3=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt3) {
|
||||
case 1 :
|
||||
// InternalTestLanguage.g:681:13: '0' .. '9'
|
||||
{
|
||||
matchRange('0','9');
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
if ( cnt3 >= 1 ) break loop3;
|
||||
EarlyExitException eee =
|
||||
new EarlyExitException(3, input);
|
||||
throw eee;
|
||||
}
|
||||
cnt3++;
|
||||
} while (true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_INT"
|
||||
|
||||
// $ANTLR start "RULE_STRING"
|
||||
public final void mRULE_STRING() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_STRING;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalTestLanguage.g:683:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) )
|
||||
// InternalTestLanguage.g:683:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
|
||||
{
|
||||
// InternalTestLanguage.g:683:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
|
||||
int alt6=2;
|
||||
int LA6_0 = input.LA(1);
|
||||
|
||||
if ( (LA6_0=='\"') ) {
|
||||
alt6=1;
|
||||
}
|
||||
else if ( (LA6_0=='\'') ) {
|
||||
alt6=2;
|
||||
}
|
||||
else {
|
||||
NoViableAltException nvae =
|
||||
new NoViableAltException("", 6, 0, input);
|
||||
|
||||
throw nvae;
|
||||
}
|
||||
switch (alt6) {
|
||||
case 1 :
|
||||
// InternalTestLanguage.g:683:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"'
|
||||
{
|
||||
match('\"');
|
||||
// InternalTestLanguage.g:683:20: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )*
|
||||
loop4:
|
||||
do {
|
||||
int alt4=3;
|
||||
int LA4_0 = input.LA(1);
|
||||
|
||||
if ( (LA4_0=='\\') ) {
|
||||
alt4=1;
|
||||
}
|
||||
else if ( ((LA4_0>='\u0000' && LA4_0<='!')||(LA4_0>='#' && LA4_0<='[')||(LA4_0>=']' && LA4_0<='\uFFFF')) ) {
|
||||
alt4=2;
|
||||
}
|
||||
|
||||
|
||||
switch (alt4) {
|
||||
case 1 :
|
||||
// InternalTestLanguage.g:683:21: '\\\\' .
|
||||
{
|
||||
match('\\');
|
||||
matchAny();
|
||||
|
||||
}
|
||||
break;
|
||||
case 2 :
|
||||
// InternalTestLanguage.g:683:28: ~ ( ( '\\\\' | '\"' ) )
|
||||
{
|
||||
if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) {
|
||||
input.consume();
|
||||
|
||||
}
|
||||
else {
|
||||
MismatchedSetException mse = new MismatchedSetException(null,input);
|
||||
recover(mse);
|
||||
throw mse;}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop4;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
match('\"');
|
||||
|
||||
}
|
||||
break;
|
||||
case 2 :
|
||||
// InternalTestLanguage.g:683:48: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\''
|
||||
{
|
||||
match('\'');
|
||||
// InternalTestLanguage.g:683:53: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )*
|
||||
loop5:
|
||||
do {
|
||||
int alt5=3;
|
||||
int LA5_0 = input.LA(1);
|
||||
|
||||
if ( (LA5_0=='\\') ) {
|
||||
alt5=1;
|
||||
}
|
||||
else if ( ((LA5_0>='\u0000' && LA5_0<='&')||(LA5_0>='(' && LA5_0<='[')||(LA5_0>=']' && LA5_0<='\uFFFF')) ) {
|
||||
alt5=2;
|
||||
}
|
||||
|
||||
|
||||
switch (alt5) {
|
||||
case 1 :
|
||||
// InternalTestLanguage.g:683:54: '\\\\' .
|
||||
{
|
||||
match('\\');
|
||||
matchAny();
|
||||
|
||||
}
|
||||
break;
|
||||
case 2 :
|
||||
// InternalTestLanguage.g:683:61: ~ ( ( '\\\\' | '\\'' ) )
|
||||
{
|
||||
if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) {
|
||||
input.consume();
|
||||
|
||||
}
|
||||
else {
|
||||
MismatchedSetException mse = new MismatchedSetException(null,input);
|
||||
recover(mse);
|
||||
throw mse;}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop5;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
match('\'');
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_STRING"
|
||||
|
||||
// $ANTLR start "RULE_ML_COMMENT"
|
||||
public final void mRULE_ML_COMMENT() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_ML_COMMENT;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalTestLanguage.g:685:17: ( '/*' ( options {greedy=false; } : . )* '*/' )
|
||||
// InternalTestLanguage.g:685:19: '/*' ( options {greedy=false; } : . )* '*/'
|
||||
{
|
||||
match("/*");
|
||||
|
||||
// InternalTestLanguage.g:685:24: ( options {greedy=false; } : . )*
|
||||
loop7:
|
||||
do {
|
||||
int alt7=2;
|
||||
int LA7_0 = input.LA(1);
|
||||
|
||||
if ( (LA7_0=='*') ) {
|
||||
int LA7_1 = input.LA(2);
|
||||
|
||||
if ( (LA7_1=='/') ) {
|
||||
alt7=2;
|
||||
}
|
||||
else if ( ((LA7_1>='\u0000' && LA7_1<='.')||(LA7_1>='0' && LA7_1<='\uFFFF')) ) {
|
||||
alt7=1;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else if ( ((LA7_0>='\u0000' && LA7_0<=')')||(LA7_0>='+' && LA7_0<='\uFFFF')) ) {
|
||||
alt7=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt7) {
|
||||
case 1 :
|
||||
// InternalTestLanguage.g:685:52: .
|
||||
{
|
||||
matchAny();
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop7;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
match("*/");
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_ML_COMMENT"
|
||||
|
||||
// $ANTLR start "RULE_SL_COMMENT"
|
||||
public final void mRULE_SL_COMMENT() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_SL_COMMENT;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalTestLanguage.g:687:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? )
|
||||
// InternalTestLanguage.g:687:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )?
|
||||
{
|
||||
match("//");
|
||||
|
||||
// InternalTestLanguage.g:687:24: (~ ( ( '\\n' | '\\r' ) ) )*
|
||||
loop8:
|
||||
do {
|
||||
int alt8=2;
|
||||
int LA8_0 = input.LA(1);
|
||||
|
||||
if ( ((LA8_0>='\u0000' && LA8_0<='\t')||(LA8_0>='\u000B' && LA8_0<='\f')||(LA8_0>='\u000E' && LA8_0<='\uFFFF')) ) {
|
||||
alt8=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt8) {
|
||||
case 1 :
|
||||
// InternalTestLanguage.g:687:24: ~ ( ( '\\n' | '\\r' ) )
|
||||
{
|
||||
if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\uFFFF') ) {
|
||||
input.consume();
|
||||
|
||||
}
|
||||
else {
|
||||
MismatchedSetException mse = new MismatchedSetException(null,input);
|
||||
recover(mse);
|
||||
throw mse;}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop8;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
// InternalTestLanguage.g:687:40: ( ( '\\r' )? '\\n' )?
|
||||
int alt10=2;
|
||||
int LA10_0 = input.LA(1);
|
||||
|
||||
if ( (LA10_0=='\n'||LA10_0=='\r') ) {
|
||||
alt10=1;
|
||||
}
|
||||
switch (alt10) {
|
||||
case 1 :
|
||||
// InternalTestLanguage.g:687:41: ( '\\r' )? '\\n'
|
||||
{
|
||||
// InternalTestLanguage.g:687:41: ( '\\r' )?
|
||||
int alt9=2;
|
||||
int LA9_0 = input.LA(1);
|
||||
|
||||
if ( (LA9_0=='\r') ) {
|
||||
alt9=1;
|
||||
}
|
||||
switch (alt9) {
|
||||
case 1 :
|
||||
// InternalTestLanguage.g:687:41: '\\r'
|
||||
{
|
||||
match('\r');
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
match('\n');
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_SL_COMMENT"
|
||||
|
||||
// $ANTLR start "RULE_WS"
|
||||
public final void mRULE_WS() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_WS;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalTestLanguage.g:689:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ )
|
||||
// InternalTestLanguage.g:689:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
|
||||
{
|
||||
// InternalTestLanguage.g:689:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
|
||||
int cnt11=0;
|
||||
loop11:
|
||||
do {
|
||||
int alt11=2;
|
||||
int LA11_0 = input.LA(1);
|
||||
|
||||
if ( ((LA11_0>='\t' && LA11_0<='\n')||LA11_0=='\r'||LA11_0==' ') ) {
|
||||
alt11=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt11) {
|
||||
case 1 :
|
||||
// InternalTestLanguage.g:
|
||||
{
|
||||
if ( (input.LA(1)>='\t' && input.LA(1)<='\n')||input.LA(1)=='\r'||input.LA(1)==' ' ) {
|
||||
input.consume();
|
||||
|
||||
}
|
||||
else {
|
||||
MismatchedSetException mse = new MismatchedSetException(null,input);
|
||||
recover(mse);
|
||||
throw mse;}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
if ( cnt11 >= 1 ) break loop11;
|
||||
EarlyExitException eee =
|
||||
new EarlyExitException(11, input);
|
||||
throw eee;
|
||||
}
|
||||
cnt11++;
|
||||
} while (true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_WS"
|
||||
|
||||
// $ANTLR start "RULE_ANY_OTHER"
|
||||
public final void mRULE_ANY_OTHER() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_ANY_OTHER;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalTestLanguage.g:691:16: ( . )
|
||||
// InternalTestLanguage.g:691:18: .
|
||||
{
|
||||
matchAny();
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_ANY_OTHER"
|
||||
|
||||
public void mTokens() throws RecognitionException {
|
||||
// InternalTestLanguage.g:1:8: ( T__11 | T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | T__18 | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER )
|
||||
int alt12=15;
|
||||
alt12 = dfa12.predict(input);
|
||||
switch (alt12) {
|
||||
case 1 :
|
||||
// InternalTestLanguage.g:1:10: T__11
|
||||
{
|
||||
mT__11();
|
||||
|
||||
}
|
||||
break;
|
||||
case 2 :
|
||||
// InternalTestLanguage.g:1:16: T__12
|
||||
{
|
||||
mT__12();
|
||||
|
||||
}
|
||||
break;
|
||||
case 3 :
|
||||
// InternalTestLanguage.g:1:22: T__13
|
||||
{
|
||||
mT__13();
|
||||
|
||||
}
|
||||
break;
|
||||
case 4 :
|
||||
// InternalTestLanguage.g:1:28: T__14
|
||||
{
|
||||
mT__14();
|
||||
|
||||
}
|
||||
break;
|
||||
case 5 :
|
||||
// InternalTestLanguage.g:1:34: T__15
|
||||
{
|
||||
mT__15();
|
||||
|
||||
}
|
||||
break;
|
||||
case 6 :
|
||||
// InternalTestLanguage.g:1:40: T__16
|
||||
{
|
||||
mT__16();
|
||||
|
||||
}
|
||||
break;
|
||||
case 7 :
|
||||
// InternalTestLanguage.g:1:46: T__17
|
||||
{
|
||||
mT__17();
|
||||
|
||||
}
|
||||
break;
|
||||
case 8 :
|
||||
// InternalTestLanguage.g:1:52: T__18
|
||||
{
|
||||
mT__18();
|
||||
|
||||
}
|
||||
break;
|
||||
case 9 :
|
||||
// InternalTestLanguage.g:1:58: RULE_ID
|
||||
{
|
||||
mRULE_ID();
|
||||
|
||||
}
|
||||
break;
|
||||
case 10 :
|
||||
// InternalTestLanguage.g:1:66: RULE_INT
|
||||
{
|
||||
mRULE_INT();
|
||||
|
||||
}
|
||||
break;
|
||||
case 11 :
|
||||
// InternalTestLanguage.g:1:75: RULE_STRING
|
||||
{
|
||||
mRULE_STRING();
|
||||
|
||||
}
|
||||
break;
|
||||
case 12 :
|
||||
// InternalTestLanguage.g:1:87: RULE_ML_COMMENT
|
||||
{
|
||||
mRULE_ML_COMMENT();
|
||||
|
||||
}
|
||||
break;
|
||||
case 13 :
|
||||
// InternalTestLanguage.g:1:103: RULE_SL_COMMENT
|
||||
{
|
||||
mRULE_SL_COMMENT();
|
||||
|
||||
}
|
||||
break;
|
||||
case 14 :
|
||||
// InternalTestLanguage.g:1:119: RULE_WS
|
||||
{
|
||||
mRULE_WS();
|
||||
|
||||
}
|
||||
break;
|
||||
case 15 :
|
||||
// InternalTestLanguage.g:1:127: RULE_ANY_OTHER
|
||||
{
|
||||
mRULE_ANY_OTHER();
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected DFA12 dfa12 = new DFA12(this);
|
||||
static final String DFA12_eotS =
|
||||
"\1\uffff\4\22\4\uffff\1\20\2\uffff\3\20\2\uffff\1\22\1\uffff\3\22\11\uffff\1\22\1\44\3\22\1\uffff\1\22\1\51\2\22\1\uffff\1\54\1\22\1\uffff\1\56\1\uffff";
|
||||
static final String DFA12_eofS =
|
||||
"\57\uffff";
|
||||
static final String DFA12_minS =
|
||||
"\1\0\1\164\1\156\1\157\1\171\4\uffff\1\101\2\uffff\2\0\1\52\2\uffff\1\162\1\uffff\1\164\1\157\1\160\11\uffff\1\151\1\60\1\154\1\145\1\156\1\uffff\1\145\1\60\1\147\1\141\1\uffff\1\60\1\156\1\uffff\1\60\1\uffff";
|
||||
static final String DFA12_maxS =
|
||||
"\1\uffff\1\164\1\156\1\157\1\171\4\uffff\1\172\2\uffff\2\uffff\1\57\2\uffff\1\162\1\uffff\1\164\1\157\1\160\11\uffff\1\151\1\172\1\154\1\145\1\156\1\uffff\1\145\1\172\1\147\1\141\1\uffff\1\172\1\156\1\uffff\1\172\1\uffff";
|
||||
static final String DFA12_acceptS =
|
||||
"\5\uffff\1\5\1\6\1\7\1\10\1\uffff\1\11\1\12\3\uffff\1\16\1\17\1\uffff\1\11\3\uffff\1\5\1\6\1\7\1\10\1\12\1\13\1\14\1\15\1\16\5\uffff\1\2\4\uffff\1\4\2\uffff\1\1\1\uffff\1\3";
|
||||
static final String DFA12_specialS =
|
||||
"\1\2\13\uffff\1\0\1\1\41\uffff}>";
|
||||
static final String[] DFA12_transitionS = {
|
||||
"\11\20\2\17\2\20\1\17\22\20\1\17\1\20\1\14\4\20\1\15\7\20\1\16\12\13\7\20\32\12\1\10\1\20\1\7\1\11\1\12\1\20\1\12\1\3\6\12\1\2\11\12\1\1\1\4\6\12\1\5\1\20\1\6\uff82\20",
|
||||
"\1\21",
|
||||
"\1\23",
|
||||
"\1\24",
|
||||
"\1\25",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"\32\22\4\uffff\1\22\1\uffff\32\22",
|
||||
"",
|
||||
"",
|
||||
"\0\33",
|
||||
"\0\33",
|
||||
"\1\34\4\uffff\1\35",
|
||||
"",
|
||||
"",
|
||||
"\1\37",
|
||||
"",
|
||||
"\1\40",
|
||||
"\1\41",
|
||||
"\1\42",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"\1\43",
|
||||
"\12\22\7\uffff\32\22\4\uffff\1\22\1\uffff\32\22",
|
||||
"\1\45",
|
||||
"\1\46",
|
||||
"\1\47",
|
||||
"",
|
||||
"\1\50",
|
||||
"\12\22\7\uffff\32\22\4\uffff\1\22\1\uffff\32\22",
|
||||
"\1\52",
|
||||
"\1\53",
|
||||
"",
|
||||
"\12\22\7\uffff\32\22\4\uffff\1\22\1\uffff\32\22",
|
||||
"\1\55",
|
||||
"",
|
||||
"\12\22\7\uffff\32\22\4\uffff\1\22\1\uffff\32\22",
|
||||
""
|
||||
};
|
||||
|
||||
static final short[] DFA12_eot = DFA.unpackEncodedString(DFA12_eotS);
|
||||
static final short[] DFA12_eof = DFA.unpackEncodedString(DFA12_eofS);
|
||||
static final char[] DFA12_min = DFA.unpackEncodedStringToUnsignedChars(DFA12_minS);
|
||||
static final char[] DFA12_max = DFA.unpackEncodedStringToUnsignedChars(DFA12_maxS);
|
||||
static final short[] DFA12_accept = DFA.unpackEncodedString(DFA12_acceptS);
|
||||
static final short[] DFA12_special = DFA.unpackEncodedString(DFA12_specialS);
|
||||
static final short[][] DFA12_transition;
|
||||
|
||||
static {
|
||||
int numStates = DFA12_transitionS.length;
|
||||
DFA12_transition = new short[numStates][];
|
||||
for (int i=0; i<numStates; i++) {
|
||||
DFA12_transition[i] = DFA.unpackEncodedString(DFA12_transitionS[i]);
|
||||
}
|
||||
}
|
||||
|
||||
class DFA12 extends DFA {
|
||||
|
||||
public DFA12(BaseRecognizer recognizer) {
|
||||
this.recognizer = recognizer;
|
||||
this.decisionNumber = 12;
|
||||
this.eot = DFA12_eot;
|
||||
this.eof = DFA12_eof;
|
||||
this.min = DFA12_min;
|
||||
this.max = DFA12_max;
|
||||
this.accept = DFA12_accept;
|
||||
this.special = DFA12_special;
|
||||
this.transition = DFA12_transition;
|
||||
}
|
||||
public String getDescription() {
|
||||
return "1:1: Tokens : ( T__11 | T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | T__18 | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER );";
|
||||
}
|
||||
public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
|
||||
IntStream input = _input;
|
||||
int _s = s;
|
||||
switch ( s ) {
|
||||
case 0 :
|
||||
int LA12_12 = input.LA(1);
|
||||
|
||||
s = -1;
|
||||
if ( ((LA12_12>='\u0000' && LA12_12<='\uFFFF')) ) {s = 27;}
|
||||
|
||||
else s = 16;
|
||||
|
||||
if ( s>=0 ) return s;
|
||||
break;
|
||||
case 1 :
|
||||
int LA12_13 = input.LA(1);
|
||||
|
||||
s = -1;
|
||||
if ( ((LA12_13>='\u0000' && LA12_13<='\uFFFF')) ) {s = 27;}
|
||||
|
||||
else s = 16;
|
||||
|
||||
if ( s>=0 ) return s;
|
||||
break;
|
||||
case 2 :
|
||||
int LA12_0 = input.LA(1);
|
||||
|
||||
s = -1;
|
||||
if ( (LA12_0=='s') ) {s = 1;}
|
||||
|
||||
else if ( (LA12_0=='i') ) {s = 2;}
|
||||
|
||||
else if ( (LA12_0=='b') ) {s = 3;}
|
||||
|
||||
else if ( (LA12_0=='t') ) {s = 4;}
|
||||
|
||||
else if ( (LA12_0=='{') ) {s = 5;}
|
||||
|
||||
else if ( (LA12_0=='}') ) {s = 6;}
|
||||
|
||||
else if ( (LA12_0==']') ) {s = 7;}
|
||||
|
||||
else if ( (LA12_0=='[') ) {s = 8;}
|
||||
|
||||
else if ( (LA12_0=='^') ) {s = 9;}
|
||||
|
||||
else if ( ((LA12_0>='A' && LA12_0<='Z')||LA12_0=='_'||LA12_0=='a'||(LA12_0>='c' && LA12_0<='h')||(LA12_0>='j' && LA12_0<='r')||(LA12_0>='u' && LA12_0<='z')) ) {s = 10;}
|
||||
|
||||
else if ( ((LA12_0>='0' && LA12_0<='9')) ) {s = 11;}
|
||||
|
||||
else if ( (LA12_0=='\"') ) {s = 12;}
|
||||
|
||||
else if ( (LA12_0=='\'') ) {s = 13;}
|
||||
|
||||
else if ( (LA12_0=='/') ) {s = 14;}
|
||||
|
||||
else if ( ((LA12_0>='\t' && LA12_0<='\n')||LA12_0=='\r'||LA12_0==' ') ) {s = 15;}
|
||||
|
||||
else if ( ((LA12_0>='\u0000' && LA12_0<='\b')||(LA12_0>='\u000B' && LA12_0<='\f')||(LA12_0>='\u000E' && LA12_0<='\u001F')||LA12_0=='!'||(LA12_0>='#' && LA12_0<='&')||(LA12_0>='(' && LA12_0<='.')||(LA12_0>=':' && LA12_0<='@')||LA12_0=='\\'||LA12_0=='`'||LA12_0=='|'||(LA12_0>='~' && LA12_0<='\uFFFF')) ) {s = 16;}
|
||||
|
||||
if ( s>=0 ) return s;
|
||||
break;
|
||||
}
|
||||
NoViableAltException nvae =
|
||||
new NoViableAltException(getDescription(), 12, _s, input);
|
||||
error(nvae);
|
||||
throw nvae;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.testlanguage.parser.antlr;
|
||||
|
||||
import java.io.InputStream;
|
||||
import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider;
|
||||
|
||||
public class TestLanguageAntlrTokenFileProvider implements IAntlrTokenFileProvider {
|
||||
|
||||
@Override
|
||||
public InputStream getAntlrTokenFile() {
|
||||
ClassLoader classLoader = getClass().getClassLoader();
|
||||
return classLoader.getResourceAsStream("org/eclipse/xtext/ide/tests/testlanguage/parser/antlr/internal/InternalTestLanguage.tokens");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.testlanguage.parser.antlr;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.parser.antlr.internal.InternalTestLanguageParser;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.services.TestLanguageGrammarAccess;
|
||||
import org.eclipse.xtext.parser.antlr.AbstractAntlrParser;
|
||||
import org.eclipse.xtext.parser.antlr.XtextTokenStream;
|
||||
|
||||
public class TestLanguageParser extends AbstractAntlrParser {
|
||||
|
||||
@Inject
|
||||
private TestLanguageGrammarAccess grammarAccess;
|
||||
|
||||
@Override
|
||||
protected void setInitialHiddenTokens(XtextTokenStream tokenStream) {
|
||||
tokenStream.setInitialHiddenTokens("RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected InternalTestLanguageParser createParser(XtextTokenStream stream) {
|
||||
return new InternalTestLanguageParser(stream, getGrammarAccess());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getDefaultRuleName() {
|
||||
return "Model";
|
||||
}
|
||||
|
||||
public TestLanguageGrammarAccess getGrammarAccess() {
|
||||
return this.grammarAccess;
|
||||
}
|
||||
|
||||
public void setGrammarAccess(TestLanguageGrammarAccess grammarAccess) {
|
||||
this.grammarAccess = grammarAccess;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,382 @@
|
|||
/*
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
grammar InternalTestLanguage;
|
||||
|
||||
options {
|
||||
superClass=AbstractInternalAntlrParser;
|
||||
}
|
||||
|
||||
@lexer::header {
|
||||
package org.eclipse.xtext.ide.tests.testlanguage.parser.antlr.internal;
|
||||
|
||||
// Hack: Use our own Lexer superclass by means of import.
|
||||
// Currently there is no other way to specify the superclass for the lexer.
|
||||
import org.eclipse.xtext.parser.antlr.Lexer;
|
||||
}
|
||||
|
||||
@parser::header {
|
||||
package org.eclipse.xtext.ide.tests.testlanguage.parser.antlr.internal;
|
||||
|
||||
import org.eclipse.xtext.*;
|
||||
import org.eclipse.xtext.parser.*;
|
||||
import org.eclipse.xtext.parser.impl.*;
|
||||
import org.eclipse.emf.ecore.util.EcoreUtil;
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser;
|
||||
import org.eclipse.xtext.parser.antlr.XtextTokenStream;
|
||||
import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens;
|
||||
import org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.services.TestLanguageGrammarAccess;
|
||||
|
||||
}
|
||||
|
||||
@parser::members {
|
||||
|
||||
private TestLanguageGrammarAccess grammarAccess;
|
||||
|
||||
public InternalTestLanguageParser(TokenStream input, TestLanguageGrammarAccess grammarAccess) {
|
||||
this(input);
|
||||
this.grammarAccess = grammarAccess;
|
||||
registerRules(grammarAccess.getGrammar());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getFirstRuleName() {
|
||||
return "Model";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TestLanguageGrammarAccess getGrammarAccess() {
|
||||
return grammarAccess;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@rulecatch {
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
}
|
||||
|
||||
// Entry rule entryRuleModel
|
||||
entryRuleModel returns [EObject current=null]:
|
||||
{ newCompositeNode(grammarAccess.getModelRule()); }
|
||||
iv_ruleModel=ruleModel
|
||||
{ $current=$iv_ruleModel.current; }
|
||||
EOF;
|
||||
|
||||
// Rule Model
|
||||
ruleModel returns [EObject current=null]
|
||||
@init {
|
||||
enterRule();
|
||||
}
|
||||
@after {
|
||||
leaveRule();
|
||||
}:
|
||||
(
|
||||
(
|
||||
{
|
||||
newCompositeNode(grammarAccess.getModelAccess().getTypesTypeDeclarationParserRuleCall_0());
|
||||
}
|
||||
lv_types_0_0=ruleTypeDeclaration
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = createModelElementForParent(grammarAccess.getModelRule());
|
||||
}
|
||||
add(
|
||||
$current,
|
||||
"types",
|
||||
lv_types_0_0,
|
||||
"org.eclipse.xtext.ide.tests.testlanguage.TestLanguage.TypeDeclaration");
|
||||
afterParserOrEnumRuleCall();
|
||||
}
|
||||
)
|
||||
)*
|
||||
;
|
||||
|
||||
// Entry rule entryRuleTypeDeclaration
|
||||
entryRuleTypeDeclaration returns [EObject current=null]:
|
||||
{ newCompositeNode(grammarAccess.getTypeDeclarationRule()); }
|
||||
iv_ruleTypeDeclaration=ruleTypeDeclaration
|
||||
{ $current=$iv_ruleTypeDeclaration.current; }
|
||||
EOF;
|
||||
|
||||
// Rule TypeDeclaration
|
||||
ruleTypeDeclaration returns [EObject current=null]
|
||||
@init {
|
||||
enterRule();
|
||||
}
|
||||
@after {
|
||||
leaveRule();
|
||||
}:
|
||||
(
|
||||
otherlv_0='type'
|
||||
{
|
||||
newLeafNode(otherlv_0, grammarAccess.getTypeDeclarationAccess().getTypeKeyword_0());
|
||||
}
|
||||
(
|
||||
(
|
||||
lv_name_1_0=RULE_ID
|
||||
{
|
||||
newLeafNode(lv_name_1_0, grammarAccess.getTypeDeclarationAccess().getNameIDTerminalRuleCall_1_0());
|
||||
}
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = createModelElement(grammarAccess.getTypeDeclarationRule());
|
||||
}
|
||||
setWithLastConsumed(
|
||||
$current,
|
||||
"name",
|
||||
lv_name_1_0,
|
||||
"org.eclipse.xtext.common.Terminals.ID");
|
||||
}
|
||||
)
|
||||
)
|
||||
otherlv_2='{'
|
||||
{
|
||||
newLeafNode(otherlv_2, grammarAccess.getTypeDeclarationAccess().getLeftCurlyBracketKeyword_2());
|
||||
}
|
||||
(
|
||||
(
|
||||
{
|
||||
newCompositeNode(grammarAccess.getTypeDeclarationAccess().getPropertiesPropertyParserRuleCall_3_0());
|
||||
}
|
||||
lv_properties_3_0=ruleProperty
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = createModelElementForParent(grammarAccess.getTypeDeclarationRule());
|
||||
}
|
||||
add(
|
||||
$current,
|
||||
"properties",
|
||||
lv_properties_3_0,
|
||||
"org.eclipse.xtext.ide.tests.testlanguage.TestLanguage.Property");
|
||||
afterParserOrEnumRuleCall();
|
||||
}
|
||||
)
|
||||
)*
|
||||
otherlv_4='}'
|
||||
{
|
||||
newLeafNode(otherlv_4, grammarAccess.getTypeDeclarationAccess().getRightCurlyBracketKeyword_4());
|
||||
}
|
||||
)
|
||||
;
|
||||
|
||||
// Entry rule entryRuleProperty
|
||||
entryRuleProperty returns [EObject current=null]:
|
||||
{ newCompositeNode(grammarAccess.getPropertyRule()); }
|
||||
iv_ruleProperty=ruleProperty
|
||||
{ $current=$iv_ruleProperty.current; }
|
||||
EOF;
|
||||
|
||||
// Rule Property
|
||||
ruleProperty returns [EObject current=null]
|
||||
@init {
|
||||
enterRule();
|
||||
}
|
||||
@after {
|
||||
leaveRule();
|
||||
}:
|
||||
(
|
||||
(
|
||||
(
|
||||
lv_name_0_0=RULE_ID
|
||||
{
|
||||
newLeafNode(lv_name_0_0, grammarAccess.getPropertyAccess().getNameIDTerminalRuleCall_0_0());
|
||||
}
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = createModelElement(grammarAccess.getPropertyRule());
|
||||
}
|
||||
setWithLastConsumed(
|
||||
$current,
|
||||
"name",
|
||||
lv_name_0_0,
|
||||
"org.eclipse.xtext.common.Terminals.ID");
|
||||
}
|
||||
)
|
||||
)
|
||||
(
|
||||
(
|
||||
{
|
||||
newCompositeNode(grammarAccess.getPropertyAccess().getTypeTypeParserRuleCall_1_0());
|
||||
}
|
||||
lv_type_1_0=ruleType
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = createModelElementForParent(grammarAccess.getPropertyRule());
|
||||
}
|
||||
set(
|
||||
$current,
|
||||
"type",
|
||||
lv_type_1_0,
|
||||
"org.eclipse.xtext.ide.tests.testlanguage.TestLanguage.Type");
|
||||
afterParserOrEnumRuleCall();
|
||||
}
|
||||
)
|
||||
)
|
||||
)
|
||||
;
|
||||
|
||||
// Entry rule entryRuleType
|
||||
entryRuleType returns [EObject current=null]:
|
||||
{ newCompositeNode(grammarAccess.getTypeRule()); }
|
||||
iv_ruleType=ruleType
|
||||
{ $current=$iv_ruleType.current; }
|
||||
EOF;
|
||||
|
||||
// Rule Type
|
||||
ruleType returns [EObject current=null]
|
||||
@init {
|
||||
enterRule();
|
||||
}
|
||||
@after {
|
||||
leaveRule();
|
||||
}:
|
||||
(
|
||||
(
|
||||
{
|
||||
newCompositeNode(grammarAccess.getTypeAccess().getTypeReferenceParserRuleCall_0_0());
|
||||
}
|
||||
this_TypeReference_0=ruleTypeReference
|
||||
{
|
||||
$current = $this_TypeReference_0.current;
|
||||
afterParserOrEnumRuleCall();
|
||||
}
|
||||
|
|
||||
{
|
||||
newCompositeNode(grammarAccess.getTypeAccess().getPrimitiveTypeParserRuleCall_0_1());
|
||||
}
|
||||
this_PrimitiveType_1=rulePrimitiveType
|
||||
{
|
||||
$current = $this_PrimitiveType_1.current;
|
||||
afterParserOrEnumRuleCall();
|
||||
}
|
||||
)
|
||||
(
|
||||
(
|
||||
(
|
||||
lv_arrayDiemensions_2_0='['
|
||||
{
|
||||
newLeafNode(lv_arrayDiemensions_2_0, grammarAccess.getTypeAccess().getArrayDiemensionsLeftSquareBracketKeyword_1_0_0());
|
||||
}
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = createModelElement(grammarAccess.getTypeRule());
|
||||
}
|
||||
addWithLastConsumed($current, "arrayDiemensions", lv_arrayDiemensions_2_0, "[");
|
||||
}
|
||||
)
|
||||
)
|
||||
otherlv_3=']'
|
||||
{
|
||||
newLeafNode(otherlv_3, grammarAccess.getTypeAccess().getRightSquareBracketKeyword_1_1());
|
||||
}
|
||||
)*
|
||||
)
|
||||
;
|
||||
|
||||
// Entry rule entryRuleTypeReference
|
||||
entryRuleTypeReference returns [EObject current=null]:
|
||||
{ newCompositeNode(grammarAccess.getTypeReferenceRule()); }
|
||||
iv_ruleTypeReference=ruleTypeReference
|
||||
{ $current=$iv_ruleTypeReference.current; }
|
||||
EOF;
|
||||
|
||||
// Rule TypeReference
|
||||
ruleTypeReference returns [EObject current=null]
|
||||
@init {
|
||||
enterRule();
|
||||
}
|
||||
@after {
|
||||
leaveRule();
|
||||
}:
|
||||
(
|
||||
(
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = createModelElement(grammarAccess.getTypeReferenceRule());
|
||||
}
|
||||
}
|
||||
otherlv_0=RULE_ID
|
||||
{
|
||||
newLeafNode(otherlv_0, grammarAccess.getTypeReferenceAccess().getTypeRefTypeCrossReference_0());
|
||||
}
|
||||
)
|
||||
)
|
||||
;
|
||||
|
||||
// Entry rule entryRulePrimitiveType
|
||||
entryRulePrimitiveType returns [EObject current=null]:
|
||||
{ newCompositeNode(grammarAccess.getPrimitiveTypeRule()); }
|
||||
iv_rulePrimitiveType=rulePrimitiveType
|
||||
{ $current=$iv_rulePrimitiveType.current; }
|
||||
EOF;
|
||||
|
||||
// Rule PrimitiveType
|
||||
rulePrimitiveType returns [EObject current=null]
|
||||
@init {
|
||||
enterRule();
|
||||
}
|
||||
@after {
|
||||
leaveRule();
|
||||
}:
|
||||
(
|
||||
(
|
||||
(
|
||||
lv_name_0_1='string'
|
||||
{
|
||||
newLeafNode(lv_name_0_1, grammarAccess.getPrimitiveTypeAccess().getNameStringKeyword_0_0());
|
||||
}
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = createModelElement(grammarAccess.getPrimitiveTypeRule());
|
||||
}
|
||||
setWithLastConsumed($current, "name", lv_name_0_1, null);
|
||||
}
|
||||
|
|
||||
lv_name_0_2='int'
|
||||
{
|
||||
newLeafNode(lv_name_0_2, grammarAccess.getPrimitiveTypeAccess().getNameIntKeyword_0_1());
|
||||
}
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = createModelElement(grammarAccess.getPrimitiveTypeRule());
|
||||
}
|
||||
setWithLastConsumed($current, "name", lv_name_0_2, null);
|
||||
}
|
||||
|
|
||||
lv_name_0_3='boolean'
|
||||
{
|
||||
newLeafNode(lv_name_0_3, grammarAccess.getPrimitiveTypeAccess().getNameBooleanKeyword_0_2());
|
||||
}
|
||||
{
|
||||
if ($current==null) {
|
||||
$current = createModelElement(grammarAccess.getPrimitiveTypeRule());
|
||||
}
|
||||
setWithLastConsumed($current, "name", lv_name_0_3, null);
|
||||
}
|
||||
)
|
||||
)
|
||||
)
|
||||
;
|
||||
|
||||
RULE_ID : '^'? ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*;
|
||||
|
||||
RULE_INT : ('0'..'9')+;
|
||||
|
||||
RULE_STRING : ('"' ('\\' .|~(('\\'|'"')))* '"'|'\'' ('\\' .|~(('\\'|'\'')))* '\'');
|
||||
|
||||
RULE_ML_COMMENT : '/*' ( options {greedy=false;} : . )*'*/';
|
||||
|
||||
RULE_SL_COMMENT : '//' ~(('\n'|'\r'))* ('\r'? '\n')?;
|
||||
|
||||
RULE_WS : (' '|'\t'|'\r'|'\n')+;
|
||||
|
||||
RULE_ANY_OTHER : .;
|
|
@ -0,0 +1,23 @@
|
|||
'['=14
|
||||
']'=15
|
||||
'boolean'=18
|
||||
'int'=17
|
||||
'string'=16
|
||||
'type'=11
|
||||
'{'=12
|
||||
'}'=13
|
||||
RULE_ANY_OTHER=10
|
||||
RULE_ID=4
|
||||
RULE_INT=5
|
||||
RULE_ML_COMMENT=7
|
||||
RULE_SL_COMMENT=8
|
||||
RULE_STRING=6
|
||||
RULE_WS=9
|
||||
T__11=11
|
||||
T__12=12
|
||||
T__13=13
|
||||
T__14=14
|
||||
T__15=15
|
||||
T__16=16
|
||||
T__17=17
|
||||
T__18=18
|
|
@ -0,0 +1,989 @@
|
|||
package org.eclipse.xtext.ide.tests.testlanguage.parser.antlr.internal;
|
||||
|
||||
// Hack: Use our own Lexer superclass by means of import.
|
||||
// Currently there is no other way to specify the superclass for the lexer.
|
||||
import org.eclipse.xtext.parser.antlr.Lexer;
|
||||
|
||||
|
||||
import org.antlr.runtime.*;
|
||||
import java.util.Stack;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public class InternalTestLanguageLexer extends Lexer {
|
||||
public static final int RULE_ID=4;
|
||||
public static final int RULE_STRING=6;
|
||||
public static final int T__16=16;
|
||||
public static final int T__15=15;
|
||||
public static final int T__18=18;
|
||||
public static final int T__17=17;
|
||||
public static final int T__12=12;
|
||||
public static final int T__11=11;
|
||||
public static final int T__14=14;
|
||||
public static final int T__13=13;
|
||||
public static final int RULE_ANY_OTHER=10;
|
||||
public static final int RULE_INT=5;
|
||||
public static final int RULE_WS=9;
|
||||
public static final int RULE_SL_COMMENT=8;
|
||||
public static final int EOF=-1;
|
||||
public static final int RULE_ML_COMMENT=7;
|
||||
|
||||
// delegates
|
||||
// delegators
|
||||
|
||||
public InternalTestLanguageLexer() {;}
|
||||
public InternalTestLanguageLexer(CharStream input) {
|
||||
this(input, new RecognizerSharedState());
|
||||
}
|
||||
public InternalTestLanguageLexer(CharStream input, RecognizerSharedState state) {
|
||||
super(input,state);
|
||||
|
||||
}
|
||||
public String getGrammarFileName() { return "InternalTestLanguage.g"; }
|
||||
|
||||
// $ANTLR start "T__11"
|
||||
public final void mT__11() throws RecognitionException {
|
||||
try {
|
||||
int _type = T__11;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalTestLanguage.g:11:7: ( 'type' )
|
||||
// InternalTestLanguage.g:11:9: 'type'
|
||||
{
|
||||
match("type");
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "T__11"
|
||||
|
||||
// $ANTLR start "T__12"
|
||||
public final void mT__12() throws RecognitionException {
|
||||
try {
|
||||
int _type = T__12;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalTestLanguage.g:12:7: ( '{' )
|
||||
// InternalTestLanguage.g:12:9: '{'
|
||||
{
|
||||
match('{');
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "T__12"
|
||||
|
||||
// $ANTLR start "T__13"
|
||||
public final void mT__13() throws RecognitionException {
|
||||
try {
|
||||
int _type = T__13;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalTestLanguage.g:13:7: ( '}' )
|
||||
// InternalTestLanguage.g:13:9: '}'
|
||||
{
|
||||
match('}');
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "T__13"
|
||||
|
||||
// $ANTLR start "T__14"
|
||||
public final void mT__14() throws RecognitionException {
|
||||
try {
|
||||
int _type = T__14;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalTestLanguage.g:14:7: ( '[' )
|
||||
// InternalTestLanguage.g:14:9: '['
|
||||
{
|
||||
match('[');
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "T__14"
|
||||
|
||||
// $ANTLR start "T__15"
|
||||
public final void mT__15() throws RecognitionException {
|
||||
try {
|
||||
int _type = T__15;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalTestLanguage.g:15:7: ( ']' )
|
||||
// InternalTestLanguage.g:15:9: ']'
|
||||
{
|
||||
match(']');
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "T__15"
|
||||
|
||||
// $ANTLR start "T__16"
|
||||
public final void mT__16() throws RecognitionException {
|
||||
try {
|
||||
int _type = T__16;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalTestLanguage.g:16:7: ( 'string' )
|
||||
// InternalTestLanguage.g:16:9: 'string'
|
||||
{
|
||||
match("string");
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "T__16"
|
||||
|
||||
// $ANTLR start "T__17"
|
||||
public final void mT__17() throws RecognitionException {
|
||||
try {
|
||||
int _type = T__17;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalTestLanguage.g:17:7: ( 'int' )
|
||||
// InternalTestLanguage.g:17:9: 'int'
|
||||
{
|
||||
match("int");
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "T__17"
|
||||
|
||||
// $ANTLR start "T__18"
|
||||
public final void mT__18() throws RecognitionException {
|
||||
try {
|
||||
int _type = T__18;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalTestLanguage.g:18:7: ( 'boolean' )
|
||||
// InternalTestLanguage.g:18:9: 'boolean'
|
||||
{
|
||||
match("boolean");
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "T__18"
|
||||
|
||||
// $ANTLR start "RULE_ID"
|
||||
public final void mRULE_ID() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_ID;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalTestLanguage.g:370:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* )
|
||||
// InternalTestLanguage.g:370:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
|
||||
{
|
||||
// InternalTestLanguage.g:370:11: ( '^' )?
|
||||
int alt1=2;
|
||||
int LA1_0 = input.LA(1);
|
||||
|
||||
if ( (LA1_0=='^') ) {
|
||||
alt1=1;
|
||||
}
|
||||
switch (alt1) {
|
||||
case 1 :
|
||||
// InternalTestLanguage.g:370:11: '^'
|
||||
{
|
||||
match('^');
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if ( (input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) {
|
||||
input.consume();
|
||||
|
||||
}
|
||||
else {
|
||||
MismatchedSetException mse = new MismatchedSetException(null,input);
|
||||
recover(mse);
|
||||
throw mse;}
|
||||
|
||||
// InternalTestLanguage.g:370:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
|
||||
loop2:
|
||||
do {
|
||||
int alt2=2;
|
||||
int LA2_0 = input.LA(1);
|
||||
|
||||
if ( ((LA2_0>='0' && LA2_0<='9')||(LA2_0>='A' && LA2_0<='Z')||LA2_0=='_'||(LA2_0>='a' && LA2_0<='z')) ) {
|
||||
alt2=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt2) {
|
||||
case 1 :
|
||||
// InternalTestLanguage.g:
|
||||
{
|
||||
if ( (input.LA(1)>='0' && input.LA(1)<='9')||(input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) {
|
||||
input.consume();
|
||||
|
||||
}
|
||||
else {
|
||||
MismatchedSetException mse = new MismatchedSetException(null,input);
|
||||
recover(mse);
|
||||
throw mse;}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop2;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_ID"
|
||||
|
||||
// $ANTLR start "RULE_INT"
|
||||
public final void mRULE_INT() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_INT;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalTestLanguage.g:372:10: ( ( '0' .. '9' )+ )
|
||||
// InternalTestLanguage.g:372:12: ( '0' .. '9' )+
|
||||
{
|
||||
// InternalTestLanguage.g:372:12: ( '0' .. '9' )+
|
||||
int cnt3=0;
|
||||
loop3:
|
||||
do {
|
||||
int alt3=2;
|
||||
int LA3_0 = input.LA(1);
|
||||
|
||||
if ( ((LA3_0>='0' && LA3_0<='9')) ) {
|
||||
alt3=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt3) {
|
||||
case 1 :
|
||||
// InternalTestLanguage.g:372:13: '0' .. '9'
|
||||
{
|
||||
matchRange('0','9');
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
if ( cnt3 >= 1 ) break loop3;
|
||||
EarlyExitException eee =
|
||||
new EarlyExitException(3, input);
|
||||
throw eee;
|
||||
}
|
||||
cnt3++;
|
||||
} while (true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_INT"
|
||||
|
||||
// $ANTLR start "RULE_STRING"
|
||||
public final void mRULE_STRING() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_STRING;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalTestLanguage.g:374:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) )
|
||||
// InternalTestLanguage.g:374:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
|
||||
{
|
||||
// InternalTestLanguage.g:374:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
|
||||
int alt6=2;
|
||||
int LA6_0 = input.LA(1);
|
||||
|
||||
if ( (LA6_0=='\"') ) {
|
||||
alt6=1;
|
||||
}
|
||||
else if ( (LA6_0=='\'') ) {
|
||||
alt6=2;
|
||||
}
|
||||
else {
|
||||
NoViableAltException nvae =
|
||||
new NoViableAltException("", 6, 0, input);
|
||||
|
||||
throw nvae;
|
||||
}
|
||||
switch (alt6) {
|
||||
case 1 :
|
||||
// InternalTestLanguage.g:374:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"'
|
||||
{
|
||||
match('\"');
|
||||
// InternalTestLanguage.g:374:20: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )*
|
||||
loop4:
|
||||
do {
|
||||
int alt4=3;
|
||||
int LA4_0 = input.LA(1);
|
||||
|
||||
if ( (LA4_0=='\\') ) {
|
||||
alt4=1;
|
||||
}
|
||||
else if ( ((LA4_0>='\u0000' && LA4_0<='!')||(LA4_0>='#' && LA4_0<='[')||(LA4_0>=']' && LA4_0<='\uFFFF')) ) {
|
||||
alt4=2;
|
||||
}
|
||||
|
||||
|
||||
switch (alt4) {
|
||||
case 1 :
|
||||
// InternalTestLanguage.g:374:21: '\\\\' .
|
||||
{
|
||||
match('\\');
|
||||
matchAny();
|
||||
|
||||
}
|
||||
break;
|
||||
case 2 :
|
||||
// InternalTestLanguage.g:374:28: ~ ( ( '\\\\' | '\"' ) )
|
||||
{
|
||||
if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) {
|
||||
input.consume();
|
||||
|
||||
}
|
||||
else {
|
||||
MismatchedSetException mse = new MismatchedSetException(null,input);
|
||||
recover(mse);
|
||||
throw mse;}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop4;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
match('\"');
|
||||
|
||||
}
|
||||
break;
|
||||
case 2 :
|
||||
// InternalTestLanguage.g:374:48: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\''
|
||||
{
|
||||
match('\'');
|
||||
// InternalTestLanguage.g:374:53: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )*
|
||||
loop5:
|
||||
do {
|
||||
int alt5=3;
|
||||
int LA5_0 = input.LA(1);
|
||||
|
||||
if ( (LA5_0=='\\') ) {
|
||||
alt5=1;
|
||||
}
|
||||
else if ( ((LA5_0>='\u0000' && LA5_0<='&')||(LA5_0>='(' && LA5_0<='[')||(LA5_0>=']' && LA5_0<='\uFFFF')) ) {
|
||||
alt5=2;
|
||||
}
|
||||
|
||||
|
||||
switch (alt5) {
|
||||
case 1 :
|
||||
// InternalTestLanguage.g:374:54: '\\\\' .
|
||||
{
|
||||
match('\\');
|
||||
matchAny();
|
||||
|
||||
}
|
||||
break;
|
||||
case 2 :
|
||||
// InternalTestLanguage.g:374:61: ~ ( ( '\\\\' | '\\'' ) )
|
||||
{
|
||||
if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) {
|
||||
input.consume();
|
||||
|
||||
}
|
||||
else {
|
||||
MismatchedSetException mse = new MismatchedSetException(null,input);
|
||||
recover(mse);
|
||||
throw mse;}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop5;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
match('\'');
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_STRING"
|
||||
|
||||
// $ANTLR start "RULE_ML_COMMENT"
|
||||
public final void mRULE_ML_COMMENT() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_ML_COMMENT;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalTestLanguage.g:376:17: ( '/*' ( options {greedy=false; } : . )* '*/' )
|
||||
// InternalTestLanguage.g:376:19: '/*' ( options {greedy=false; } : . )* '*/'
|
||||
{
|
||||
match("/*");
|
||||
|
||||
// InternalTestLanguage.g:376:24: ( options {greedy=false; } : . )*
|
||||
loop7:
|
||||
do {
|
||||
int alt7=2;
|
||||
int LA7_0 = input.LA(1);
|
||||
|
||||
if ( (LA7_0=='*') ) {
|
||||
int LA7_1 = input.LA(2);
|
||||
|
||||
if ( (LA7_1=='/') ) {
|
||||
alt7=2;
|
||||
}
|
||||
else if ( ((LA7_1>='\u0000' && LA7_1<='.')||(LA7_1>='0' && LA7_1<='\uFFFF')) ) {
|
||||
alt7=1;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else if ( ((LA7_0>='\u0000' && LA7_0<=')')||(LA7_0>='+' && LA7_0<='\uFFFF')) ) {
|
||||
alt7=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt7) {
|
||||
case 1 :
|
||||
// InternalTestLanguage.g:376:52: .
|
||||
{
|
||||
matchAny();
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop7;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
match("*/");
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_ML_COMMENT"
|
||||
|
||||
// $ANTLR start "RULE_SL_COMMENT"
|
||||
public final void mRULE_SL_COMMENT() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_SL_COMMENT;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalTestLanguage.g:378:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? )
|
||||
// InternalTestLanguage.g:378:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )?
|
||||
{
|
||||
match("//");
|
||||
|
||||
// InternalTestLanguage.g:378:24: (~ ( ( '\\n' | '\\r' ) ) )*
|
||||
loop8:
|
||||
do {
|
||||
int alt8=2;
|
||||
int LA8_0 = input.LA(1);
|
||||
|
||||
if ( ((LA8_0>='\u0000' && LA8_0<='\t')||(LA8_0>='\u000B' && LA8_0<='\f')||(LA8_0>='\u000E' && LA8_0<='\uFFFF')) ) {
|
||||
alt8=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt8) {
|
||||
case 1 :
|
||||
// InternalTestLanguage.g:378:24: ~ ( ( '\\n' | '\\r' ) )
|
||||
{
|
||||
if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\uFFFF') ) {
|
||||
input.consume();
|
||||
|
||||
}
|
||||
else {
|
||||
MismatchedSetException mse = new MismatchedSetException(null,input);
|
||||
recover(mse);
|
||||
throw mse;}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop8;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
// InternalTestLanguage.g:378:40: ( ( '\\r' )? '\\n' )?
|
||||
int alt10=2;
|
||||
int LA10_0 = input.LA(1);
|
||||
|
||||
if ( (LA10_0=='\n'||LA10_0=='\r') ) {
|
||||
alt10=1;
|
||||
}
|
||||
switch (alt10) {
|
||||
case 1 :
|
||||
// InternalTestLanguage.g:378:41: ( '\\r' )? '\\n'
|
||||
{
|
||||
// InternalTestLanguage.g:378:41: ( '\\r' )?
|
||||
int alt9=2;
|
||||
int LA9_0 = input.LA(1);
|
||||
|
||||
if ( (LA9_0=='\r') ) {
|
||||
alt9=1;
|
||||
}
|
||||
switch (alt9) {
|
||||
case 1 :
|
||||
// InternalTestLanguage.g:378:41: '\\r'
|
||||
{
|
||||
match('\r');
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
match('\n');
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_SL_COMMENT"
|
||||
|
||||
// $ANTLR start "RULE_WS"
|
||||
public final void mRULE_WS() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_WS;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalTestLanguage.g:380:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ )
|
||||
// InternalTestLanguage.g:380:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
|
||||
{
|
||||
// InternalTestLanguage.g:380:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
|
||||
int cnt11=0;
|
||||
loop11:
|
||||
do {
|
||||
int alt11=2;
|
||||
int LA11_0 = input.LA(1);
|
||||
|
||||
if ( ((LA11_0>='\t' && LA11_0<='\n')||LA11_0=='\r'||LA11_0==' ') ) {
|
||||
alt11=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt11) {
|
||||
case 1 :
|
||||
// InternalTestLanguage.g:
|
||||
{
|
||||
if ( (input.LA(1)>='\t' && input.LA(1)<='\n')||input.LA(1)=='\r'||input.LA(1)==' ' ) {
|
||||
input.consume();
|
||||
|
||||
}
|
||||
else {
|
||||
MismatchedSetException mse = new MismatchedSetException(null,input);
|
||||
recover(mse);
|
||||
throw mse;}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
if ( cnt11 >= 1 ) break loop11;
|
||||
EarlyExitException eee =
|
||||
new EarlyExitException(11, input);
|
||||
throw eee;
|
||||
}
|
||||
cnt11++;
|
||||
} while (true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_WS"
|
||||
|
||||
// $ANTLR start "RULE_ANY_OTHER"
|
||||
public final void mRULE_ANY_OTHER() throws RecognitionException {
|
||||
try {
|
||||
int _type = RULE_ANY_OTHER;
|
||||
int _channel = DEFAULT_TOKEN_CHANNEL;
|
||||
// InternalTestLanguage.g:382:16: ( . )
|
||||
// InternalTestLanguage.g:382:18: .
|
||||
{
|
||||
matchAny();
|
||||
|
||||
}
|
||||
|
||||
state.type = _type;
|
||||
state.channel = _channel;
|
||||
}
|
||||
finally {
|
||||
}
|
||||
}
|
||||
// $ANTLR end "RULE_ANY_OTHER"
|
||||
|
||||
public void mTokens() throws RecognitionException {
|
||||
// InternalTestLanguage.g:1:8: ( T__11 | T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | T__18 | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER )
|
||||
int alt12=15;
|
||||
alt12 = dfa12.predict(input);
|
||||
switch (alt12) {
|
||||
case 1 :
|
||||
// InternalTestLanguage.g:1:10: T__11
|
||||
{
|
||||
mT__11();
|
||||
|
||||
}
|
||||
break;
|
||||
case 2 :
|
||||
// InternalTestLanguage.g:1:16: T__12
|
||||
{
|
||||
mT__12();
|
||||
|
||||
}
|
||||
break;
|
||||
case 3 :
|
||||
// InternalTestLanguage.g:1:22: T__13
|
||||
{
|
||||
mT__13();
|
||||
|
||||
}
|
||||
break;
|
||||
case 4 :
|
||||
// InternalTestLanguage.g:1:28: T__14
|
||||
{
|
||||
mT__14();
|
||||
|
||||
}
|
||||
break;
|
||||
case 5 :
|
||||
// InternalTestLanguage.g:1:34: T__15
|
||||
{
|
||||
mT__15();
|
||||
|
||||
}
|
||||
break;
|
||||
case 6 :
|
||||
// InternalTestLanguage.g:1:40: T__16
|
||||
{
|
||||
mT__16();
|
||||
|
||||
}
|
||||
break;
|
||||
case 7 :
|
||||
// InternalTestLanguage.g:1:46: T__17
|
||||
{
|
||||
mT__17();
|
||||
|
||||
}
|
||||
break;
|
||||
case 8 :
|
||||
// InternalTestLanguage.g:1:52: T__18
|
||||
{
|
||||
mT__18();
|
||||
|
||||
}
|
||||
break;
|
||||
case 9 :
|
||||
// InternalTestLanguage.g:1:58: RULE_ID
|
||||
{
|
||||
mRULE_ID();
|
||||
|
||||
}
|
||||
break;
|
||||
case 10 :
|
||||
// InternalTestLanguage.g:1:66: RULE_INT
|
||||
{
|
||||
mRULE_INT();
|
||||
|
||||
}
|
||||
break;
|
||||
case 11 :
|
||||
// InternalTestLanguage.g:1:75: RULE_STRING
|
||||
{
|
||||
mRULE_STRING();
|
||||
|
||||
}
|
||||
break;
|
||||
case 12 :
|
||||
// InternalTestLanguage.g:1:87: RULE_ML_COMMENT
|
||||
{
|
||||
mRULE_ML_COMMENT();
|
||||
|
||||
}
|
||||
break;
|
||||
case 13 :
|
||||
// InternalTestLanguage.g:1:103: RULE_SL_COMMENT
|
||||
{
|
||||
mRULE_SL_COMMENT();
|
||||
|
||||
}
|
||||
break;
|
||||
case 14 :
|
||||
// InternalTestLanguage.g:1:119: RULE_WS
|
||||
{
|
||||
mRULE_WS();
|
||||
|
||||
}
|
||||
break;
|
||||
case 15 :
|
||||
// InternalTestLanguage.g:1:127: RULE_ANY_OTHER
|
||||
{
|
||||
mRULE_ANY_OTHER();
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected DFA12 dfa12 = new DFA12(this);
|
||||
static final String DFA12_eotS =
|
||||
"\1\uffff\1\22\4\uffff\3\22\1\20\2\uffff\3\20\2\uffff\1\22\5\uffff\3\22\5\uffff\2\22\1\45\1\22\1\47\1\22\1\uffff\1\22\1\uffff\2\22\1\54\1\22\1\uffff\1\56\1\uffff";
|
||||
static final String DFA12_eofS =
|
||||
"\57\uffff";
|
||||
static final String DFA12_minS =
|
||||
"\1\0\1\171\4\uffff\1\164\1\156\1\157\1\101\2\uffff\2\0\1\52\2\uffff\1\160\5\uffff\1\162\1\164\1\157\5\uffff\1\145\1\151\1\60\1\154\1\60\1\156\1\uffff\1\145\1\uffff\1\147\1\141\1\60\1\156\1\uffff\1\60\1\uffff";
|
||||
static final String DFA12_maxS =
|
||||
"\1\uffff\1\171\4\uffff\1\164\1\156\1\157\1\172\2\uffff\2\uffff\1\57\2\uffff\1\160\5\uffff\1\162\1\164\1\157\5\uffff\1\145\1\151\1\172\1\154\1\172\1\156\1\uffff\1\145\1\uffff\1\147\1\141\1\172\1\156\1\uffff\1\172\1\uffff";
|
||||
static final String DFA12_acceptS =
|
||||
"\2\uffff\1\2\1\3\1\4\1\5\4\uffff\1\11\1\12\3\uffff\1\16\1\17\1\uffff\1\11\1\2\1\3\1\4\1\5\3\uffff\1\12\1\13\1\14\1\15\1\16\6\uffff\1\7\1\uffff\1\1\4\uffff\1\6\1\uffff\1\10";
|
||||
static final String DFA12_specialS =
|
||||
"\1\0\13\uffff\1\1\1\2\41\uffff}>";
|
||||
static final String[] DFA12_transitionS = {
|
||||
"\11\20\2\17\2\20\1\17\22\20\1\17\1\20\1\14\4\20\1\15\7\20\1\16\12\13\7\20\32\12\1\4\1\20\1\5\1\11\1\12\1\20\1\12\1\10\6\12\1\7\11\12\1\6\1\1\6\12\1\2\1\20\1\3\uff82\20",
|
||||
"\1\21",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"\1\27",
|
||||
"\1\30",
|
||||
"\1\31",
|
||||
"\32\22\4\uffff\1\22\1\uffff\32\22",
|
||||
"",
|
||||
"",
|
||||
"\0\33",
|
||||
"\0\33",
|
||||
"\1\34\4\uffff\1\35",
|
||||
"",
|
||||
"",
|
||||
"\1\37",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"\1\40",
|
||||
"\1\41",
|
||||
"\1\42",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"\1\43",
|
||||
"\1\44",
|
||||
"\12\22\7\uffff\32\22\4\uffff\1\22\1\uffff\32\22",
|
||||
"\1\46",
|
||||
"\12\22\7\uffff\32\22\4\uffff\1\22\1\uffff\32\22",
|
||||
"\1\50",
|
||||
"",
|
||||
"\1\51",
|
||||
"",
|
||||
"\1\52",
|
||||
"\1\53",
|
||||
"\12\22\7\uffff\32\22\4\uffff\1\22\1\uffff\32\22",
|
||||
"\1\55",
|
||||
"",
|
||||
"\12\22\7\uffff\32\22\4\uffff\1\22\1\uffff\32\22",
|
||||
""
|
||||
};
|
||||
|
||||
static final short[] DFA12_eot = DFA.unpackEncodedString(DFA12_eotS);
|
||||
static final short[] DFA12_eof = DFA.unpackEncodedString(DFA12_eofS);
|
||||
static final char[] DFA12_min = DFA.unpackEncodedStringToUnsignedChars(DFA12_minS);
|
||||
static final char[] DFA12_max = DFA.unpackEncodedStringToUnsignedChars(DFA12_maxS);
|
||||
static final short[] DFA12_accept = DFA.unpackEncodedString(DFA12_acceptS);
|
||||
static final short[] DFA12_special = DFA.unpackEncodedString(DFA12_specialS);
|
||||
static final short[][] DFA12_transition;
|
||||
|
||||
static {
|
||||
int numStates = DFA12_transitionS.length;
|
||||
DFA12_transition = new short[numStates][];
|
||||
for (int i=0; i<numStates; i++) {
|
||||
DFA12_transition[i] = DFA.unpackEncodedString(DFA12_transitionS[i]);
|
||||
}
|
||||
}
|
||||
|
||||
class DFA12 extends DFA {
|
||||
|
||||
public DFA12(BaseRecognizer recognizer) {
|
||||
this.recognizer = recognizer;
|
||||
this.decisionNumber = 12;
|
||||
this.eot = DFA12_eot;
|
||||
this.eof = DFA12_eof;
|
||||
this.min = DFA12_min;
|
||||
this.max = DFA12_max;
|
||||
this.accept = DFA12_accept;
|
||||
this.special = DFA12_special;
|
||||
this.transition = DFA12_transition;
|
||||
}
|
||||
public String getDescription() {
|
||||
return "1:1: Tokens : ( T__11 | T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | T__18 | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER );";
|
||||
}
|
||||
public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
|
||||
IntStream input = _input;
|
||||
int _s = s;
|
||||
switch ( s ) {
|
||||
case 0 :
|
||||
int LA12_0 = input.LA(1);
|
||||
|
||||
s = -1;
|
||||
if ( (LA12_0=='t') ) {s = 1;}
|
||||
|
||||
else if ( (LA12_0=='{') ) {s = 2;}
|
||||
|
||||
else if ( (LA12_0=='}') ) {s = 3;}
|
||||
|
||||
else if ( (LA12_0=='[') ) {s = 4;}
|
||||
|
||||
else if ( (LA12_0==']') ) {s = 5;}
|
||||
|
||||
else if ( (LA12_0=='s') ) {s = 6;}
|
||||
|
||||
else if ( (LA12_0=='i') ) {s = 7;}
|
||||
|
||||
else if ( (LA12_0=='b') ) {s = 8;}
|
||||
|
||||
else if ( (LA12_0=='^') ) {s = 9;}
|
||||
|
||||
else if ( ((LA12_0>='A' && LA12_0<='Z')||LA12_0=='_'||LA12_0=='a'||(LA12_0>='c' && LA12_0<='h')||(LA12_0>='j' && LA12_0<='r')||(LA12_0>='u' && LA12_0<='z')) ) {s = 10;}
|
||||
|
||||
else if ( ((LA12_0>='0' && LA12_0<='9')) ) {s = 11;}
|
||||
|
||||
else if ( (LA12_0=='\"') ) {s = 12;}
|
||||
|
||||
else if ( (LA12_0=='\'') ) {s = 13;}
|
||||
|
||||
else if ( (LA12_0=='/') ) {s = 14;}
|
||||
|
||||
else if ( ((LA12_0>='\t' && LA12_0<='\n')||LA12_0=='\r'||LA12_0==' ') ) {s = 15;}
|
||||
|
||||
else if ( ((LA12_0>='\u0000' && LA12_0<='\b')||(LA12_0>='\u000B' && LA12_0<='\f')||(LA12_0>='\u000E' && LA12_0<='\u001F')||LA12_0=='!'||(LA12_0>='#' && LA12_0<='&')||(LA12_0>='(' && LA12_0<='.')||(LA12_0>=':' && LA12_0<='@')||LA12_0=='\\'||LA12_0=='`'||LA12_0=='|'||(LA12_0>='~' && LA12_0<='\uFFFF')) ) {s = 16;}
|
||||
|
||||
if ( s>=0 ) return s;
|
||||
break;
|
||||
case 1 :
|
||||
int LA12_12 = input.LA(1);
|
||||
|
||||
s = -1;
|
||||
if ( ((LA12_12>='\u0000' && LA12_12<='\uFFFF')) ) {s = 27;}
|
||||
|
||||
else s = 16;
|
||||
|
||||
if ( s>=0 ) return s;
|
||||
break;
|
||||
case 2 :
|
||||
int LA12_13 = input.LA(1);
|
||||
|
||||
s = -1;
|
||||
if ( ((LA12_13>='\u0000' && LA12_13<='\uFFFF')) ) {s = 27;}
|
||||
|
||||
else s = 16;
|
||||
|
||||
if ( s>=0 ) return s;
|
||||
break;
|
||||
}
|
||||
NoViableAltException nvae =
|
||||
new NoViableAltException(getDescription(), 12, _s, input);
|
||||
error(nvae);
|
||||
throw nvae;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,952 @@
|
|||
package org.eclipse.xtext.ide.tests.testlanguage.parser.antlr.internal;
|
||||
|
||||
import org.eclipse.xtext.*;
|
||||
import org.eclipse.xtext.parser.*;
|
||||
import org.eclipse.xtext.parser.impl.*;
|
||||
import org.eclipse.emf.ecore.util.EcoreUtil;
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser;
|
||||
import org.eclipse.xtext.parser.antlr.XtextTokenStream;
|
||||
import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens;
|
||||
import org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.services.TestLanguageGrammarAccess;
|
||||
|
||||
|
||||
|
||||
import org.antlr.runtime.*;
|
||||
import java.util.Stack;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public class InternalTestLanguageParser extends AbstractInternalAntlrParser {
|
||||
public static final String[] tokenNames = new String[] {
|
||||
"<invalid>", "<EOR>", "<DOWN>", "<UP>", "RULE_ID", "RULE_INT", "RULE_STRING", "RULE_ML_COMMENT", "RULE_SL_COMMENT", "RULE_WS", "RULE_ANY_OTHER", "'type'", "'{'", "'}'", "'['", "']'", "'string'", "'int'", "'boolean'"
|
||||
};
|
||||
public static final int RULE_ID=4;
|
||||
public static final int RULE_STRING=6;
|
||||
public static final int T__16=16;
|
||||
public static final int T__15=15;
|
||||
public static final int T__18=18;
|
||||
public static final int T__17=17;
|
||||
public static final int T__12=12;
|
||||
public static final int T__11=11;
|
||||
public static final int T__14=14;
|
||||
public static final int T__13=13;
|
||||
public static final int RULE_ANY_OTHER=10;
|
||||
public static final int RULE_INT=5;
|
||||
public static final int RULE_WS=9;
|
||||
public static final int RULE_SL_COMMENT=8;
|
||||
public static final int EOF=-1;
|
||||
public static final int RULE_ML_COMMENT=7;
|
||||
|
||||
// delegates
|
||||
// delegators
|
||||
|
||||
|
||||
public InternalTestLanguageParser(TokenStream input) {
|
||||
this(input, new RecognizerSharedState());
|
||||
}
|
||||
public InternalTestLanguageParser(TokenStream input, RecognizerSharedState state) {
|
||||
super(input, state);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public String[] getTokenNames() { return InternalTestLanguageParser.tokenNames; }
|
||||
public String getGrammarFileName() { return "InternalTestLanguage.g"; }
|
||||
|
||||
|
||||
|
||||
private TestLanguageGrammarAccess grammarAccess;
|
||||
|
||||
public InternalTestLanguageParser(TokenStream input, TestLanguageGrammarAccess grammarAccess) {
|
||||
this(input);
|
||||
this.grammarAccess = grammarAccess;
|
||||
registerRules(grammarAccess.getGrammar());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getFirstRuleName() {
|
||||
return "Model";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TestLanguageGrammarAccess getGrammarAccess() {
|
||||
return grammarAccess;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// $ANTLR start "entryRuleModel"
|
||||
// InternalTestLanguage.g:68:1: entryRuleModel returns [EObject current=null] : iv_ruleModel= ruleModel EOF ;
|
||||
public final EObject entryRuleModel() throws RecognitionException {
|
||||
EObject current = null;
|
||||
|
||||
EObject iv_ruleModel = null;
|
||||
|
||||
|
||||
try {
|
||||
// InternalTestLanguage.g:68:46: (iv_ruleModel= ruleModel EOF )
|
||||
// InternalTestLanguage.g:69:2: iv_ruleModel= ruleModel EOF
|
||||
{
|
||||
newCompositeNode(grammarAccess.getModelRule());
|
||||
pushFollow(FOLLOW_1);
|
||||
iv_ruleModel=ruleModel();
|
||||
|
||||
state._fsp--;
|
||||
|
||||
current =iv_ruleModel;
|
||||
match(input,EOF,FOLLOW_2);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
finally {
|
||||
}
|
||||
return current;
|
||||
}
|
||||
// $ANTLR end "entryRuleModel"
|
||||
|
||||
|
||||
// $ANTLR start "ruleModel"
|
||||
// InternalTestLanguage.g:75:1: ruleModel returns [EObject current=null] : ( (lv_types_0_0= ruleTypeDeclaration ) )* ;
|
||||
public final EObject ruleModel() throws RecognitionException {
|
||||
EObject current = null;
|
||||
|
||||
EObject lv_types_0_0 = null;
|
||||
|
||||
|
||||
|
||||
enterRule();
|
||||
|
||||
try {
|
||||
// InternalTestLanguage.g:81:2: ( ( (lv_types_0_0= ruleTypeDeclaration ) )* )
|
||||
// InternalTestLanguage.g:82:2: ( (lv_types_0_0= ruleTypeDeclaration ) )*
|
||||
{
|
||||
// InternalTestLanguage.g:82:2: ( (lv_types_0_0= ruleTypeDeclaration ) )*
|
||||
loop1:
|
||||
do {
|
||||
int alt1=2;
|
||||
int LA1_0 = input.LA(1);
|
||||
|
||||
if ( (LA1_0==11) ) {
|
||||
alt1=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt1) {
|
||||
case 1 :
|
||||
// InternalTestLanguage.g:83:3: (lv_types_0_0= ruleTypeDeclaration )
|
||||
{
|
||||
// InternalTestLanguage.g:83:3: (lv_types_0_0= ruleTypeDeclaration )
|
||||
// InternalTestLanguage.g:84:4: lv_types_0_0= ruleTypeDeclaration
|
||||
{
|
||||
|
||||
newCompositeNode(grammarAccess.getModelAccess().getTypesTypeDeclarationParserRuleCall_0());
|
||||
|
||||
pushFollow(FOLLOW_3);
|
||||
lv_types_0_0=ruleTypeDeclaration();
|
||||
|
||||
state._fsp--;
|
||||
|
||||
|
||||
if (current==null) {
|
||||
current = createModelElementForParent(grammarAccess.getModelRule());
|
||||
}
|
||||
add(
|
||||
current,
|
||||
"types",
|
||||
lv_types_0_0,
|
||||
"org.eclipse.xtext.ide.tests.testlanguage.TestLanguage.TypeDeclaration");
|
||||
afterParserOrEnumRuleCall();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop1;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
leaveRule();
|
||||
|
||||
}
|
||||
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
finally {
|
||||
}
|
||||
return current;
|
||||
}
|
||||
// $ANTLR end "ruleModel"
|
||||
|
||||
|
||||
// $ANTLR start "entryRuleTypeDeclaration"
|
||||
// InternalTestLanguage.g:104:1: entryRuleTypeDeclaration returns [EObject current=null] : iv_ruleTypeDeclaration= ruleTypeDeclaration EOF ;
|
||||
public final EObject entryRuleTypeDeclaration() throws RecognitionException {
|
||||
EObject current = null;
|
||||
|
||||
EObject iv_ruleTypeDeclaration = null;
|
||||
|
||||
|
||||
try {
|
||||
// InternalTestLanguage.g:104:56: (iv_ruleTypeDeclaration= ruleTypeDeclaration EOF )
|
||||
// InternalTestLanguage.g:105:2: iv_ruleTypeDeclaration= ruleTypeDeclaration EOF
|
||||
{
|
||||
newCompositeNode(grammarAccess.getTypeDeclarationRule());
|
||||
pushFollow(FOLLOW_1);
|
||||
iv_ruleTypeDeclaration=ruleTypeDeclaration();
|
||||
|
||||
state._fsp--;
|
||||
|
||||
current =iv_ruleTypeDeclaration;
|
||||
match(input,EOF,FOLLOW_2);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
finally {
|
||||
}
|
||||
return current;
|
||||
}
|
||||
// $ANTLR end "entryRuleTypeDeclaration"
|
||||
|
||||
|
||||
// $ANTLR start "ruleTypeDeclaration"
|
||||
// InternalTestLanguage.g:111:1: ruleTypeDeclaration returns [EObject current=null] : (otherlv_0= 'type' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '{' ( (lv_properties_3_0= ruleProperty ) )* otherlv_4= '}' ) ;
|
||||
public final EObject ruleTypeDeclaration() throws RecognitionException {
|
||||
EObject current = null;
|
||||
|
||||
Token otherlv_0=null;
|
||||
Token lv_name_1_0=null;
|
||||
Token otherlv_2=null;
|
||||
Token otherlv_4=null;
|
||||
EObject lv_properties_3_0 = null;
|
||||
|
||||
|
||||
|
||||
enterRule();
|
||||
|
||||
try {
|
||||
// InternalTestLanguage.g:117:2: ( (otherlv_0= 'type' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '{' ( (lv_properties_3_0= ruleProperty ) )* otherlv_4= '}' ) )
|
||||
// InternalTestLanguage.g:118:2: (otherlv_0= 'type' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '{' ( (lv_properties_3_0= ruleProperty ) )* otherlv_4= '}' )
|
||||
{
|
||||
// InternalTestLanguage.g:118:2: (otherlv_0= 'type' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '{' ( (lv_properties_3_0= ruleProperty ) )* otherlv_4= '}' )
|
||||
// InternalTestLanguage.g:119:3: otherlv_0= 'type' ( (lv_name_1_0= RULE_ID ) ) otherlv_2= '{' ( (lv_properties_3_0= ruleProperty ) )* otherlv_4= '}'
|
||||
{
|
||||
otherlv_0=(Token)match(input,11,FOLLOW_4);
|
||||
|
||||
newLeafNode(otherlv_0, grammarAccess.getTypeDeclarationAccess().getTypeKeyword_0());
|
||||
|
||||
// InternalTestLanguage.g:123:3: ( (lv_name_1_0= RULE_ID ) )
|
||||
// InternalTestLanguage.g:124:4: (lv_name_1_0= RULE_ID )
|
||||
{
|
||||
// InternalTestLanguage.g:124:4: (lv_name_1_0= RULE_ID )
|
||||
// InternalTestLanguage.g:125:5: lv_name_1_0= RULE_ID
|
||||
{
|
||||
lv_name_1_0=(Token)match(input,RULE_ID,FOLLOW_5);
|
||||
|
||||
newLeafNode(lv_name_1_0, grammarAccess.getTypeDeclarationAccess().getNameIDTerminalRuleCall_1_0());
|
||||
|
||||
|
||||
if (current==null) {
|
||||
current = createModelElement(grammarAccess.getTypeDeclarationRule());
|
||||
}
|
||||
setWithLastConsumed(
|
||||
current,
|
||||
"name",
|
||||
lv_name_1_0,
|
||||
"org.eclipse.xtext.common.Terminals.ID");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
otherlv_2=(Token)match(input,12,FOLLOW_6);
|
||||
|
||||
newLeafNode(otherlv_2, grammarAccess.getTypeDeclarationAccess().getLeftCurlyBracketKeyword_2());
|
||||
|
||||
// InternalTestLanguage.g:145:3: ( (lv_properties_3_0= ruleProperty ) )*
|
||||
loop2:
|
||||
do {
|
||||
int alt2=2;
|
||||
int LA2_0 = input.LA(1);
|
||||
|
||||
if ( (LA2_0==RULE_ID) ) {
|
||||
alt2=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt2) {
|
||||
case 1 :
|
||||
// InternalTestLanguage.g:146:4: (lv_properties_3_0= ruleProperty )
|
||||
{
|
||||
// InternalTestLanguage.g:146:4: (lv_properties_3_0= ruleProperty )
|
||||
// InternalTestLanguage.g:147:5: lv_properties_3_0= ruleProperty
|
||||
{
|
||||
|
||||
newCompositeNode(grammarAccess.getTypeDeclarationAccess().getPropertiesPropertyParserRuleCall_3_0());
|
||||
|
||||
pushFollow(FOLLOW_6);
|
||||
lv_properties_3_0=ruleProperty();
|
||||
|
||||
state._fsp--;
|
||||
|
||||
|
||||
if (current==null) {
|
||||
current = createModelElementForParent(grammarAccess.getTypeDeclarationRule());
|
||||
}
|
||||
add(
|
||||
current,
|
||||
"properties",
|
||||
lv_properties_3_0,
|
||||
"org.eclipse.xtext.ide.tests.testlanguage.TestLanguage.Property");
|
||||
afterParserOrEnumRuleCall();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop2;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
otherlv_4=(Token)match(input,13,FOLLOW_2);
|
||||
|
||||
newLeafNode(otherlv_4, grammarAccess.getTypeDeclarationAccess().getRightCurlyBracketKeyword_4());
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
leaveRule();
|
||||
|
||||
}
|
||||
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
finally {
|
||||
}
|
||||
return current;
|
||||
}
|
||||
// $ANTLR end "ruleTypeDeclaration"
|
||||
|
||||
|
||||
// $ANTLR start "entryRuleProperty"
|
||||
// InternalTestLanguage.g:172:1: entryRuleProperty returns [EObject current=null] : iv_ruleProperty= ruleProperty EOF ;
|
||||
public final EObject entryRuleProperty() throws RecognitionException {
|
||||
EObject current = null;
|
||||
|
||||
EObject iv_ruleProperty = null;
|
||||
|
||||
|
||||
try {
|
||||
// InternalTestLanguage.g:172:49: (iv_ruleProperty= ruleProperty EOF )
|
||||
// InternalTestLanguage.g:173:2: iv_ruleProperty= ruleProperty EOF
|
||||
{
|
||||
newCompositeNode(grammarAccess.getPropertyRule());
|
||||
pushFollow(FOLLOW_1);
|
||||
iv_ruleProperty=ruleProperty();
|
||||
|
||||
state._fsp--;
|
||||
|
||||
current =iv_ruleProperty;
|
||||
match(input,EOF,FOLLOW_2);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
finally {
|
||||
}
|
||||
return current;
|
||||
}
|
||||
// $ANTLR end "entryRuleProperty"
|
||||
|
||||
|
||||
// $ANTLR start "ruleProperty"
|
||||
// InternalTestLanguage.g:179:1: ruleProperty returns [EObject current=null] : ( ( (lv_name_0_0= RULE_ID ) ) ( (lv_type_1_0= ruleType ) ) ) ;
|
||||
public final EObject ruleProperty() throws RecognitionException {
|
||||
EObject current = null;
|
||||
|
||||
Token lv_name_0_0=null;
|
||||
EObject lv_type_1_0 = null;
|
||||
|
||||
|
||||
|
||||
enterRule();
|
||||
|
||||
try {
|
||||
// InternalTestLanguage.g:185:2: ( ( ( (lv_name_0_0= RULE_ID ) ) ( (lv_type_1_0= ruleType ) ) ) )
|
||||
// InternalTestLanguage.g:186:2: ( ( (lv_name_0_0= RULE_ID ) ) ( (lv_type_1_0= ruleType ) ) )
|
||||
{
|
||||
// InternalTestLanguage.g:186:2: ( ( (lv_name_0_0= RULE_ID ) ) ( (lv_type_1_0= ruleType ) ) )
|
||||
// InternalTestLanguage.g:187:3: ( (lv_name_0_0= RULE_ID ) ) ( (lv_type_1_0= ruleType ) )
|
||||
{
|
||||
// InternalTestLanguage.g:187:3: ( (lv_name_0_0= RULE_ID ) )
|
||||
// InternalTestLanguage.g:188:4: (lv_name_0_0= RULE_ID )
|
||||
{
|
||||
// InternalTestLanguage.g:188:4: (lv_name_0_0= RULE_ID )
|
||||
// InternalTestLanguage.g:189:5: lv_name_0_0= RULE_ID
|
||||
{
|
||||
lv_name_0_0=(Token)match(input,RULE_ID,FOLLOW_7);
|
||||
|
||||
newLeafNode(lv_name_0_0, grammarAccess.getPropertyAccess().getNameIDTerminalRuleCall_0_0());
|
||||
|
||||
|
||||
if (current==null) {
|
||||
current = createModelElement(grammarAccess.getPropertyRule());
|
||||
}
|
||||
setWithLastConsumed(
|
||||
current,
|
||||
"name",
|
||||
lv_name_0_0,
|
||||
"org.eclipse.xtext.common.Terminals.ID");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// InternalTestLanguage.g:205:3: ( (lv_type_1_0= ruleType ) )
|
||||
// InternalTestLanguage.g:206:4: (lv_type_1_0= ruleType )
|
||||
{
|
||||
// InternalTestLanguage.g:206:4: (lv_type_1_0= ruleType )
|
||||
// InternalTestLanguage.g:207:5: lv_type_1_0= ruleType
|
||||
{
|
||||
|
||||
newCompositeNode(grammarAccess.getPropertyAccess().getTypeTypeParserRuleCall_1_0());
|
||||
|
||||
pushFollow(FOLLOW_2);
|
||||
lv_type_1_0=ruleType();
|
||||
|
||||
state._fsp--;
|
||||
|
||||
|
||||
if (current==null) {
|
||||
current = createModelElementForParent(grammarAccess.getPropertyRule());
|
||||
}
|
||||
set(
|
||||
current,
|
||||
"type",
|
||||
lv_type_1_0,
|
||||
"org.eclipse.xtext.ide.tests.testlanguage.TestLanguage.Type");
|
||||
afterParserOrEnumRuleCall();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
leaveRule();
|
||||
|
||||
}
|
||||
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
finally {
|
||||
}
|
||||
return current;
|
||||
}
|
||||
// $ANTLR end "ruleProperty"
|
||||
|
||||
|
||||
// $ANTLR start "entryRuleType"
|
||||
// InternalTestLanguage.g:228:1: entryRuleType returns [EObject current=null] : iv_ruleType= ruleType EOF ;
|
||||
public final EObject entryRuleType() throws RecognitionException {
|
||||
EObject current = null;
|
||||
|
||||
EObject iv_ruleType = null;
|
||||
|
||||
|
||||
try {
|
||||
// InternalTestLanguage.g:228:45: (iv_ruleType= ruleType EOF )
|
||||
// InternalTestLanguage.g:229:2: iv_ruleType= ruleType EOF
|
||||
{
|
||||
newCompositeNode(grammarAccess.getTypeRule());
|
||||
pushFollow(FOLLOW_1);
|
||||
iv_ruleType=ruleType();
|
||||
|
||||
state._fsp--;
|
||||
|
||||
current =iv_ruleType;
|
||||
match(input,EOF,FOLLOW_2);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
finally {
|
||||
}
|
||||
return current;
|
||||
}
|
||||
// $ANTLR end "entryRuleType"
|
||||
|
||||
|
||||
// $ANTLR start "ruleType"
|
||||
// InternalTestLanguage.g:235:1: ruleType returns [EObject current=null] : ( (this_TypeReference_0= ruleTypeReference | this_PrimitiveType_1= rulePrimitiveType ) ( ( (lv_arrayDiemensions_2_0= '[' ) ) otherlv_3= ']' )* ) ;
|
||||
public final EObject ruleType() throws RecognitionException {
|
||||
EObject current = null;
|
||||
|
||||
Token lv_arrayDiemensions_2_0=null;
|
||||
Token otherlv_3=null;
|
||||
EObject this_TypeReference_0 = null;
|
||||
|
||||
EObject this_PrimitiveType_1 = null;
|
||||
|
||||
|
||||
|
||||
enterRule();
|
||||
|
||||
try {
|
||||
// InternalTestLanguage.g:241:2: ( ( (this_TypeReference_0= ruleTypeReference | this_PrimitiveType_1= rulePrimitiveType ) ( ( (lv_arrayDiemensions_2_0= '[' ) ) otherlv_3= ']' )* ) )
|
||||
// InternalTestLanguage.g:242:2: ( (this_TypeReference_0= ruleTypeReference | this_PrimitiveType_1= rulePrimitiveType ) ( ( (lv_arrayDiemensions_2_0= '[' ) ) otherlv_3= ']' )* )
|
||||
{
|
||||
// InternalTestLanguage.g:242:2: ( (this_TypeReference_0= ruleTypeReference | this_PrimitiveType_1= rulePrimitiveType ) ( ( (lv_arrayDiemensions_2_0= '[' ) ) otherlv_3= ']' )* )
|
||||
// InternalTestLanguage.g:243:3: (this_TypeReference_0= ruleTypeReference | this_PrimitiveType_1= rulePrimitiveType ) ( ( (lv_arrayDiemensions_2_0= '[' ) ) otherlv_3= ']' )*
|
||||
{
|
||||
// InternalTestLanguage.g:243:3: (this_TypeReference_0= ruleTypeReference | this_PrimitiveType_1= rulePrimitiveType )
|
||||
int alt3=2;
|
||||
int LA3_0 = input.LA(1);
|
||||
|
||||
if ( (LA3_0==RULE_ID) ) {
|
||||
alt3=1;
|
||||
}
|
||||
else if ( ((LA3_0>=16 && LA3_0<=18)) ) {
|
||||
alt3=2;
|
||||
}
|
||||
else {
|
||||
NoViableAltException nvae =
|
||||
new NoViableAltException("", 3, 0, input);
|
||||
|
||||
throw nvae;
|
||||
}
|
||||
switch (alt3) {
|
||||
case 1 :
|
||||
// InternalTestLanguage.g:244:4: this_TypeReference_0= ruleTypeReference
|
||||
{
|
||||
|
||||
newCompositeNode(grammarAccess.getTypeAccess().getTypeReferenceParserRuleCall_0_0());
|
||||
|
||||
pushFollow(FOLLOW_8);
|
||||
this_TypeReference_0=ruleTypeReference();
|
||||
|
||||
state._fsp--;
|
||||
|
||||
|
||||
current = this_TypeReference_0;
|
||||
afterParserOrEnumRuleCall();
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
case 2 :
|
||||
// InternalTestLanguage.g:253:4: this_PrimitiveType_1= rulePrimitiveType
|
||||
{
|
||||
|
||||
newCompositeNode(grammarAccess.getTypeAccess().getPrimitiveTypeParserRuleCall_0_1());
|
||||
|
||||
pushFollow(FOLLOW_8);
|
||||
this_PrimitiveType_1=rulePrimitiveType();
|
||||
|
||||
state._fsp--;
|
||||
|
||||
|
||||
current = this_PrimitiveType_1;
|
||||
afterParserOrEnumRuleCall();
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
// InternalTestLanguage.g:262:3: ( ( (lv_arrayDiemensions_2_0= '[' ) ) otherlv_3= ']' )*
|
||||
loop4:
|
||||
do {
|
||||
int alt4=2;
|
||||
int LA4_0 = input.LA(1);
|
||||
|
||||
if ( (LA4_0==14) ) {
|
||||
alt4=1;
|
||||
}
|
||||
|
||||
|
||||
switch (alt4) {
|
||||
case 1 :
|
||||
// InternalTestLanguage.g:263:4: ( (lv_arrayDiemensions_2_0= '[' ) ) otherlv_3= ']'
|
||||
{
|
||||
// InternalTestLanguage.g:263:4: ( (lv_arrayDiemensions_2_0= '[' ) )
|
||||
// InternalTestLanguage.g:264:5: (lv_arrayDiemensions_2_0= '[' )
|
||||
{
|
||||
// InternalTestLanguage.g:264:5: (lv_arrayDiemensions_2_0= '[' )
|
||||
// InternalTestLanguage.g:265:6: lv_arrayDiemensions_2_0= '['
|
||||
{
|
||||
lv_arrayDiemensions_2_0=(Token)match(input,14,FOLLOW_9);
|
||||
|
||||
newLeafNode(lv_arrayDiemensions_2_0, grammarAccess.getTypeAccess().getArrayDiemensionsLeftSquareBracketKeyword_1_0_0());
|
||||
|
||||
|
||||
if (current==null) {
|
||||
current = createModelElement(grammarAccess.getTypeRule());
|
||||
}
|
||||
addWithLastConsumed(current, "arrayDiemensions", lv_arrayDiemensions_2_0, "[");
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
otherlv_3=(Token)match(input,15,FOLLOW_8);
|
||||
|
||||
newLeafNode(otherlv_3, grammarAccess.getTypeAccess().getRightSquareBracketKeyword_1_1());
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
break loop4;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
leaveRule();
|
||||
|
||||
}
|
||||
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
finally {
|
||||
}
|
||||
return current;
|
||||
}
|
||||
// $ANTLR end "ruleType"
|
||||
|
||||
|
||||
// $ANTLR start "entryRuleTypeReference"
|
||||
// InternalTestLanguage.g:286:1: entryRuleTypeReference returns [EObject current=null] : iv_ruleTypeReference= ruleTypeReference EOF ;
|
||||
public final EObject entryRuleTypeReference() throws RecognitionException {
|
||||
EObject current = null;
|
||||
|
||||
EObject iv_ruleTypeReference = null;
|
||||
|
||||
|
||||
try {
|
||||
// InternalTestLanguage.g:286:54: (iv_ruleTypeReference= ruleTypeReference EOF )
|
||||
// InternalTestLanguage.g:287:2: iv_ruleTypeReference= ruleTypeReference EOF
|
||||
{
|
||||
newCompositeNode(grammarAccess.getTypeReferenceRule());
|
||||
pushFollow(FOLLOW_1);
|
||||
iv_ruleTypeReference=ruleTypeReference();
|
||||
|
||||
state._fsp--;
|
||||
|
||||
current =iv_ruleTypeReference;
|
||||
match(input,EOF,FOLLOW_2);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
finally {
|
||||
}
|
||||
return current;
|
||||
}
|
||||
// $ANTLR end "entryRuleTypeReference"
|
||||
|
||||
|
||||
// $ANTLR start "ruleTypeReference"
|
||||
// InternalTestLanguage.g:293:1: ruleTypeReference returns [EObject current=null] : ( (otherlv_0= RULE_ID ) ) ;
|
||||
public final EObject ruleTypeReference() throws RecognitionException {
|
||||
EObject current = null;
|
||||
|
||||
Token otherlv_0=null;
|
||||
|
||||
|
||||
enterRule();
|
||||
|
||||
try {
|
||||
// InternalTestLanguage.g:299:2: ( ( (otherlv_0= RULE_ID ) ) )
|
||||
// InternalTestLanguage.g:300:2: ( (otherlv_0= RULE_ID ) )
|
||||
{
|
||||
// InternalTestLanguage.g:300:2: ( (otherlv_0= RULE_ID ) )
|
||||
// InternalTestLanguage.g:301:3: (otherlv_0= RULE_ID )
|
||||
{
|
||||
// InternalTestLanguage.g:301:3: (otherlv_0= RULE_ID )
|
||||
// InternalTestLanguage.g:302:4: otherlv_0= RULE_ID
|
||||
{
|
||||
|
||||
if (current==null) {
|
||||
current = createModelElement(grammarAccess.getTypeReferenceRule());
|
||||
}
|
||||
|
||||
otherlv_0=(Token)match(input,RULE_ID,FOLLOW_2);
|
||||
|
||||
newLeafNode(otherlv_0, grammarAccess.getTypeReferenceAccess().getTypeRefTypeCrossReference_0());
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
leaveRule();
|
||||
|
||||
}
|
||||
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
finally {
|
||||
}
|
||||
return current;
|
||||
}
|
||||
// $ANTLR end "ruleTypeReference"
|
||||
|
||||
|
||||
// $ANTLR start "entryRulePrimitiveType"
|
||||
// InternalTestLanguage.g:316:1: entryRulePrimitiveType returns [EObject current=null] : iv_rulePrimitiveType= rulePrimitiveType EOF ;
|
||||
public final EObject entryRulePrimitiveType() throws RecognitionException {
|
||||
EObject current = null;
|
||||
|
||||
EObject iv_rulePrimitiveType = null;
|
||||
|
||||
|
||||
try {
|
||||
// InternalTestLanguage.g:316:54: (iv_rulePrimitiveType= rulePrimitiveType EOF )
|
||||
// InternalTestLanguage.g:317:2: iv_rulePrimitiveType= rulePrimitiveType EOF
|
||||
{
|
||||
newCompositeNode(grammarAccess.getPrimitiveTypeRule());
|
||||
pushFollow(FOLLOW_1);
|
||||
iv_rulePrimitiveType=rulePrimitiveType();
|
||||
|
||||
state._fsp--;
|
||||
|
||||
current =iv_rulePrimitiveType;
|
||||
match(input,EOF,FOLLOW_2);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
finally {
|
||||
}
|
||||
return current;
|
||||
}
|
||||
// $ANTLR end "entryRulePrimitiveType"
|
||||
|
||||
|
||||
// $ANTLR start "rulePrimitiveType"
|
||||
// InternalTestLanguage.g:323:1: rulePrimitiveType returns [EObject current=null] : ( ( (lv_name_0_1= 'string' | lv_name_0_2= 'int' | lv_name_0_3= 'boolean' ) ) ) ;
|
||||
public final EObject rulePrimitiveType() throws RecognitionException {
|
||||
EObject current = null;
|
||||
|
||||
Token lv_name_0_1=null;
|
||||
Token lv_name_0_2=null;
|
||||
Token lv_name_0_3=null;
|
||||
|
||||
|
||||
enterRule();
|
||||
|
||||
try {
|
||||
// InternalTestLanguage.g:329:2: ( ( ( (lv_name_0_1= 'string' | lv_name_0_2= 'int' | lv_name_0_3= 'boolean' ) ) ) )
|
||||
// InternalTestLanguage.g:330:2: ( ( (lv_name_0_1= 'string' | lv_name_0_2= 'int' | lv_name_0_3= 'boolean' ) ) )
|
||||
{
|
||||
// InternalTestLanguage.g:330:2: ( ( (lv_name_0_1= 'string' | lv_name_0_2= 'int' | lv_name_0_3= 'boolean' ) ) )
|
||||
// InternalTestLanguage.g:331:3: ( (lv_name_0_1= 'string' | lv_name_0_2= 'int' | lv_name_0_3= 'boolean' ) )
|
||||
{
|
||||
// InternalTestLanguage.g:331:3: ( (lv_name_0_1= 'string' | lv_name_0_2= 'int' | lv_name_0_3= 'boolean' ) )
|
||||
// InternalTestLanguage.g:332:4: (lv_name_0_1= 'string' | lv_name_0_2= 'int' | lv_name_0_3= 'boolean' )
|
||||
{
|
||||
// InternalTestLanguage.g:332:4: (lv_name_0_1= 'string' | lv_name_0_2= 'int' | lv_name_0_3= 'boolean' )
|
||||
int alt5=3;
|
||||
switch ( input.LA(1) ) {
|
||||
case 16:
|
||||
{
|
||||
alt5=1;
|
||||
}
|
||||
break;
|
||||
case 17:
|
||||
{
|
||||
alt5=2;
|
||||
}
|
||||
break;
|
||||
case 18:
|
||||
{
|
||||
alt5=3;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
NoViableAltException nvae =
|
||||
new NoViableAltException("", 5, 0, input);
|
||||
|
||||
throw nvae;
|
||||
}
|
||||
|
||||
switch (alt5) {
|
||||
case 1 :
|
||||
// InternalTestLanguage.g:333:5: lv_name_0_1= 'string'
|
||||
{
|
||||
lv_name_0_1=(Token)match(input,16,FOLLOW_2);
|
||||
|
||||
newLeafNode(lv_name_0_1, grammarAccess.getPrimitiveTypeAccess().getNameStringKeyword_0_0());
|
||||
|
||||
|
||||
if (current==null) {
|
||||
current = createModelElement(grammarAccess.getPrimitiveTypeRule());
|
||||
}
|
||||
setWithLastConsumed(current, "name", lv_name_0_1, null);
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
case 2 :
|
||||
// InternalTestLanguage.g:344:5: lv_name_0_2= 'int'
|
||||
{
|
||||
lv_name_0_2=(Token)match(input,17,FOLLOW_2);
|
||||
|
||||
newLeafNode(lv_name_0_2, grammarAccess.getPrimitiveTypeAccess().getNameIntKeyword_0_1());
|
||||
|
||||
|
||||
if (current==null) {
|
||||
current = createModelElement(grammarAccess.getPrimitiveTypeRule());
|
||||
}
|
||||
setWithLastConsumed(current, "name", lv_name_0_2, null);
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
case 3 :
|
||||
// InternalTestLanguage.g:355:5: lv_name_0_3= 'boolean'
|
||||
{
|
||||
lv_name_0_3=(Token)match(input,18,FOLLOW_2);
|
||||
|
||||
newLeafNode(lv_name_0_3, grammarAccess.getPrimitiveTypeAccess().getNameBooleanKeyword_0_2());
|
||||
|
||||
|
||||
if (current==null) {
|
||||
current = createModelElement(grammarAccess.getPrimitiveTypeRule());
|
||||
}
|
||||
setWithLastConsumed(current, "name", lv_name_0_3, null);
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
leaveRule();
|
||||
|
||||
}
|
||||
|
||||
catch (RecognitionException re) {
|
||||
recover(input,re);
|
||||
appendSkippedTokens();
|
||||
}
|
||||
finally {
|
||||
}
|
||||
return current;
|
||||
}
|
||||
// $ANTLR end "rulePrimitiveType"
|
||||
|
||||
// Delegated rules
|
||||
|
||||
|
||||
|
||||
|
||||
public static final BitSet FOLLOW_1 = new BitSet(new long[]{0x0000000000000000L});
|
||||
public static final BitSet FOLLOW_2 = new BitSet(new long[]{0x0000000000000002L});
|
||||
public static final BitSet FOLLOW_3 = new BitSet(new long[]{0x0000000000000802L});
|
||||
public static final BitSet FOLLOW_4 = new BitSet(new long[]{0x0000000000000010L});
|
||||
public static final BitSet FOLLOW_5 = new BitSet(new long[]{0x0000000000001000L});
|
||||
public static final BitSet FOLLOW_6 = new BitSet(new long[]{0x0000000000002010L});
|
||||
public static final BitSet FOLLOW_7 = new BitSet(new long[]{0x0000000000070010L});
|
||||
public static final BitSet FOLLOW_8 = new BitSet(new long[]{0x0000000000004002L});
|
||||
public static final BitSet FOLLOW_9 = new BitSet(new long[]{0x0000000000008000L});
|
||||
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
/*
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.testlanguage.scoping;
|
||||
|
||||
import org.eclipse.xtext.scoping.impl.DelegatingScopeProvider;
|
||||
|
||||
public abstract class AbstractTestLanguageScopeProvider extends DelegatingScopeProvider {
|
||||
}
|
|
@ -0,0 +1,176 @@
|
|||
/*
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.testlanguage.serializer;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import java.util.Set;
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.emf.ecore.EPackage;
|
||||
import org.eclipse.xtext.Action;
|
||||
import org.eclipse.xtext.Parameter;
|
||||
import org.eclipse.xtext.ParserRule;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.services.TestLanguageGrammarAccess;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Model;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.testLanguage.PrimitiveType;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Property;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TestLanguagePackage;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TypeDeclaration;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TypeReference;
|
||||
import org.eclipse.xtext.serializer.ISerializationContext;
|
||||
import org.eclipse.xtext.serializer.acceptor.SequenceFeeder;
|
||||
import org.eclipse.xtext.serializer.sequencer.AbstractDelegatingSemanticSequencer;
|
||||
import org.eclipse.xtext.serializer.sequencer.ITransientValueService.ValueTransient;
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public class TestLanguageSemanticSequencer extends AbstractDelegatingSemanticSequencer {
|
||||
|
||||
@Inject
|
||||
private TestLanguageGrammarAccess grammarAccess;
|
||||
|
||||
@Override
|
||||
public void sequence(ISerializationContext context, EObject semanticObject) {
|
||||
EPackage epackage = semanticObject.eClass().getEPackage();
|
||||
ParserRule rule = context.getParserRule();
|
||||
Action action = context.getAssignedAction();
|
||||
Set<Parameter> parameters = context.getEnabledBooleanParameters();
|
||||
if (epackage == TestLanguagePackage.eINSTANCE)
|
||||
switch (semanticObject.eClass().getClassifierID()) {
|
||||
case TestLanguagePackage.MODEL:
|
||||
sequence_Model(context, (Model) semanticObject);
|
||||
return;
|
||||
case TestLanguagePackage.PRIMITIVE_TYPE:
|
||||
if (rule == grammarAccess.getPrimitiveTypeRule()) {
|
||||
sequence_PrimitiveType(context, (PrimitiveType) semanticObject);
|
||||
return;
|
||||
}
|
||||
else if (rule == grammarAccess.getTypeRule()) {
|
||||
sequence_PrimitiveType_Type(context, (PrimitiveType) semanticObject);
|
||||
return;
|
||||
}
|
||||
else break;
|
||||
case TestLanguagePackage.PROPERTY:
|
||||
sequence_Property(context, (Property) semanticObject);
|
||||
return;
|
||||
case TestLanguagePackage.TYPE_DECLARATION:
|
||||
sequence_TypeDeclaration(context, (TypeDeclaration) semanticObject);
|
||||
return;
|
||||
case TestLanguagePackage.TYPE_REFERENCE:
|
||||
if (rule == grammarAccess.getTypeReferenceRule()) {
|
||||
sequence_TypeReference(context, (TypeReference) semanticObject);
|
||||
return;
|
||||
}
|
||||
else if (rule == grammarAccess.getTypeRule()) {
|
||||
sequence_Type_TypeReference(context, (TypeReference) semanticObject);
|
||||
return;
|
||||
}
|
||||
else break;
|
||||
}
|
||||
if (errorAcceptor != null)
|
||||
errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
|
||||
}
|
||||
|
||||
/**
|
||||
* Contexts:
|
||||
* Model returns Model
|
||||
*
|
||||
* Constraint:
|
||||
* types+=TypeDeclaration+
|
||||
*/
|
||||
protected void sequence_Model(ISerializationContext context, Model semanticObject) {
|
||||
genericSequencer.createSequence(context, semanticObject);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Contexts:
|
||||
* PrimitiveType returns PrimitiveType
|
||||
*
|
||||
* Constraint:
|
||||
* (name='string' | name='int' | name='boolean')
|
||||
*/
|
||||
protected void sequence_PrimitiveType(ISerializationContext context, PrimitiveType semanticObject) {
|
||||
genericSequencer.createSequence(context, semanticObject);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Contexts:
|
||||
* Type returns PrimitiveType
|
||||
*
|
||||
* Constraint:
|
||||
* ((name='string' | name='int' | name='boolean') arrayDiemensions+='['*)
|
||||
*/
|
||||
protected void sequence_PrimitiveType_Type(ISerializationContext context, PrimitiveType semanticObject) {
|
||||
genericSequencer.createSequence(context, semanticObject);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Contexts:
|
||||
* Property returns Property
|
||||
*
|
||||
* Constraint:
|
||||
* (name=ID type=Type)
|
||||
*/
|
||||
protected void sequence_Property(ISerializationContext context, Property semanticObject) {
|
||||
if (errorAcceptor != null) {
|
||||
if (transientValues.isValueTransient(semanticObject, TestLanguagePackage.Literals.PROPERTY__NAME) == ValueTransient.YES)
|
||||
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, TestLanguagePackage.Literals.PROPERTY__NAME));
|
||||
if (transientValues.isValueTransient(semanticObject, TestLanguagePackage.Literals.PROPERTY__TYPE) == ValueTransient.YES)
|
||||
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, TestLanguagePackage.Literals.PROPERTY__TYPE));
|
||||
}
|
||||
SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
|
||||
feeder.accept(grammarAccess.getPropertyAccess().getNameIDTerminalRuleCall_0_0(), semanticObject.getName());
|
||||
feeder.accept(grammarAccess.getPropertyAccess().getTypeTypeParserRuleCall_1_0(), semanticObject.getType());
|
||||
feeder.finish();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Contexts:
|
||||
* TypeDeclaration returns TypeDeclaration
|
||||
*
|
||||
* Constraint:
|
||||
* (name=ID properties+=Property*)
|
||||
*/
|
||||
protected void sequence_TypeDeclaration(ISerializationContext context, TypeDeclaration semanticObject) {
|
||||
genericSequencer.createSequence(context, semanticObject);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Contexts:
|
||||
* TypeReference returns TypeReference
|
||||
*
|
||||
* Constraint:
|
||||
* typeRef=[Type|ID]
|
||||
*/
|
||||
protected void sequence_TypeReference(ISerializationContext context, TypeReference semanticObject) {
|
||||
if (errorAcceptor != null) {
|
||||
if (transientValues.isValueTransient(semanticObject, TestLanguagePackage.Literals.TYPE_REFERENCE__TYPE_REF) == ValueTransient.YES)
|
||||
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, TestLanguagePackage.Literals.TYPE_REFERENCE__TYPE_REF));
|
||||
}
|
||||
SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
|
||||
feeder.accept(grammarAccess.getTypeReferenceAccess().getTypeRefTypeIDTerminalRuleCall_0_1(), semanticObject.getTypeRef());
|
||||
feeder.finish();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Contexts:
|
||||
* Type returns TypeReference
|
||||
*
|
||||
* Constraint:
|
||||
* (typeRef=[Type|ID] arrayDiemensions+='['*)
|
||||
*/
|
||||
protected void sequence_Type_TypeReference(ISerializationContext context, TypeReference semanticObject) {
|
||||
genericSequencer.createSequence(context, semanticObject);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.testlanguage.serializer;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import java.util.List;
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.xtext.IGrammarAccess;
|
||||
import org.eclipse.xtext.RuleCall;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.services.TestLanguageGrammarAccess;
|
||||
import org.eclipse.xtext.nodemodel.INode;
|
||||
import org.eclipse.xtext.serializer.analysis.GrammarAlias.AbstractElementAlias;
|
||||
import org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynTransition;
|
||||
import org.eclipse.xtext.serializer.sequencer.AbstractSyntacticSequencer;
|
||||
|
||||
@SuppressWarnings("all")
|
||||
public class TestLanguageSyntacticSequencer extends AbstractSyntacticSequencer {
|
||||
|
||||
protected TestLanguageGrammarAccess grammarAccess;
|
||||
|
||||
@Inject
|
||||
protected void init(IGrammarAccess access) {
|
||||
grammarAccess = (TestLanguageGrammarAccess) access;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getUnassignedRuleCallToken(EObject semanticObject, RuleCall ruleCall, INode node) {
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void emitUnassignedTokens(EObject semanticObject, ISynTransition transition, INode fromNode, INode toNode) {
|
||||
if (transition.getAmbiguousSyntaxes().isEmpty()) return;
|
||||
List<INode> transitionNodes = collectNodes(fromNode, toNode);
|
||||
for (AbstractElementAlias syntax : transition.getAmbiguousSyntaxes()) {
|
||||
List<INode> syntaxNodes = getNodesFor(transitionNodes, syntax);
|
||||
acceptNodes(getLastNavigableState(), syntaxNodes);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,355 @@
|
|||
/*
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.testlanguage.services;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Singleton;
|
||||
import java.util.List;
|
||||
import org.eclipse.xtext.Alternatives;
|
||||
import org.eclipse.xtext.Assignment;
|
||||
import org.eclipse.xtext.CrossReference;
|
||||
import org.eclipse.xtext.Grammar;
|
||||
import org.eclipse.xtext.GrammarUtil;
|
||||
import org.eclipse.xtext.Group;
|
||||
import org.eclipse.xtext.Keyword;
|
||||
import org.eclipse.xtext.ParserRule;
|
||||
import org.eclipse.xtext.RuleCall;
|
||||
import org.eclipse.xtext.TerminalRule;
|
||||
import org.eclipse.xtext.common.services.TerminalsGrammarAccess;
|
||||
import org.eclipse.xtext.service.AbstractElementFinder.AbstractGrammarElementFinder;
|
||||
import org.eclipse.xtext.service.GrammarProvider;
|
||||
|
||||
@Singleton
|
||||
public class TestLanguageGrammarAccess extends AbstractGrammarElementFinder {
|
||||
|
||||
public class ModelElements extends AbstractParserRuleElementFinder {
|
||||
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.ide.tests.testlanguage.TestLanguage.Model");
|
||||
private final Assignment cTypesAssignment = (Assignment)rule.eContents().get(1);
|
||||
private final RuleCall cTypesTypeDeclarationParserRuleCall_0 = (RuleCall)cTypesAssignment.eContents().get(0);
|
||||
|
||||
//Model:
|
||||
// types+=TypeDeclaration*;
|
||||
@Override public ParserRule getRule() { return rule; }
|
||||
|
||||
//types+=TypeDeclaration*
|
||||
public Assignment getTypesAssignment() { return cTypesAssignment; }
|
||||
|
||||
//TypeDeclaration
|
||||
public RuleCall getTypesTypeDeclarationParserRuleCall_0() { return cTypesTypeDeclarationParserRuleCall_0; }
|
||||
}
|
||||
public class TypeDeclarationElements extends AbstractParserRuleElementFinder {
|
||||
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.ide.tests.testlanguage.TestLanguage.TypeDeclaration");
|
||||
private final Group cGroup = (Group)rule.eContents().get(1);
|
||||
private final Keyword cTypeKeyword_0 = (Keyword)cGroup.eContents().get(0);
|
||||
private final Assignment cNameAssignment_1 = (Assignment)cGroup.eContents().get(1);
|
||||
private final RuleCall cNameIDTerminalRuleCall_1_0 = (RuleCall)cNameAssignment_1.eContents().get(0);
|
||||
private final Keyword cLeftCurlyBracketKeyword_2 = (Keyword)cGroup.eContents().get(2);
|
||||
private final Assignment cPropertiesAssignment_3 = (Assignment)cGroup.eContents().get(3);
|
||||
private final RuleCall cPropertiesPropertyParserRuleCall_3_0 = (RuleCall)cPropertiesAssignment_3.eContents().get(0);
|
||||
private final Keyword cRightCurlyBracketKeyword_4 = (Keyword)cGroup.eContents().get(4);
|
||||
|
||||
//TypeDeclaration:
|
||||
// 'type' name=ID '{'
|
||||
// properties+=Property*
|
||||
// '}';
|
||||
@Override public ParserRule getRule() { return rule; }
|
||||
|
||||
//'type' name=ID '{' properties+=Property* '}'
|
||||
public Group getGroup() { return cGroup; }
|
||||
|
||||
//'type'
|
||||
public Keyword getTypeKeyword_0() { return cTypeKeyword_0; }
|
||||
|
||||
//name=ID
|
||||
public Assignment getNameAssignment_1() { return cNameAssignment_1; }
|
||||
|
||||
//ID
|
||||
public RuleCall getNameIDTerminalRuleCall_1_0() { return cNameIDTerminalRuleCall_1_0; }
|
||||
|
||||
//'{'
|
||||
public Keyword getLeftCurlyBracketKeyword_2() { return cLeftCurlyBracketKeyword_2; }
|
||||
|
||||
//properties+=Property*
|
||||
public Assignment getPropertiesAssignment_3() { return cPropertiesAssignment_3; }
|
||||
|
||||
//Property
|
||||
public RuleCall getPropertiesPropertyParserRuleCall_3_0() { return cPropertiesPropertyParserRuleCall_3_0; }
|
||||
|
||||
//'}'
|
||||
public Keyword getRightCurlyBracketKeyword_4() { return cRightCurlyBracketKeyword_4; }
|
||||
}
|
||||
public class PropertyElements extends AbstractParserRuleElementFinder {
|
||||
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.ide.tests.testlanguage.TestLanguage.Property");
|
||||
private final Group cGroup = (Group)rule.eContents().get(1);
|
||||
private final Assignment cNameAssignment_0 = (Assignment)cGroup.eContents().get(0);
|
||||
private final RuleCall cNameIDTerminalRuleCall_0_0 = (RuleCall)cNameAssignment_0.eContents().get(0);
|
||||
private final Assignment cTypeAssignment_1 = (Assignment)cGroup.eContents().get(1);
|
||||
private final RuleCall cTypeTypeParserRuleCall_1_0 = (RuleCall)cTypeAssignment_1.eContents().get(0);
|
||||
|
||||
//Property:
|
||||
// name=ID type=Type;
|
||||
@Override public ParserRule getRule() { return rule; }
|
||||
|
||||
//name=ID type=Type
|
||||
public Group getGroup() { return cGroup; }
|
||||
|
||||
//name=ID
|
||||
public Assignment getNameAssignment_0() { return cNameAssignment_0; }
|
||||
|
||||
//ID
|
||||
public RuleCall getNameIDTerminalRuleCall_0_0() { return cNameIDTerminalRuleCall_0_0; }
|
||||
|
||||
//type=Type
|
||||
public Assignment getTypeAssignment_1() { return cTypeAssignment_1; }
|
||||
|
||||
//Type
|
||||
public RuleCall getTypeTypeParserRuleCall_1_0() { return cTypeTypeParserRuleCall_1_0; }
|
||||
}
|
||||
public class TypeElements extends AbstractParserRuleElementFinder {
|
||||
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.ide.tests.testlanguage.TestLanguage.Type");
|
||||
private final Group cGroup = (Group)rule.eContents().get(1);
|
||||
private final Alternatives cAlternatives_0 = (Alternatives)cGroup.eContents().get(0);
|
||||
private final RuleCall cTypeReferenceParserRuleCall_0_0 = (RuleCall)cAlternatives_0.eContents().get(0);
|
||||
private final RuleCall cPrimitiveTypeParserRuleCall_0_1 = (RuleCall)cAlternatives_0.eContents().get(1);
|
||||
private final Group cGroup_1 = (Group)cGroup.eContents().get(1);
|
||||
private final Assignment cArrayDiemensionsAssignment_1_0 = (Assignment)cGroup_1.eContents().get(0);
|
||||
private final Keyword cArrayDiemensionsLeftSquareBracketKeyword_1_0_0 = (Keyword)cArrayDiemensionsAssignment_1_0.eContents().get(0);
|
||||
private final Keyword cRightSquareBracketKeyword_1_1 = (Keyword)cGroup_1.eContents().get(1);
|
||||
|
||||
//Type:
|
||||
// (TypeReference | PrimitiveType) (arrayDiemensions+='[' ']')*;
|
||||
@Override public ParserRule getRule() { return rule; }
|
||||
|
||||
//(TypeReference | PrimitiveType) (arrayDiemensions+='[' ']')*
|
||||
public Group getGroup() { return cGroup; }
|
||||
|
||||
//TypeReference | PrimitiveType
|
||||
public Alternatives getAlternatives_0() { return cAlternatives_0; }
|
||||
|
||||
//TypeReference
|
||||
public RuleCall getTypeReferenceParserRuleCall_0_0() { return cTypeReferenceParserRuleCall_0_0; }
|
||||
|
||||
//PrimitiveType
|
||||
public RuleCall getPrimitiveTypeParserRuleCall_0_1() { return cPrimitiveTypeParserRuleCall_0_1; }
|
||||
|
||||
//(arrayDiemensions+='[' ']')*
|
||||
public Group getGroup_1() { return cGroup_1; }
|
||||
|
||||
//arrayDiemensions+='['
|
||||
public Assignment getArrayDiemensionsAssignment_1_0() { return cArrayDiemensionsAssignment_1_0; }
|
||||
|
||||
//'['
|
||||
public Keyword getArrayDiemensionsLeftSquareBracketKeyword_1_0_0() { return cArrayDiemensionsLeftSquareBracketKeyword_1_0_0; }
|
||||
|
||||
//']'
|
||||
public Keyword getRightSquareBracketKeyword_1_1() { return cRightSquareBracketKeyword_1_1; }
|
||||
}
|
||||
public class TypeReferenceElements extends AbstractParserRuleElementFinder {
|
||||
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.ide.tests.testlanguage.TestLanguage.TypeReference");
|
||||
private final Assignment cTypeRefAssignment = (Assignment)rule.eContents().get(1);
|
||||
private final CrossReference cTypeRefTypeCrossReference_0 = (CrossReference)cTypeRefAssignment.eContents().get(0);
|
||||
private final RuleCall cTypeRefTypeIDTerminalRuleCall_0_1 = (RuleCall)cTypeRefTypeCrossReference_0.eContents().get(1);
|
||||
|
||||
//TypeReference:
|
||||
// typeRef=[Type];
|
||||
@Override public ParserRule getRule() { return rule; }
|
||||
|
||||
//typeRef=[Type]
|
||||
public Assignment getTypeRefAssignment() { return cTypeRefAssignment; }
|
||||
|
||||
//[Type]
|
||||
public CrossReference getTypeRefTypeCrossReference_0() { return cTypeRefTypeCrossReference_0; }
|
||||
|
||||
//ID
|
||||
public RuleCall getTypeRefTypeIDTerminalRuleCall_0_1() { return cTypeRefTypeIDTerminalRuleCall_0_1; }
|
||||
}
|
||||
public class PrimitiveTypeElements extends AbstractParserRuleElementFinder {
|
||||
private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "org.eclipse.xtext.ide.tests.testlanguage.TestLanguage.PrimitiveType");
|
||||
private final Assignment cNameAssignment = (Assignment)rule.eContents().get(1);
|
||||
private final Alternatives cNameAlternatives_0 = (Alternatives)cNameAssignment.eContents().get(0);
|
||||
private final Keyword cNameStringKeyword_0_0 = (Keyword)cNameAlternatives_0.eContents().get(0);
|
||||
private final Keyword cNameIntKeyword_0_1 = (Keyword)cNameAlternatives_0.eContents().get(1);
|
||||
private final Keyword cNameBooleanKeyword_0_2 = (Keyword)cNameAlternatives_0.eContents().get(2);
|
||||
|
||||
//PrimitiveType:
|
||||
// name=('string' | 'int' | 'boolean');
|
||||
@Override public ParserRule getRule() { return rule; }
|
||||
|
||||
//name=('string' | 'int' | 'boolean')
|
||||
public Assignment getNameAssignment() { return cNameAssignment; }
|
||||
|
||||
//('string' | 'int' | 'boolean')
|
||||
public Alternatives getNameAlternatives_0() { return cNameAlternatives_0; }
|
||||
|
||||
//'string'
|
||||
public Keyword getNameStringKeyword_0_0() { return cNameStringKeyword_0_0; }
|
||||
|
||||
//'int'
|
||||
public Keyword getNameIntKeyword_0_1() { return cNameIntKeyword_0_1; }
|
||||
|
||||
//'boolean'
|
||||
public Keyword getNameBooleanKeyword_0_2() { return cNameBooleanKeyword_0_2; }
|
||||
}
|
||||
|
||||
|
||||
private final ModelElements pModel;
|
||||
private final TypeDeclarationElements pTypeDeclaration;
|
||||
private final PropertyElements pProperty;
|
||||
private final TypeElements pType;
|
||||
private final TypeReferenceElements pTypeReference;
|
||||
private final PrimitiveTypeElements pPrimitiveType;
|
||||
|
||||
private final Grammar grammar;
|
||||
|
||||
private final TerminalsGrammarAccess gaTerminals;
|
||||
|
||||
@Inject
|
||||
public TestLanguageGrammarAccess(GrammarProvider grammarProvider,
|
||||
TerminalsGrammarAccess gaTerminals) {
|
||||
this.grammar = internalFindGrammar(grammarProvider);
|
||||
this.gaTerminals = gaTerminals;
|
||||
this.pModel = new ModelElements();
|
||||
this.pTypeDeclaration = new TypeDeclarationElements();
|
||||
this.pProperty = new PropertyElements();
|
||||
this.pType = new TypeElements();
|
||||
this.pTypeReference = new TypeReferenceElements();
|
||||
this.pPrimitiveType = new PrimitiveTypeElements();
|
||||
}
|
||||
|
||||
protected Grammar internalFindGrammar(GrammarProvider grammarProvider) {
|
||||
Grammar grammar = grammarProvider.getGrammar(this);
|
||||
while (grammar != null) {
|
||||
if ("org.eclipse.xtext.ide.tests.testlanguage.TestLanguage".equals(grammar.getName())) {
|
||||
return grammar;
|
||||
}
|
||||
List<Grammar> grammars = grammar.getUsedGrammars();
|
||||
if (!grammars.isEmpty()) {
|
||||
grammar = grammars.iterator().next();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return grammar;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Grammar getGrammar() {
|
||||
return grammar;
|
||||
}
|
||||
|
||||
|
||||
public TerminalsGrammarAccess getTerminalsGrammarAccess() {
|
||||
return gaTerminals;
|
||||
}
|
||||
|
||||
|
||||
//Model:
|
||||
// types+=TypeDeclaration*;
|
||||
public ModelElements getModelAccess() {
|
||||
return pModel;
|
||||
}
|
||||
|
||||
public ParserRule getModelRule() {
|
||||
return getModelAccess().getRule();
|
||||
}
|
||||
|
||||
//TypeDeclaration:
|
||||
// 'type' name=ID '{'
|
||||
// properties+=Property*
|
||||
// '}';
|
||||
public TypeDeclarationElements getTypeDeclarationAccess() {
|
||||
return pTypeDeclaration;
|
||||
}
|
||||
|
||||
public ParserRule getTypeDeclarationRule() {
|
||||
return getTypeDeclarationAccess().getRule();
|
||||
}
|
||||
|
||||
//Property:
|
||||
// name=ID type=Type;
|
||||
public PropertyElements getPropertyAccess() {
|
||||
return pProperty;
|
||||
}
|
||||
|
||||
public ParserRule getPropertyRule() {
|
||||
return getPropertyAccess().getRule();
|
||||
}
|
||||
|
||||
//Type:
|
||||
// (TypeReference | PrimitiveType) (arrayDiemensions+='[' ']')*;
|
||||
public TypeElements getTypeAccess() {
|
||||
return pType;
|
||||
}
|
||||
|
||||
public ParserRule getTypeRule() {
|
||||
return getTypeAccess().getRule();
|
||||
}
|
||||
|
||||
//TypeReference:
|
||||
// typeRef=[Type];
|
||||
public TypeReferenceElements getTypeReferenceAccess() {
|
||||
return pTypeReference;
|
||||
}
|
||||
|
||||
public ParserRule getTypeReferenceRule() {
|
||||
return getTypeReferenceAccess().getRule();
|
||||
}
|
||||
|
||||
//PrimitiveType:
|
||||
// name=('string' | 'int' | 'boolean');
|
||||
public PrimitiveTypeElements getPrimitiveTypeAccess() {
|
||||
return pPrimitiveType;
|
||||
}
|
||||
|
||||
public ParserRule getPrimitiveTypeRule() {
|
||||
return getPrimitiveTypeAccess().getRule();
|
||||
}
|
||||
|
||||
//terminal ID:
|
||||
// '^'? ('a'..'z' | 'A'..'Z' | '_') ('a'..'z' | 'A'..'Z' | '_' | '0'..'9')*;
|
||||
public TerminalRule getIDRule() {
|
||||
return gaTerminals.getIDRule();
|
||||
}
|
||||
|
||||
//terminal INT returns ecore::EInt:
|
||||
// '0'..'9'+;
|
||||
public TerminalRule getINTRule() {
|
||||
return gaTerminals.getINTRule();
|
||||
}
|
||||
|
||||
//terminal STRING:
|
||||
// '"' ('\\' . | !('\\' | '"'))* '"' |
|
||||
// "'" ('\\' . | !('\\' | "'"))* "'";
|
||||
public TerminalRule getSTRINGRule() {
|
||||
return gaTerminals.getSTRINGRule();
|
||||
}
|
||||
|
||||
//terminal ML_COMMENT:
|
||||
// '/ *'->'* /';
|
||||
public TerminalRule getML_COMMENTRule() {
|
||||
return gaTerminals.getML_COMMENTRule();
|
||||
}
|
||||
|
||||
//terminal SL_COMMENT:
|
||||
// '//' !('\n' | '\r')* ('\r'? '\n')?;
|
||||
public TerminalRule getSL_COMMENTRule() {
|
||||
return gaTerminals.getSL_COMMENTRule();
|
||||
}
|
||||
|
||||
//terminal WS:
|
||||
// ' ' | '\t' | '\r' | '\n'+;
|
||||
public TerminalRule getWSRule() {
|
||||
return gaTerminals.getWSRule();
|
||||
}
|
||||
|
||||
//terminal ANY_OTHER:
|
||||
// .;
|
||||
public TerminalRule getANY_OTHERRule() {
|
||||
return gaTerminals.getANY_OTHERRule();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
/**
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.testlanguage.testLanguage;
|
||||
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Model</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* <p>
|
||||
* The following features are supported:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Model#getTypes <em>Types</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TestLanguagePackage#getModel()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface Model extends EObject
|
||||
{
|
||||
/**
|
||||
* Returns the value of the '<em><b>Types</b></em>' containment reference list.
|
||||
* The list contents are of type {@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TypeDeclaration}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Types</em>' containment reference list isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Types</em>' containment reference list.
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TestLanguagePackage#getModel_Types()
|
||||
* @model containment="true"
|
||||
* @generated
|
||||
*/
|
||||
EList<TypeDeclaration> getTypes();
|
||||
|
||||
} // Model
|
|
@ -0,0 +1,55 @@
|
|||
/**
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.testlanguage.testLanguage;
|
||||
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Primitive Type</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* <p>
|
||||
* The following features are supported:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.PrimitiveType#getName <em>Name</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TestLanguagePackage#getPrimitiveType()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface PrimitiveType extends Type
|
||||
{
|
||||
/**
|
||||
* Returns the value of the '<em><b>Name</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Name</em>' attribute isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Name</em>' attribute.
|
||||
* @see #setName(String)
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TestLanguagePackage#getPrimitiveType_Name()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.PrimitiveType#getName <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Name</em>' attribute.
|
||||
* @see #getName()
|
||||
* @generated
|
||||
*/
|
||||
void setName(String value);
|
||||
|
||||
} // PrimitiveType
|
|
@ -0,0 +1,83 @@
|
|||
/**
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.testlanguage.testLanguage;
|
||||
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Property</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* <p>
|
||||
* The following features are supported:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Property#getName <em>Name</em>}</li>
|
||||
* <li>{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Property#getType <em>Type</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TestLanguagePackage#getProperty()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface Property extends EObject
|
||||
{
|
||||
/**
|
||||
* Returns the value of the '<em><b>Name</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Name</em>' attribute isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Name</em>' attribute.
|
||||
* @see #setName(String)
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TestLanguagePackage#getProperty_Name()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Property#getName <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Name</em>' attribute.
|
||||
* @see #getName()
|
||||
* @generated
|
||||
*/
|
||||
void setName(String value);
|
||||
|
||||
/**
|
||||
* Returns the value of the '<em><b>Type</b></em>' containment reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Type</em>' containment reference isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Type</em>' containment reference.
|
||||
* @see #setType(Type)
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TestLanguagePackage#getProperty_Type()
|
||||
* @model containment="true"
|
||||
* @generated
|
||||
*/
|
||||
Type getType();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Property#getType <em>Type</em>}' containment reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Type</em>' containment reference.
|
||||
* @see #getType()
|
||||
* @generated
|
||||
*/
|
||||
void setType(Type value);
|
||||
|
||||
} // Property
|
|
@ -0,0 +1,93 @@
|
|||
/**
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.testlanguage.testLanguage;
|
||||
|
||||
import org.eclipse.emf.ecore.EFactory;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* The <b>Factory</b> for the model.
|
||||
* It provides a create method for each non-abstract class of the model.
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TestLanguagePackage
|
||||
* @generated
|
||||
*/
|
||||
public interface TestLanguageFactory extends EFactory
|
||||
{
|
||||
/**
|
||||
* The singleton instance of the factory.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
TestLanguageFactory eINSTANCE = org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.TestLanguageFactoryImpl.init();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Model</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Model</em>'.
|
||||
* @generated
|
||||
*/
|
||||
Model createModel();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Type Declaration</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Type Declaration</em>'.
|
||||
* @generated
|
||||
*/
|
||||
TypeDeclaration createTypeDeclaration();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Property</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Property</em>'.
|
||||
* @generated
|
||||
*/
|
||||
Property createProperty();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Type</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Type</em>'.
|
||||
* @generated
|
||||
*/
|
||||
Type createType();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Type Reference</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Type Reference</em>'.
|
||||
* @generated
|
||||
*/
|
||||
TypeReference createTypeReference();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Primitive Type</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Primitive Type</em>'.
|
||||
* @generated
|
||||
*/
|
||||
PrimitiveType createPrimitiveType();
|
||||
|
||||
/**
|
||||
* Returns the package supported by this factory.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the package supported by this factory.
|
||||
* @generated
|
||||
*/
|
||||
TestLanguagePackage getTestLanguagePackage();
|
||||
|
||||
} //TestLanguageFactory
|
|
@ -0,0 +1,566 @@
|
|||
/**
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.testlanguage.testLanguage;
|
||||
|
||||
import org.eclipse.emf.ecore.EAttribute;
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.EPackage;
|
||||
import org.eclipse.emf.ecore.EReference;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* The <b>Package</b> for the model.
|
||||
* It contains accessors for the meta objects to represent
|
||||
* <ul>
|
||||
* <li>each class,</li>
|
||||
* <li>each feature of each class,</li>
|
||||
* <li>each enum,</li>
|
||||
* <li>and each data type</li>
|
||||
* </ul>
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TestLanguageFactory
|
||||
* @model kind="package"
|
||||
* @generated
|
||||
*/
|
||||
public interface TestLanguagePackage extends EPackage
|
||||
{
|
||||
/**
|
||||
* The package name.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
String eNAME = "testLanguage";
|
||||
|
||||
/**
|
||||
* The package namespace URI.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
String eNS_URI = "http://www.eclipse.org/xtext/ide/tests/testlanguage/TestLanguage";
|
||||
|
||||
/**
|
||||
* The package namespace name.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
String eNS_PREFIX = "testLanguage";
|
||||
|
||||
/**
|
||||
* The singleton instance of the package.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
TestLanguagePackage eINSTANCE = org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.TestLanguagePackageImpl.init();
|
||||
|
||||
/**
|
||||
* The meta object id for the '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.ModelImpl <em>Model</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.ModelImpl
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.TestLanguagePackageImpl#getModel()
|
||||
* @generated
|
||||
*/
|
||||
int MODEL = 0;
|
||||
|
||||
/**
|
||||
* The feature id for the '<em><b>Types</b></em>' containment reference list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int MODEL__TYPES = 0;
|
||||
|
||||
/**
|
||||
* The number of structural features of the '<em>Model</em>' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int MODEL_FEATURE_COUNT = 1;
|
||||
|
||||
/**
|
||||
* The meta object id for the '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.TypeDeclarationImpl <em>Type Declaration</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.TypeDeclarationImpl
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.TestLanguagePackageImpl#getTypeDeclaration()
|
||||
* @generated
|
||||
*/
|
||||
int TYPE_DECLARATION = 1;
|
||||
|
||||
/**
|
||||
* The feature id for the '<em><b>Name</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int TYPE_DECLARATION__NAME = 0;
|
||||
|
||||
/**
|
||||
* The feature id for the '<em><b>Properties</b></em>' containment reference list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int TYPE_DECLARATION__PROPERTIES = 1;
|
||||
|
||||
/**
|
||||
* The number of structural features of the '<em>Type Declaration</em>' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int TYPE_DECLARATION_FEATURE_COUNT = 2;
|
||||
|
||||
/**
|
||||
* The meta object id for the '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.PropertyImpl <em>Property</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.PropertyImpl
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.TestLanguagePackageImpl#getProperty()
|
||||
* @generated
|
||||
*/
|
||||
int PROPERTY = 2;
|
||||
|
||||
/**
|
||||
* The feature id for the '<em><b>Name</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int PROPERTY__NAME = 0;
|
||||
|
||||
/**
|
||||
* The feature id for the '<em><b>Type</b></em>' containment reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int PROPERTY__TYPE = 1;
|
||||
|
||||
/**
|
||||
* The number of structural features of the '<em>Property</em>' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int PROPERTY_FEATURE_COUNT = 2;
|
||||
|
||||
/**
|
||||
* The meta object id for the '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.TypeImpl <em>Type</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.TypeImpl
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.TestLanguagePackageImpl#getType()
|
||||
* @generated
|
||||
*/
|
||||
int TYPE = 3;
|
||||
|
||||
/**
|
||||
* The feature id for the '<em><b>Array Diemensions</b></em>' attribute list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int TYPE__ARRAY_DIEMENSIONS = 0;
|
||||
|
||||
/**
|
||||
* The number of structural features of the '<em>Type</em>' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int TYPE_FEATURE_COUNT = 1;
|
||||
|
||||
/**
|
||||
* The meta object id for the '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.TypeReferenceImpl <em>Type Reference</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.TypeReferenceImpl
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.TestLanguagePackageImpl#getTypeReference()
|
||||
* @generated
|
||||
*/
|
||||
int TYPE_REFERENCE = 4;
|
||||
|
||||
/**
|
||||
* The feature id for the '<em><b>Array Diemensions</b></em>' attribute list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int TYPE_REFERENCE__ARRAY_DIEMENSIONS = TYPE__ARRAY_DIEMENSIONS;
|
||||
|
||||
/**
|
||||
* The feature id for the '<em><b>Type Ref</b></em>' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int TYPE_REFERENCE__TYPE_REF = TYPE_FEATURE_COUNT + 0;
|
||||
|
||||
/**
|
||||
* The number of structural features of the '<em>Type Reference</em>' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int TYPE_REFERENCE_FEATURE_COUNT = TYPE_FEATURE_COUNT + 1;
|
||||
|
||||
/**
|
||||
* The meta object id for the '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.PrimitiveTypeImpl <em>Primitive Type</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.PrimitiveTypeImpl
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.TestLanguagePackageImpl#getPrimitiveType()
|
||||
* @generated
|
||||
*/
|
||||
int PRIMITIVE_TYPE = 5;
|
||||
|
||||
/**
|
||||
* The feature id for the '<em><b>Array Diemensions</b></em>' attribute list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int PRIMITIVE_TYPE__ARRAY_DIEMENSIONS = TYPE__ARRAY_DIEMENSIONS;
|
||||
|
||||
/**
|
||||
* The feature id for the '<em><b>Name</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int PRIMITIVE_TYPE__NAME = TYPE_FEATURE_COUNT + 0;
|
||||
|
||||
/**
|
||||
* The number of structural features of the '<em>Primitive Type</em>' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
int PRIMITIVE_TYPE_FEATURE_COUNT = TYPE_FEATURE_COUNT + 1;
|
||||
|
||||
|
||||
/**
|
||||
* Returns the meta object for class '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Model <em>Model</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for class '<em>Model</em>'.
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Model
|
||||
* @generated
|
||||
*/
|
||||
EClass getModel();
|
||||
|
||||
/**
|
||||
* Returns the meta object for the containment reference list '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Model#getTypes <em>Types</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for the containment reference list '<em>Types</em>'.
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Model#getTypes()
|
||||
* @see #getModel()
|
||||
* @generated
|
||||
*/
|
||||
EReference getModel_Types();
|
||||
|
||||
/**
|
||||
* Returns the meta object for class '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TypeDeclaration <em>Type Declaration</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for class '<em>Type Declaration</em>'.
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TypeDeclaration
|
||||
* @generated
|
||||
*/
|
||||
EClass getTypeDeclaration();
|
||||
|
||||
/**
|
||||
* Returns the meta object for the attribute '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TypeDeclaration#getName <em>Name</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for the attribute '<em>Name</em>'.
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TypeDeclaration#getName()
|
||||
* @see #getTypeDeclaration()
|
||||
* @generated
|
||||
*/
|
||||
EAttribute getTypeDeclaration_Name();
|
||||
|
||||
/**
|
||||
* Returns the meta object for the containment reference list '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TypeDeclaration#getProperties <em>Properties</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for the containment reference list '<em>Properties</em>'.
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TypeDeclaration#getProperties()
|
||||
* @see #getTypeDeclaration()
|
||||
* @generated
|
||||
*/
|
||||
EReference getTypeDeclaration_Properties();
|
||||
|
||||
/**
|
||||
* Returns the meta object for class '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Property <em>Property</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for class '<em>Property</em>'.
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Property
|
||||
* @generated
|
||||
*/
|
||||
EClass getProperty();
|
||||
|
||||
/**
|
||||
* Returns the meta object for the attribute '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Property#getName <em>Name</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for the attribute '<em>Name</em>'.
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Property#getName()
|
||||
* @see #getProperty()
|
||||
* @generated
|
||||
*/
|
||||
EAttribute getProperty_Name();
|
||||
|
||||
/**
|
||||
* Returns the meta object for the containment reference '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Property#getType <em>Type</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for the containment reference '<em>Type</em>'.
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Property#getType()
|
||||
* @see #getProperty()
|
||||
* @generated
|
||||
*/
|
||||
EReference getProperty_Type();
|
||||
|
||||
/**
|
||||
* Returns the meta object for class '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Type <em>Type</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for class '<em>Type</em>'.
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Type
|
||||
* @generated
|
||||
*/
|
||||
EClass getType();
|
||||
|
||||
/**
|
||||
* Returns the meta object for the attribute list '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Type#getArrayDiemensions <em>Array Diemensions</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for the attribute list '<em>Array Diemensions</em>'.
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Type#getArrayDiemensions()
|
||||
* @see #getType()
|
||||
* @generated
|
||||
*/
|
||||
EAttribute getType_ArrayDiemensions();
|
||||
|
||||
/**
|
||||
* Returns the meta object for class '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TypeReference <em>Type Reference</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for class '<em>Type Reference</em>'.
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TypeReference
|
||||
* @generated
|
||||
*/
|
||||
EClass getTypeReference();
|
||||
|
||||
/**
|
||||
* Returns the meta object for the reference '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TypeReference#getTypeRef <em>Type Ref</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for the reference '<em>Type Ref</em>'.
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TypeReference#getTypeRef()
|
||||
* @see #getTypeReference()
|
||||
* @generated
|
||||
*/
|
||||
EReference getTypeReference_TypeRef();
|
||||
|
||||
/**
|
||||
* Returns the meta object for class '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.PrimitiveType <em>Primitive Type</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for class '<em>Primitive Type</em>'.
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.PrimitiveType
|
||||
* @generated
|
||||
*/
|
||||
EClass getPrimitiveType();
|
||||
|
||||
/**
|
||||
* Returns the meta object for the attribute '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.PrimitiveType#getName <em>Name</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the meta object for the attribute '<em>Name</em>'.
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.PrimitiveType#getName()
|
||||
* @see #getPrimitiveType()
|
||||
* @generated
|
||||
*/
|
||||
EAttribute getPrimitiveType_Name();
|
||||
|
||||
/**
|
||||
* Returns the factory that creates the instances of the model.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the factory that creates the instances of the model.
|
||||
* @generated
|
||||
*/
|
||||
TestLanguageFactory getTestLanguageFactory();
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* Defines literals for the meta objects that represent
|
||||
* <ul>
|
||||
* <li>each class,</li>
|
||||
* <li>each feature of each class,</li>
|
||||
* <li>each enum,</li>
|
||||
* <li>and each data type</li>
|
||||
* </ul>
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
interface Literals
|
||||
{
|
||||
/**
|
||||
* The meta object literal for the '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.ModelImpl <em>Model</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.ModelImpl
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.TestLanguagePackageImpl#getModel()
|
||||
* @generated
|
||||
*/
|
||||
EClass MODEL = eINSTANCE.getModel();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '<em><b>Types</b></em>' containment reference list feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
EReference MODEL__TYPES = eINSTANCE.getModel_Types();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.TypeDeclarationImpl <em>Type Declaration</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.TypeDeclarationImpl
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.TestLanguagePackageImpl#getTypeDeclaration()
|
||||
* @generated
|
||||
*/
|
||||
EClass TYPE_DECLARATION = eINSTANCE.getTypeDeclaration();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '<em><b>Name</b></em>' attribute feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
EAttribute TYPE_DECLARATION__NAME = eINSTANCE.getTypeDeclaration_Name();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '<em><b>Properties</b></em>' containment reference list feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
EReference TYPE_DECLARATION__PROPERTIES = eINSTANCE.getTypeDeclaration_Properties();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.PropertyImpl <em>Property</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.PropertyImpl
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.TestLanguagePackageImpl#getProperty()
|
||||
* @generated
|
||||
*/
|
||||
EClass PROPERTY = eINSTANCE.getProperty();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '<em><b>Name</b></em>' attribute feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
EAttribute PROPERTY__NAME = eINSTANCE.getProperty_Name();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '<em><b>Type</b></em>' containment reference feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
EReference PROPERTY__TYPE = eINSTANCE.getProperty_Type();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.TypeImpl <em>Type</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.TypeImpl
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.TestLanguagePackageImpl#getType()
|
||||
* @generated
|
||||
*/
|
||||
EClass TYPE = eINSTANCE.getType();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '<em><b>Array Diemensions</b></em>' attribute list feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
EAttribute TYPE__ARRAY_DIEMENSIONS = eINSTANCE.getType_ArrayDiemensions();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.TypeReferenceImpl <em>Type Reference</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.TypeReferenceImpl
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.TestLanguagePackageImpl#getTypeReference()
|
||||
* @generated
|
||||
*/
|
||||
EClass TYPE_REFERENCE = eINSTANCE.getTypeReference();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '<em><b>Type Ref</b></em>' reference feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
EReference TYPE_REFERENCE__TYPE_REF = eINSTANCE.getTypeReference_TypeRef();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.PrimitiveTypeImpl <em>Primitive Type</em>}' class.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.PrimitiveTypeImpl
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.TestLanguagePackageImpl#getPrimitiveType()
|
||||
* @generated
|
||||
*/
|
||||
EClass PRIMITIVE_TYPE = eINSTANCE.getPrimitiveType();
|
||||
|
||||
/**
|
||||
* The meta object literal for the '<em><b>Name</b></em>' attribute feature.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
EAttribute PRIMITIVE_TYPE__NAME = eINSTANCE.getPrimitiveType_Name();
|
||||
|
||||
}
|
||||
|
||||
} //TestLanguagePackage
|
|
@ -0,0 +1,48 @@
|
|||
/**
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.testlanguage.testLanguage;
|
||||
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Type</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* <p>
|
||||
* The following features are supported:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Type#getArrayDiemensions <em>Array Diemensions</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TestLanguagePackage#getType()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface Type extends EObject
|
||||
{
|
||||
/**
|
||||
* Returns the value of the '<em><b>Array Diemensions</b></em>' attribute list.
|
||||
* The list contents are of type {@link java.lang.String}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Array Diemensions</em>' attribute list isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Array Diemensions</em>' attribute list.
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TestLanguagePackage#getType_ArrayDiemensions()
|
||||
* @model unique="false"
|
||||
* @generated
|
||||
*/
|
||||
EList<String> getArrayDiemensions();
|
||||
|
||||
} // Type
|
|
@ -0,0 +1,75 @@
|
|||
/**
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.testlanguage.testLanguage;
|
||||
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Type Declaration</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* <p>
|
||||
* The following features are supported:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TypeDeclaration#getName <em>Name</em>}</li>
|
||||
* <li>{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TypeDeclaration#getProperties <em>Properties</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TestLanguagePackage#getTypeDeclaration()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface TypeDeclaration extends EObject
|
||||
{
|
||||
/**
|
||||
* Returns the value of the '<em><b>Name</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Name</em>' attribute isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Name</em>' attribute.
|
||||
* @see #setName(String)
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TestLanguagePackage#getTypeDeclaration_Name()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TypeDeclaration#getName <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Name</em>' attribute.
|
||||
* @see #getName()
|
||||
* @generated
|
||||
*/
|
||||
void setName(String value);
|
||||
|
||||
/**
|
||||
* Returns the value of the '<em><b>Properties</b></em>' containment reference list.
|
||||
* The list contents are of type {@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Property}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Properties</em>' containment reference list.
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TestLanguagePackage#getTypeDeclaration_Properties()
|
||||
* @model containment="true"
|
||||
* @generated
|
||||
*/
|
||||
EList<Property> getProperties();
|
||||
|
||||
} // TypeDeclaration
|
|
@ -0,0 +1,55 @@
|
|||
/**
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.testlanguage.testLanguage;
|
||||
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Type Reference</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* <p>
|
||||
* The following features are supported:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TypeReference#getTypeRef <em>Type Ref</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TestLanguagePackage#getTypeReference()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface TypeReference extends Type
|
||||
{
|
||||
/**
|
||||
* Returns the value of the '<em><b>Type Ref</b></em>' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Type Ref</em>' reference isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Type Ref</em>' reference.
|
||||
* @see #setTypeRef(Type)
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TestLanguagePackage#getTypeReference_TypeRef()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
Type getTypeRef();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TypeReference#getTypeRef <em>Type Ref</em>}' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Type Ref</em>' reference.
|
||||
* @see #getTypeRef()
|
||||
* @generated
|
||||
*/
|
||||
void setTypeRef(Type value);
|
||||
|
||||
} // TypeReference
|
|
@ -0,0 +1,172 @@
|
|||
/**
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.eclipse.emf.common.notify.NotificationChain;
|
||||
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.InternalEObject;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
||||
|
||||
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
|
||||
import org.eclipse.emf.ecore.util.InternalEList;
|
||||
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Model;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TestLanguagePackage;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TypeDeclaration;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Model</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.ModelImpl#getTypes <em>Types</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class ModelImpl extends MinimalEObjectImpl.Container implements Model
|
||||
{
|
||||
/**
|
||||
* The cached value of the '{@link #getTypes() <em>Types</em>}' containment reference list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getTypes()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected EList<TypeDeclaration> types;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected ModelImpl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass()
|
||||
{
|
||||
return TestLanguagePackage.Literals.MODEL;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<TypeDeclaration> getTypes()
|
||||
{
|
||||
if (types == null)
|
||||
{
|
||||
types = new EObjectContainmentEList<TypeDeclaration>(TypeDeclaration.class, this, TestLanguagePackage.MODEL__TYPES);
|
||||
}
|
||||
return types;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case TestLanguagePackage.MODEL__TYPES:
|
||||
return ((InternalEList<?>)getTypes()).basicRemove(otherEnd, msgs);
|
||||
}
|
||||
return super.eInverseRemove(otherEnd, featureID, msgs);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object eGet(int featureID, boolean resolve, boolean coreType)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case TestLanguagePackage.MODEL__TYPES:
|
||||
return getTypes();
|
||||
}
|
||||
return super.eGet(featureID, resolve, coreType);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void eSet(int featureID, Object newValue)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case TestLanguagePackage.MODEL__TYPES:
|
||||
getTypes().clear();
|
||||
getTypes().addAll((Collection<? extends TypeDeclaration>)newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case TestLanguagePackage.MODEL__TYPES:
|
||||
getTypes().clear();
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case TestLanguagePackage.MODEL__TYPES:
|
||||
return types != null && !types.isEmpty();
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
} //ModelImpl
|
|
@ -0,0 +1,181 @@
|
|||
/**
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl;
|
||||
|
||||
import org.eclipse.emf.common.notify.Notification;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.testLanguage.PrimitiveType;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TestLanguagePackage;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Primitive Type</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.PrimitiveTypeImpl#getName <em>Name</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class PrimitiveTypeImpl extends TypeImpl implements PrimitiveType
|
||||
{
|
||||
/**
|
||||
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getName()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String NAME_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getName()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String name = NAME_EDEFAULT;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected PrimitiveTypeImpl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass()
|
||||
{
|
||||
return TestLanguagePackage.Literals.PRIMITIVE_TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setName(String newName)
|
||||
{
|
||||
String oldName = name;
|
||||
name = newName;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, TestLanguagePackage.PRIMITIVE_TYPE__NAME, oldName, name));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object eGet(int featureID, boolean resolve, boolean coreType)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case TestLanguagePackage.PRIMITIVE_TYPE__NAME:
|
||||
return getName();
|
||||
}
|
||||
return super.eGet(featureID, resolve, coreType);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eSet(int featureID, Object newValue)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case TestLanguagePackage.PRIMITIVE_TYPE__NAME:
|
||||
setName((String)newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case TestLanguagePackage.PRIMITIVE_TYPE__NAME:
|
||||
setName(NAME_EDEFAULT);
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case TestLanguagePackage.PRIMITIVE_TYPE__NAME:
|
||||
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
if (eIsProxy()) return super.toString();
|
||||
|
||||
StringBuffer result = new StringBuffer(super.toString());
|
||||
result.append(" (name: ");
|
||||
result.append(name);
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
} //PrimitiveTypeImpl
|
|
@ -0,0 +1,270 @@
|
|||
/**
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl;
|
||||
|
||||
import org.eclipse.emf.common.notify.Notification;
|
||||
import org.eclipse.emf.common.notify.NotificationChain;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.InternalEObject;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
||||
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Property;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TestLanguagePackage;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Type;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Property</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.PropertyImpl#getName <em>Name</em>}</li>
|
||||
* <li>{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.PropertyImpl#getType <em>Type</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class PropertyImpl extends MinimalEObjectImpl.Container implements Property
|
||||
{
|
||||
/**
|
||||
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getName()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String NAME_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getName()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String name = NAME_EDEFAULT;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getType() <em>Type</em>}' containment reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getType()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected Type type;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected PropertyImpl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass()
|
||||
{
|
||||
return TestLanguagePackage.Literals.PROPERTY;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setName(String newName)
|
||||
{
|
||||
String oldName = name;
|
||||
name = newName;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, TestLanguagePackage.PROPERTY__NAME, oldName, name));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Type getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public NotificationChain basicSetType(Type newType, NotificationChain msgs)
|
||||
{
|
||||
Type oldType = type;
|
||||
type = newType;
|
||||
if (eNotificationRequired())
|
||||
{
|
||||
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, TestLanguagePackage.PROPERTY__TYPE, oldType, newType);
|
||||
if (msgs == null) msgs = notification; else msgs.add(notification);
|
||||
}
|
||||
return msgs;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setType(Type newType)
|
||||
{
|
||||
if (newType != type)
|
||||
{
|
||||
NotificationChain msgs = null;
|
||||
if (type != null)
|
||||
msgs = ((InternalEObject)type).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - TestLanguagePackage.PROPERTY__TYPE, null, msgs);
|
||||
if (newType != null)
|
||||
msgs = ((InternalEObject)newType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - TestLanguagePackage.PROPERTY__TYPE, null, msgs);
|
||||
msgs = basicSetType(newType, msgs);
|
||||
if (msgs != null) msgs.dispatch();
|
||||
}
|
||||
else if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, TestLanguagePackage.PROPERTY__TYPE, newType, newType));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case TestLanguagePackage.PROPERTY__TYPE:
|
||||
return basicSetType(null, msgs);
|
||||
}
|
||||
return super.eInverseRemove(otherEnd, featureID, msgs);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object eGet(int featureID, boolean resolve, boolean coreType)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case TestLanguagePackage.PROPERTY__NAME:
|
||||
return getName();
|
||||
case TestLanguagePackage.PROPERTY__TYPE:
|
||||
return getType();
|
||||
}
|
||||
return super.eGet(featureID, resolve, coreType);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eSet(int featureID, Object newValue)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case TestLanguagePackage.PROPERTY__NAME:
|
||||
setName((String)newValue);
|
||||
return;
|
||||
case TestLanguagePackage.PROPERTY__TYPE:
|
||||
setType((Type)newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case TestLanguagePackage.PROPERTY__NAME:
|
||||
setName(NAME_EDEFAULT);
|
||||
return;
|
||||
case TestLanguagePackage.PROPERTY__TYPE:
|
||||
setType((Type)null);
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case TestLanguagePackage.PROPERTY__NAME:
|
||||
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
|
||||
case TestLanguagePackage.PROPERTY__TYPE:
|
||||
return type != null;
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
if (eIsProxy()) return super.toString();
|
||||
|
||||
StringBuffer result = new StringBuffer(super.toString());
|
||||
result.append(" (name: ");
|
||||
result.append(name);
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
} //PropertyImpl
|
|
@ -0,0 +1,171 @@
|
|||
/**
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.emf.ecore.EPackage;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.EFactoryImpl;
|
||||
|
||||
import org.eclipse.emf.ecore.plugin.EcorePlugin;
|
||||
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.testLanguage.*;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model <b>Factory</b>.
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public class TestLanguageFactoryImpl extends EFactoryImpl implements TestLanguageFactory
|
||||
{
|
||||
/**
|
||||
* Creates the default factory implementation.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public static TestLanguageFactory init()
|
||||
{
|
||||
try
|
||||
{
|
||||
TestLanguageFactory theTestLanguageFactory = (TestLanguageFactory)EPackage.Registry.INSTANCE.getEFactory(TestLanguagePackage.eNS_URI);
|
||||
if (theTestLanguageFactory != null)
|
||||
{
|
||||
return theTestLanguageFactory;
|
||||
}
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
EcorePlugin.INSTANCE.log(exception);
|
||||
}
|
||||
return new TestLanguageFactoryImpl();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an instance of the factory.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public TestLanguageFactoryImpl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public EObject create(EClass eClass)
|
||||
{
|
||||
switch (eClass.getClassifierID())
|
||||
{
|
||||
case TestLanguagePackage.MODEL: return createModel();
|
||||
case TestLanguagePackage.TYPE_DECLARATION: return createTypeDeclaration();
|
||||
case TestLanguagePackage.PROPERTY: return createProperty();
|
||||
case TestLanguagePackage.TYPE: return createType();
|
||||
case TestLanguagePackage.TYPE_REFERENCE: return createTypeReference();
|
||||
case TestLanguagePackage.PRIMITIVE_TYPE: return createPrimitiveType();
|
||||
default:
|
||||
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Model createModel()
|
||||
{
|
||||
ModelImpl model = new ModelImpl();
|
||||
return model;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public TypeDeclaration createTypeDeclaration()
|
||||
{
|
||||
TypeDeclarationImpl typeDeclaration = new TypeDeclarationImpl();
|
||||
return typeDeclaration;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Property createProperty()
|
||||
{
|
||||
PropertyImpl property = new PropertyImpl();
|
||||
return property;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Type createType()
|
||||
{
|
||||
TypeImpl type = new TypeImpl();
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public TypeReference createTypeReference()
|
||||
{
|
||||
TypeReferenceImpl typeReference = new TypeReferenceImpl();
|
||||
return typeReference;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public PrimitiveType createPrimitiveType()
|
||||
{
|
||||
PrimitiveTypeImpl primitiveType = new PrimitiveTypeImpl();
|
||||
return primitiveType;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public TestLanguagePackage getTestLanguagePackage()
|
||||
{
|
||||
return (TestLanguagePackage)getEPackage();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @deprecated
|
||||
* @generated
|
||||
*/
|
||||
@Deprecated
|
||||
public static TestLanguagePackage getPackage()
|
||||
{
|
||||
return TestLanguagePackage.eINSTANCE;
|
||||
}
|
||||
|
||||
} //TestLanguageFactoryImpl
|
|
@ -0,0 +1,387 @@
|
|||
/**
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl;
|
||||
|
||||
import org.eclipse.emf.ecore.EAttribute;
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.EPackage;
|
||||
import org.eclipse.emf.ecore.EReference;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.EPackageImpl;
|
||||
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Model;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.testLanguage.PrimitiveType;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Property;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TestLanguageFactory;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TestLanguagePackage;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Type;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TypeDeclaration;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TypeReference;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model <b>Package</b>.
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public class TestLanguagePackageImpl extends EPackageImpl implements TestLanguagePackage
|
||||
{
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass modelEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass typeDeclarationEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass propertyEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass typeEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass typeReferenceEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass primitiveTypeEClass = null;
|
||||
|
||||
/**
|
||||
* Creates an instance of the model <b>Package</b>, registered with
|
||||
* {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
|
||||
* package URI value.
|
||||
* <p>Note: the correct way to create the package is via the static
|
||||
* factory method {@link #init init()}, which also performs
|
||||
* initialization of the package, or returns the registered package,
|
||||
* if one already exists.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.emf.ecore.EPackage.Registry
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TestLanguagePackage#eNS_URI
|
||||
* @see #init()
|
||||
* @generated
|
||||
*/
|
||||
private TestLanguagePackageImpl()
|
||||
{
|
||||
super(eNS_URI, TestLanguageFactory.eINSTANCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private static boolean isInited = false;
|
||||
|
||||
/**
|
||||
* Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
|
||||
*
|
||||
* <p>This method is used to initialize {@link TestLanguagePackage#eINSTANCE} when that field is accessed.
|
||||
* Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #eNS_URI
|
||||
* @see #createPackageContents()
|
||||
* @see #initializePackageContents()
|
||||
* @generated
|
||||
*/
|
||||
public static TestLanguagePackage init()
|
||||
{
|
||||
if (isInited) return (TestLanguagePackage)EPackage.Registry.INSTANCE.getEPackage(TestLanguagePackage.eNS_URI);
|
||||
|
||||
// Obtain or create and register package
|
||||
TestLanguagePackageImpl theTestLanguagePackage = (TestLanguagePackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof TestLanguagePackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new TestLanguagePackageImpl());
|
||||
|
||||
isInited = true;
|
||||
|
||||
// Create package meta-data objects
|
||||
theTestLanguagePackage.createPackageContents();
|
||||
|
||||
// Initialize created meta-data
|
||||
theTestLanguagePackage.initializePackageContents();
|
||||
|
||||
// Mark meta-data to indicate it can't be changed
|
||||
theTestLanguagePackage.freeze();
|
||||
|
||||
|
||||
// Update the registry and return the package
|
||||
EPackage.Registry.INSTANCE.put(TestLanguagePackage.eNS_URI, theTestLanguagePackage);
|
||||
return theTestLanguagePackage;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getModel()
|
||||
{
|
||||
return modelEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EReference getModel_Types()
|
||||
{
|
||||
return (EReference)modelEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getTypeDeclaration()
|
||||
{
|
||||
return typeDeclarationEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getTypeDeclaration_Name()
|
||||
{
|
||||
return (EAttribute)typeDeclarationEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EReference getTypeDeclaration_Properties()
|
||||
{
|
||||
return (EReference)typeDeclarationEClass.getEStructuralFeatures().get(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getProperty()
|
||||
{
|
||||
return propertyEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getProperty_Name()
|
||||
{
|
||||
return (EAttribute)propertyEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EReference getProperty_Type()
|
||||
{
|
||||
return (EReference)propertyEClass.getEStructuralFeatures().get(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getType()
|
||||
{
|
||||
return typeEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getType_ArrayDiemensions()
|
||||
{
|
||||
return (EAttribute)typeEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getTypeReference()
|
||||
{
|
||||
return typeReferenceEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EReference getTypeReference_TypeRef()
|
||||
{
|
||||
return (EReference)typeReferenceEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getPrimitiveType()
|
||||
{
|
||||
return primitiveTypeEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getPrimitiveType_Name()
|
||||
{
|
||||
return (EAttribute)primitiveTypeEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public TestLanguageFactory getTestLanguageFactory()
|
||||
{
|
||||
return (TestLanguageFactory)getEFactoryInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private boolean isCreated = false;
|
||||
|
||||
/**
|
||||
* Creates the meta-model objects for the package. This method is
|
||||
* guarded to have no affect on any invocation but its first.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void createPackageContents()
|
||||
{
|
||||
if (isCreated) return;
|
||||
isCreated = true;
|
||||
|
||||
// Create classes and their features
|
||||
modelEClass = createEClass(MODEL);
|
||||
createEReference(modelEClass, MODEL__TYPES);
|
||||
|
||||
typeDeclarationEClass = createEClass(TYPE_DECLARATION);
|
||||
createEAttribute(typeDeclarationEClass, TYPE_DECLARATION__NAME);
|
||||
createEReference(typeDeclarationEClass, TYPE_DECLARATION__PROPERTIES);
|
||||
|
||||
propertyEClass = createEClass(PROPERTY);
|
||||
createEAttribute(propertyEClass, PROPERTY__NAME);
|
||||
createEReference(propertyEClass, PROPERTY__TYPE);
|
||||
|
||||
typeEClass = createEClass(TYPE);
|
||||
createEAttribute(typeEClass, TYPE__ARRAY_DIEMENSIONS);
|
||||
|
||||
typeReferenceEClass = createEClass(TYPE_REFERENCE);
|
||||
createEReference(typeReferenceEClass, TYPE_REFERENCE__TYPE_REF);
|
||||
|
||||
primitiveTypeEClass = createEClass(PRIMITIVE_TYPE);
|
||||
createEAttribute(primitiveTypeEClass, PRIMITIVE_TYPE__NAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private boolean isInitialized = false;
|
||||
|
||||
/**
|
||||
* Complete the initialization of the package and its meta-model. This
|
||||
* method is guarded to have no affect on any invocation but its first.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void initializePackageContents()
|
||||
{
|
||||
if (isInitialized) return;
|
||||
isInitialized = true;
|
||||
|
||||
// Initialize package
|
||||
setName(eNAME);
|
||||
setNsPrefix(eNS_PREFIX);
|
||||
setNsURI(eNS_URI);
|
||||
|
||||
// Create type parameters
|
||||
|
||||
// Set bounds for type parameters
|
||||
|
||||
// Add supertypes to classes
|
||||
typeReferenceEClass.getESuperTypes().add(this.getType());
|
||||
primitiveTypeEClass.getESuperTypes().add(this.getType());
|
||||
|
||||
// Initialize classes and features; add operations and parameters
|
||||
initEClass(modelEClass, Model.class, "Model", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEReference(getModel_Types(), this.getTypeDeclaration(), null, "types", null, 0, -1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(typeDeclarationEClass, TypeDeclaration.class, "TypeDeclaration", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEAttribute(getTypeDeclaration_Name(), ecorePackage.getEString(), "name", null, 0, 1, TypeDeclaration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEReference(getTypeDeclaration_Properties(), this.getProperty(), null, "properties", null, 0, -1, TypeDeclaration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(propertyEClass, Property.class, "Property", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEAttribute(getProperty_Name(), ecorePackage.getEString(), "name", null, 0, 1, Property.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEReference(getProperty_Type(), this.getType(), null, "type", null, 0, 1, Property.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(typeEClass, Type.class, "Type", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEAttribute(getType_ArrayDiemensions(), ecorePackage.getEString(), "arrayDiemensions", null, 0, -1, Type.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(typeReferenceEClass, TypeReference.class, "TypeReference", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEReference(getTypeReference_TypeRef(), this.getType(), null, "typeRef", null, 0, 1, TypeReference.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(primitiveTypeEClass, PrimitiveType.class, "PrimitiveType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEAttribute(getPrimitiveType_Name(), ecorePackage.getEString(), "name", null, 0, 1, PrimitiveType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
// Create resource
|
||||
createResource(eNS_URI);
|
||||
}
|
||||
|
||||
} //TestLanguagePackageImpl
|
|
@ -0,0 +1,245 @@
|
|||
/**
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.eclipse.emf.common.notify.Notification;
|
||||
import org.eclipse.emf.common.notify.NotificationChain;
|
||||
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.InternalEObject;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
||||
|
||||
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
|
||||
import org.eclipse.emf.ecore.util.InternalEList;
|
||||
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Property;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TestLanguagePackage;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TypeDeclaration;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Type Declaration</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.TypeDeclarationImpl#getName <em>Name</em>}</li>
|
||||
* <li>{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.TypeDeclarationImpl#getProperties <em>Properties</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class TypeDeclarationImpl extends MinimalEObjectImpl.Container implements TypeDeclaration
|
||||
{
|
||||
/**
|
||||
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getName()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String NAME_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getName()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String name = NAME_EDEFAULT;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getProperties()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected EList<Property> properties;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected TypeDeclarationImpl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass()
|
||||
{
|
||||
return TestLanguagePackage.Literals.TYPE_DECLARATION;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setName(String newName)
|
||||
{
|
||||
String oldName = name;
|
||||
name = newName;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, TestLanguagePackage.TYPE_DECLARATION__NAME, oldName, name));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<Property> getProperties()
|
||||
{
|
||||
if (properties == null)
|
||||
{
|
||||
properties = new EObjectContainmentEList<Property>(Property.class, this, TestLanguagePackage.TYPE_DECLARATION__PROPERTIES);
|
||||
}
|
||||
return properties;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case TestLanguagePackage.TYPE_DECLARATION__PROPERTIES:
|
||||
return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
|
||||
}
|
||||
return super.eInverseRemove(otherEnd, featureID, msgs);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object eGet(int featureID, boolean resolve, boolean coreType)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case TestLanguagePackage.TYPE_DECLARATION__NAME:
|
||||
return getName();
|
||||
case TestLanguagePackage.TYPE_DECLARATION__PROPERTIES:
|
||||
return getProperties();
|
||||
}
|
||||
return super.eGet(featureID, resolve, coreType);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void eSet(int featureID, Object newValue)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case TestLanguagePackage.TYPE_DECLARATION__NAME:
|
||||
setName((String)newValue);
|
||||
return;
|
||||
case TestLanguagePackage.TYPE_DECLARATION__PROPERTIES:
|
||||
getProperties().clear();
|
||||
getProperties().addAll((Collection<? extends Property>)newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case TestLanguagePackage.TYPE_DECLARATION__NAME:
|
||||
setName(NAME_EDEFAULT);
|
||||
return;
|
||||
case TestLanguagePackage.TYPE_DECLARATION__PROPERTIES:
|
||||
getProperties().clear();
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case TestLanguagePackage.TYPE_DECLARATION__NAME:
|
||||
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
|
||||
case TestLanguagePackage.TYPE_DECLARATION__PROPERTIES:
|
||||
return properties != null && !properties.isEmpty();
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
if (eIsProxy()) return super.toString();
|
||||
|
||||
StringBuffer result = new StringBuffer(super.toString());
|
||||
result.append(" (name: ");
|
||||
result.append(name);
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
} //TypeDeclarationImpl
|
|
@ -0,0 +1,168 @@
|
|||
/**
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
||||
|
||||
import org.eclipse.emf.ecore.util.EDataTypeEList;
|
||||
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TestLanguagePackage;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Type;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Type</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.TypeImpl#getArrayDiemensions <em>Array Diemensions</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class TypeImpl extends MinimalEObjectImpl.Container implements Type
|
||||
{
|
||||
/**
|
||||
* The cached value of the '{@link #getArrayDiemensions() <em>Array Diemensions</em>}' attribute list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getArrayDiemensions()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected EList<String> arrayDiemensions;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected TypeImpl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass()
|
||||
{
|
||||
return TestLanguagePackage.Literals.TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<String> getArrayDiemensions()
|
||||
{
|
||||
if (arrayDiemensions == null)
|
||||
{
|
||||
arrayDiemensions = new EDataTypeEList<String>(String.class, this, TestLanguagePackage.TYPE__ARRAY_DIEMENSIONS);
|
||||
}
|
||||
return arrayDiemensions;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object eGet(int featureID, boolean resolve, boolean coreType)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case TestLanguagePackage.TYPE__ARRAY_DIEMENSIONS:
|
||||
return getArrayDiemensions();
|
||||
}
|
||||
return super.eGet(featureID, resolve, coreType);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void eSet(int featureID, Object newValue)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case TestLanguagePackage.TYPE__ARRAY_DIEMENSIONS:
|
||||
getArrayDiemensions().clear();
|
||||
getArrayDiemensions().addAll((Collection<? extends String>)newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case TestLanguagePackage.TYPE__ARRAY_DIEMENSIONS:
|
||||
getArrayDiemensions().clear();
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case TestLanguagePackage.TYPE__ARRAY_DIEMENSIONS:
|
||||
return arrayDiemensions != null && !arrayDiemensions.isEmpty();
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
if (eIsProxy()) return super.toString();
|
||||
|
||||
StringBuffer result = new StringBuffer(super.toString());
|
||||
result.append(" (arrayDiemensions: ");
|
||||
result.append(arrayDiemensions);
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
} //TypeImpl
|
|
@ -0,0 +1,177 @@
|
|||
/**
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl;
|
||||
|
||||
import org.eclipse.emf.common.notify.Notification;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.InternalEObject;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TestLanguagePackage;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Type;
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TypeReference;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Type Reference</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.impl.TypeReferenceImpl#getTypeRef <em>Type Ref</em>}</li>
|
||||
* </ul>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class TypeReferenceImpl extends TypeImpl implements TypeReference
|
||||
{
|
||||
/**
|
||||
* The cached value of the '{@link #getTypeRef() <em>Type Ref</em>}' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getTypeRef()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected Type typeRef;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected TypeReferenceImpl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass()
|
||||
{
|
||||
return TestLanguagePackage.Literals.TYPE_REFERENCE;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Type getTypeRef()
|
||||
{
|
||||
if (typeRef != null && typeRef.eIsProxy())
|
||||
{
|
||||
InternalEObject oldTypeRef = (InternalEObject)typeRef;
|
||||
typeRef = (Type)eResolveProxy(oldTypeRef);
|
||||
if (typeRef != oldTypeRef)
|
||||
{
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.RESOLVE, TestLanguagePackage.TYPE_REFERENCE__TYPE_REF, oldTypeRef, typeRef));
|
||||
}
|
||||
}
|
||||
return typeRef;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Type basicGetTypeRef()
|
||||
{
|
||||
return typeRef;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setTypeRef(Type newTypeRef)
|
||||
{
|
||||
Type oldTypeRef = typeRef;
|
||||
typeRef = newTypeRef;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, TestLanguagePackage.TYPE_REFERENCE__TYPE_REF, oldTypeRef, typeRef));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object eGet(int featureID, boolean resolve, boolean coreType)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case TestLanguagePackage.TYPE_REFERENCE__TYPE_REF:
|
||||
if (resolve) return getTypeRef();
|
||||
return basicGetTypeRef();
|
||||
}
|
||||
return super.eGet(featureID, resolve, coreType);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eSet(int featureID, Object newValue)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case TestLanguagePackage.TYPE_REFERENCE__TYPE_REF:
|
||||
setTypeRef((Type)newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case TestLanguagePackage.TYPE_REFERENCE__TYPE_REF:
|
||||
setTypeRef((Type)null);
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case TestLanguagePackage.TYPE_REFERENCE__TYPE_REF:
|
||||
return typeRef != null;
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
} //TypeReferenceImpl
|
|
@ -0,0 +1,237 @@
|
|||
/**
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.testlanguage.testLanguage.util;
|
||||
|
||||
import org.eclipse.emf.common.notify.Adapter;
|
||||
import org.eclipse.emf.common.notify.Notifier;
|
||||
|
||||
import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
|
||||
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.testLanguage.*;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* The <b>Adapter Factory</b> for the model.
|
||||
* It provides an adapter <code>createXXX</code> method for each class of the model.
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TestLanguagePackage
|
||||
* @generated
|
||||
*/
|
||||
public class TestLanguageAdapterFactory extends AdapterFactoryImpl
|
||||
{
|
||||
/**
|
||||
* The cached model package.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected static TestLanguagePackage modelPackage;
|
||||
|
||||
/**
|
||||
* Creates an instance of the adapter factory.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public TestLanguageAdapterFactory()
|
||||
{
|
||||
if (modelPackage == null)
|
||||
{
|
||||
modelPackage = TestLanguagePackage.eINSTANCE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether this factory is applicable for the type of the object.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
|
||||
* <!-- end-user-doc -->
|
||||
* @return whether this factory is applicable for the type of the object.
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean isFactoryForType(Object object)
|
||||
{
|
||||
if (object == modelPackage)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (object instanceof EObject)
|
||||
{
|
||||
return ((EObject)object).eClass().getEPackage() == modelPackage;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* The switch that delegates to the <code>createXXX</code> methods.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected TestLanguageSwitch<Adapter> modelSwitch =
|
||||
new TestLanguageSwitch<Adapter>()
|
||||
{
|
||||
@Override
|
||||
public Adapter caseModel(Model object)
|
||||
{
|
||||
return createModelAdapter();
|
||||
}
|
||||
@Override
|
||||
public Adapter caseTypeDeclaration(TypeDeclaration object)
|
||||
{
|
||||
return createTypeDeclarationAdapter();
|
||||
}
|
||||
@Override
|
||||
public Adapter caseProperty(Property object)
|
||||
{
|
||||
return createPropertyAdapter();
|
||||
}
|
||||
@Override
|
||||
public Adapter caseType(Type object)
|
||||
{
|
||||
return createTypeAdapter();
|
||||
}
|
||||
@Override
|
||||
public Adapter caseTypeReference(TypeReference object)
|
||||
{
|
||||
return createTypeReferenceAdapter();
|
||||
}
|
||||
@Override
|
||||
public Adapter casePrimitiveType(PrimitiveType object)
|
||||
{
|
||||
return createPrimitiveTypeAdapter();
|
||||
}
|
||||
@Override
|
||||
public Adapter defaultCase(EObject object)
|
||||
{
|
||||
return createEObjectAdapter();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates an adapter for the <code>target</code>.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param target the object to adapt.
|
||||
* @return the adapter for the <code>target</code>.
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Adapter createAdapter(Notifier target)
|
||||
{
|
||||
return modelSwitch.doSwitch((EObject)target);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Model <em>Model</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This default implementation returns null so that we can easily ignore cases;
|
||||
* it's useful to ignore a case when inheritance will catch all the cases anyway.
|
||||
* <!-- end-user-doc -->
|
||||
* @return the new adapter.
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Model
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createModelAdapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TypeDeclaration <em>Type Declaration</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This default implementation returns null so that we can easily ignore cases;
|
||||
* it's useful to ignore a case when inheritance will catch all the cases anyway.
|
||||
* <!-- end-user-doc -->
|
||||
* @return the new adapter.
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TypeDeclaration
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createTypeDeclarationAdapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Property <em>Property</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This default implementation returns null so that we can easily ignore cases;
|
||||
* it's useful to ignore a case when inheritance will catch all the cases anyway.
|
||||
* <!-- end-user-doc -->
|
||||
* @return the new adapter.
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Property
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createPropertyAdapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Type <em>Type</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This default implementation returns null so that we can easily ignore cases;
|
||||
* it's useful to ignore a case when inheritance will catch all the cases anyway.
|
||||
* <!-- end-user-doc -->
|
||||
* @return the new adapter.
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.Type
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createTypeAdapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TypeReference <em>Type Reference</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This default implementation returns null so that we can easily ignore cases;
|
||||
* it's useful to ignore a case when inheritance will catch all the cases anyway.
|
||||
* <!-- end-user-doc -->
|
||||
* @return the new adapter.
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TypeReference
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createTypeReferenceAdapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link org.eclipse.xtext.ide.tests.testlanguage.testLanguage.PrimitiveType <em>Primitive Type</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This default implementation returns null so that we can easily ignore cases;
|
||||
* it's useful to ignore a case when inheritance will catch all the cases anyway.
|
||||
* <!-- end-user-doc -->
|
||||
* @return the new adapter.
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.PrimitiveType
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createPrimitiveTypeAdapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for the default case.
|
||||
* <!-- begin-user-doc -->
|
||||
* This default implementation returns null.
|
||||
* <!-- end-user-doc -->
|
||||
* @return the new adapter.
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createEObjectAdapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
} //TestLanguageAdapterFactory
|
|
@ -0,0 +1,241 @@
|
|||
/**
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.testlanguage.testLanguage.util;
|
||||
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.emf.ecore.EPackage;
|
||||
|
||||
import org.eclipse.emf.ecore.util.Switch;
|
||||
|
||||
import org.eclipse.xtext.ide.tests.testlanguage.testLanguage.*;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* The <b>Switch</b> for the model's inheritance hierarchy.
|
||||
* It supports the call {@link #doSwitch(EObject) doSwitch(object)}
|
||||
* to invoke the <code>caseXXX</code> method for each class of the model,
|
||||
* starting with the actual class of the object
|
||||
* and proceeding up the inheritance hierarchy
|
||||
* until a non-null result is returned,
|
||||
* which is the result of the switch.
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TestLanguagePackage
|
||||
* @generated
|
||||
*/
|
||||
public class TestLanguageSwitch<T> extends Switch<T>
|
||||
{
|
||||
/**
|
||||
* The cached model package
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected static TestLanguagePackage modelPackage;
|
||||
|
||||
/**
|
||||
* Creates an instance of the switch.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public TestLanguageSwitch()
|
||||
{
|
||||
if (modelPackage == null)
|
||||
{
|
||||
modelPackage = TestLanguagePackage.eINSTANCE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether this is a switch for the given package.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param ePackage the package in question.
|
||||
* @return whether this is a switch for the given package.
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected boolean isSwitchFor(EPackage ePackage)
|
||||
{
|
||||
return ePackage == modelPackage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the first non-null result returned by a <code>caseXXX</code> call.
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected T doSwitch(int classifierID, EObject theEObject)
|
||||
{
|
||||
switch (classifierID)
|
||||
{
|
||||
case TestLanguagePackage.MODEL:
|
||||
{
|
||||
Model model = (Model)theEObject;
|
||||
T result = caseModel(model);
|
||||
if (result == null) result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
case TestLanguagePackage.TYPE_DECLARATION:
|
||||
{
|
||||
TypeDeclaration typeDeclaration = (TypeDeclaration)theEObject;
|
||||
T result = caseTypeDeclaration(typeDeclaration);
|
||||
if (result == null) result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
case TestLanguagePackage.PROPERTY:
|
||||
{
|
||||
Property property = (Property)theEObject;
|
||||
T result = caseProperty(property);
|
||||
if (result == null) result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
case TestLanguagePackage.TYPE:
|
||||
{
|
||||
Type type = (Type)theEObject;
|
||||
T result = caseType(type);
|
||||
if (result == null) result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
case TestLanguagePackage.TYPE_REFERENCE:
|
||||
{
|
||||
TypeReference typeReference = (TypeReference)theEObject;
|
||||
T result = caseTypeReference(typeReference);
|
||||
if (result == null) result = caseType(typeReference);
|
||||
if (result == null) result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
case TestLanguagePackage.PRIMITIVE_TYPE:
|
||||
{
|
||||
PrimitiveType primitiveType = (PrimitiveType)theEObject;
|
||||
T result = casePrimitiveType(primitiveType);
|
||||
if (result == null) result = caseType(primitiveType);
|
||||
if (result == null) result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
default: return defaultCase(theEObject);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Model</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns null;
|
||||
* returning a non-null result will terminate the switch.
|
||||
* <!-- end-user-doc -->
|
||||
* @param object the target of the switch.
|
||||
* @return the result of interpreting the object as an instance of '<em>Model</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseModel(Model object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Type Declaration</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns null;
|
||||
* returning a non-null result will terminate the switch.
|
||||
* <!-- end-user-doc -->
|
||||
* @param object the target of the switch.
|
||||
* @return the result of interpreting the object as an instance of '<em>Type Declaration</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseTypeDeclaration(TypeDeclaration object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Property</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns null;
|
||||
* returning a non-null result will terminate the switch.
|
||||
* <!-- end-user-doc -->
|
||||
* @param object the target of the switch.
|
||||
* @return the result of interpreting the object as an instance of '<em>Property</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseProperty(Property object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Type</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns null;
|
||||
* returning a non-null result will terminate the switch.
|
||||
* <!-- end-user-doc -->
|
||||
* @param object the target of the switch.
|
||||
* @return the result of interpreting the object as an instance of '<em>Type</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseType(Type object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Type Reference</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns null;
|
||||
* returning a non-null result will terminate the switch.
|
||||
* <!-- end-user-doc -->
|
||||
* @param object the target of the switch.
|
||||
* @return the result of interpreting the object as an instance of '<em>Type Reference</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseTypeReference(TypeReference object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Primitive Type</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns null;
|
||||
* returning a non-null result will terminate the switch.
|
||||
* <!-- end-user-doc -->
|
||||
* @param object the target of the switch.
|
||||
* @return the result of interpreting the object as an instance of '<em>Primitive Type</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T casePrimitiveType(PrimitiveType object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns null;
|
||||
* returning a non-null result will terminate the switch, but this is the last case anyway.
|
||||
* <!-- end-user-doc -->
|
||||
* @param object the target of the switch.
|
||||
* @return the result of interpreting the object as an instance of '<em>EObject</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject)
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public T defaultCase(EObject object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
} //TestLanguageSwitch
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.testlanguage.validation;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.eclipse.emf.ecore.EPackage;
|
||||
import org.eclipse.xtext.validation.AbstractDeclarativeValidator;
|
||||
|
||||
public abstract class AbstractTestLanguageValidator extends AbstractDeclarativeValidator {
|
||||
|
||||
@Override
|
||||
protected List<EPackage> getEPackages() {
|
||||
List<EPackage> result = new ArrayList<EPackage>();
|
||||
result.add(org.eclipse.xtext.ide.tests.testlanguage.testLanguage.TestLanguagePackage.eINSTANCE);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
module org.eclipse.xtext.ide.tests.testlanguage.GenerateTestLanguage
|
||||
|
||||
import org.eclipse.xtext.xtext.generator.*
|
||||
import org.eclipse.xtext.xtext.generator.model.project.*
|
||||
|
||||
var rootPath = ".."
|
||||
var baseName = "org.eclipse.xtext.ide.tests"
|
||||
|
||||
Workflow {
|
||||
|
||||
component = XtextGenerator {
|
||||
configuration = {
|
||||
project = StandardProjectConfig {
|
||||
baseName = baseName
|
||||
rootPath = rootPath
|
||||
genericIde = {
|
||||
enabled = true
|
||||
src = "${rootPath}/${baseName}/testlang-src"
|
||||
srcGen = "${rootPath}/${baseName}/testlang-src-gen"
|
||||
name = baseName
|
||||
}
|
||||
runtime = {
|
||||
src = "${rootPath}/${baseName}/testlang-src"
|
||||
srcGen = "${rootPath}/${baseName}/testlang-src-gen"
|
||||
}
|
||||
createEclipseMetaData = false
|
||||
}
|
||||
code = {
|
||||
encoding = "UTF-8"
|
||||
fileHeader =
|
||||
"/*
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
"
|
||||
}
|
||||
}
|
||||
language = StandardLanguage {
|
||||
name = "org.eclipse.xtext.ide.tests.testlanguage.TestLanguage"
|
||||
fileExtensions = "testlang"
|
||||
|
||||
serializer = {
|
||||
generateStub = false
|
||||
}
|
||||
validator = {
|
||||
// composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
grammar org.eclipse.xtext.ide.tests.testlanguage.TestLanguage with org.eclipse.xtext.common.Terminals
|
||||
|
||||
generate testLanguage "http://www.eclipse.org/xtext/ide/tests/testlanguage/TestLanguage"
|
||||
|
||||
Model:
|
||||
types+=TypeDeclaration*;
|
||||
|
||||
TypeDeclaration:
|
||||
'type' name=ID '{'
|
||||
properties+=Property*
|
||||
'}';
|
||||
|
||||
Property:
|
||||
name=ID type=Type
|
||||
;
|
||||
|
||||
Type :
|
||||
(TypeReference |
|
||||
PrimitiveType) (arrayDiemensions+='['']')*
|
||||
;
|
||||
|
||||
TypeReference:
|
||||
typeRef=[Type]
|
||||
;
|
||||
|
||||
PrimitiveType:
|
||||
name=('string'|'int'|'boolean')
|
||||
;
|
|
@ -0,0 +1,15 @@
|
|||
/*
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.testlanguage
|
||||
|
||||
|
||||
/**
|
||||
* Use this class to register components to be used at runtime / without the Equinox extension registry.
|
||||
*/
|
||||
class TestLanguageRuntimeModule extends AbstractTestLanguageRuntimeModule {
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.testlanguage
|
||||
|
||||
|
||||
/**
|
||||
* Initialization support for running Xtext languages without Equinox extension registry.
|
||||
*/
|
||||
class TestLanguageStandaloneSetup extends TestLanguageStandaloneSetupGenerated {
|
||||
|
||||
def static void doSetup() {
|
||||
new TestLanguageStandaloneSetup().createInjectorAndDoEMFRegistration()
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.testlanguage.generator
|
||||
|
||||
import org.eclipse.emf.ecore.resource.Resource
|
||||
import org.eclipse.xtext.generator.AbstractGenerator
|
||||
import org.eclipse.xtext.generator.IFileSystemAccess2
|
||||
import org.eclipse.xtext.generator.IGeneratorContext
|
||||
|
||||
/**
|
||||
* Generates code from your model files on save.
|
||||
*
|
||||
* See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#code-generation
|
||||
*/
|
||||
class TestLanguageGenerator extends AbstractGenerator {
|
||||
|
||||
override void doGenerate(Resource resource, IFileSystemAccess2 fsa, IGeneratorContext context) {
|
||||
// fsa.generateFile('greetings.txt', 'People to greet: ' +
|
||||
// resource.allContents
|
||||
// .filter(typeof(Greeting))
|
||||
// .map[name]
|
||||
// .join(', '))
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.testlanguage.scoping
|
||||
|
||||
|
||||
/**
|
||||
* This class contains custom scoping description.
|
||||
*
|
||||
* See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#scoping
|
||||
* on how and when to use it.
|
||||
*/
|
||||
class TestLanguageScopeProvider extends AbstractTestLanguageScopeProvider {
|
||||
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Copyright (c) 2016 TypeFox GmbH (http://www.typefox.io) 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
|
||||
*/
|
||||
package org.eclipse.xtext.ide.tests.testlanguage.validation
|
||||
|
||||
|
||||
/**
|
||||
* This class contains custom validation rules.
|
||||
*
|
||||
* See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#validation
|
||||
*/
|
||||
class TestLanguageValidator extends AbstractTestLanguageValidator {
|
||||
|
||||
// public static val INVALID_NAME = 'invalidName'
|
||||
//
|
||||
// @Check
|
||||
// def checkGreetingStartsWithCapital(Greeting greeting) {
|
||||
// if (!Character.isUpperCase(greeting.name.charAt(0))) {
|
||||
// warning('Name should start with a capital',
|
||||
// TestLanguagePackage.Literals.GREETING__NAME,
|
||||
// INVALID_NAME)
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
Loading…
Reference in a new issue