rgen 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. data/CHANGELOG +20 -1
  2. data/MIT-LICENSE +1 -1
  3. data/README +12 -9
  4. data/lib/instantiators/ea_instantiator.rb +36 -0
  5. data/lib/metamodels/uml13_metamodel.rb +559 -0
  6. data/lib/metamodels/uml13_metamodel_ext.rb +26 -0
  7. data/lib/mmgen/metamodel_generator.rb +5 -5
  8. data/lib/mmgen/mm_ext/ecore_ext.rb +95 -0
  9. data/lib/mmgen/mmgen.rb +6 -4
  10. data/lib/mmgen/templates/annotations.tpl +37 -0
  11. data/lib/mmgen/templates/metamodel_generator.tpl +171 -0
  12. data/lib/rgen/ecore/ecore.rb +190 -0
  13. data/lib/rgen/ecore/ecore_instantiator.rb +25 -0
  14. data/lib/rgen/ecore/ecore_transformer.rb +85 -0
  15. data/lib/rgen/environment.rb +9 -24
  16. data/lib/rgen/find_helper.rb +68 -0
  17. data/lib/rgen/{instantiator.rb → instantiator/abstract_instantiator.rb} +6 -2
  18. data/lib/rgen/instantiator/abstract_xml_instantiator.rb +59 -0
  19. data/lib/rgen/instantiator/default_xml_instantiator.rb +117 -0
  20. data/lib/rgen/instantiator/ecore_xml_instantiator.rb +144 -0
  21. data/lib/rgen/instantiator/nodebased_xml_instantiator.rb +157 -0
  22. data/lib/rgen/instantiator/xmi11_instantiator.rb +164 -0
  23. data/lib/rgen/metamodel_builder.rb +103 -9
  24. data/lib/rgen/metamodel_builder/build_helper.rb +26 -4
  25. data/lib/rgen/metamodel_builder/builder_extensions.rb +285 -88
  26. data/lib/rgen/metamodel_builder/builder_runtime.rb +7 -1
  27. data/lib/rgen/metamodel_builder/data_types.rb +67 -0
  28. data/lib/rgen/metamodel_builder/intermediate/annotation.rb +30 -0
  29. data/lib/rgen/metamodel_builder/metamodel_description.rb +232 -0
  30. data/lib/rgen/metamodel_builder/mm_multiple.rb +23 -0
  31. data/lib/rgen/metamodel_builder/module_extension.rb +33 -0
  32. data/lib/rgen/model_comparator.rb +56 -0
  33. data/lib/rgen/model_dumper.rb +5 -5
  34. data/lib/rgen/name_helper.rb +17 -1
  35. data/lib/rgen/template_language.rb +148 -28
  36. data/lib/rgen/template_language/directory_template_container.rb +56 -38
  37. data/lib/rgen/template_language/output_handler.rb +93 -77
  38. data/lib/rgen/template_language/template_container.rb +186 -143
  39. data/lib/rgen/transformer.rb +19 -14
  40. data/lib/transformers/uml13_to_ecore.rb +75 -0
  41. data/redist/xmlscan/ChangeLog +1301 -0
  42. data/redist/xmlscan/README +34 -0
  43. data/redist/xmlscan/THANKS +11 -0
  44. data/redist/xmlscan/doc/changes.html +74 -0
  45. data/redist/xmlscan/doc/changes.rd +80 -0
  46. data/redist/xmlscan/doc/en/conformance.html +136 -0
  47. data/redist/xmlscan/doc/en/conformance.rd +152 -0
  48. data/redist/xmlscan/doc/en/manual.html +356 -0
  49. data/redist/xmlscan/doc/en/manual.rd +402 -0
  50. data/redist/xmlscan/doc/ja/conformance.ja.html +118 -0
  51. data/redist/xmlscan/doc/ja/conformance.ja.rd +134 -0
  52. data/redist/xmlscan/doc/ja/manual.ja.html +325 -0
  53. data/redist/xmlscan/doc/ja/manual.ja.rd +370 -0
  54. data/redist/xmlscan/doc/src/Makefile +41 -0
  55. data/redist/xmlscan/doc/src/conformance.rd.src +256 -0
  56. data/redist/xmlscan/doc/src/langsplit.rb +110 -0
  57. data/redist/xmlscan/doc/src/manual.rd.src +614 -0
  58. data/redist/xmlscan/install.rb +41 -0
  59. data/redist/xmlscan/lib/xmlscan/encoding.rb +311 -0
  60. data/redist/xmlscan/lib/xmlscan/htmlscan.rb +289 -0
  61. data/redist/xmlscan/lib/xmlscan/namespace.rb +352 -0
  62. data/redist/xmlscan/lib/xmlscan/parser.rb +299 -0
  63. data/redist/xmlscan/lib/xmlscan/scanner.rb +1109 -0
  64. data/redist/xmlscan/lib/xmlscan/version.rb +22 -0
  65. data/redist/xmlscan/lib/xmlscan/visitor.rb +158 -0
  66. data/redist/xmlscan/lib/xmlscan/xmlchar.rb +441 -0
  67. data/redist/xmlscan/memo/CONFORMANCE +1249 -0
  68. data/redist/xmlscan/memo/PRODUCTIONS +195 -0
  69. data/redist/xmlscan/memo/contentspec.ry +335 -0
  70. data/redist/xmlscan/samples/chibixml.rb +105 -0
  71. data/redist/xmlscan/samples/getxmlchar.rb +122 -0
  72. data/redist/xmlscan/samples/rexml.rb +159 -0
  73. data/redist/xmlscan/samples/xmlbench.rb +88 -0
  74. data/redist/xmlscan/samples/xmlbench/parser/chibixml.rb +22 -0
  75. data/redist/xmlscan/samples/xmlbench/parser/nqxml.rb +29 -0
  76. data/redist/xmlscan/samples/xmlbench/parser/rexml.rb +62 -0
  77. data/redist/xmlscan/samples/xmlbench/parser/xmlparser.rb +22 -0
  78. data/redist/xmlscan/samples/xmlbench/parser/xmlscan-0.0.10.rb +62 -0
  79. data/redist/xmlscan/samples/xmlbench/parser/xmlscan-chibixml.rb +22 -0
  80. data/redist/xmlscan/samples/xmlbench/parser/xmlscan-rexml.rb +22 -0
  81. data/redist/xmlscan/samples/xmlbench/parser/xmlscan.rb +99 -0
  82. data/redist/xmlscan/samples/xmlbench/xmlbench-lib.rb +116 -0
  83. data/redist/xmlscan/samples/xmlconftest.rb +200 -0
  84. data/redist/xmlscan/test.rb +7 -0
  85. data/redist/xmlscan/tests/deftestcase.rb +73 -0
  86. data/redist/xmlscan/tests/runtest.rb +47 -0
  87. data/redist/xmlscan/tests/testall.rb +14 -0
  88. data/redist/xmlscan/tests/testencoding.rb +438 -0
  89. data/redist/xmlscan/tests/testhtmlscan.rb +752 -0
  90. data/redist/xmlscan/tests/testnamespace.rb +457 -0
  91. data/redist/xmlscan/tests/testparser.rb +591 -0
  92. data/redist/xmlscan/tests/testscanner.rb +1749 -0
  93. data/redist/xmlscan/tests/testxmlchar.rb +143 -0
  94. data/redist/xmlscan/tests/visitor.rb +34 -0
  95. data/test/array_extensions_test.rb +2 -2
  96. data/test/ea_instantiator_test.rb +41 -0
  97. data/test/ecore_self_test.rb +53 -0
  98. data/test/environment_test.rb +11 -6
  99. data/test/metamodel_builder_test.rb +404 -245
  100. data/test/metamodel_roundtrip_test.rb +52 -0
  101. data/test/metamodel_roundtrip_test/TestModel.rb +65 -0
  102. data/test/metamodel_roundtrip_test/TestModel_Regenerated.rb +64 -0
  103. data/test/metamodel_roundtrip_test/houseMetamodel.ecore +32 -0
  104. data/test/metamodel_roundtrip_test/houseMetamodel_from_ecore.rb +39 -0
  105. data/test/rgen_test.rb +3 -3
  106. data/test/template_language_test.rb +65 -39
  107. data/test/template_language_test/expected_result.txt +24 -3
  108. data/test/template_language_test/templates/code/array.tpl +11 -0
  109. data/test/template_language_test/templates/content/author.tpl +7 -0
  110. data/test/template_language_test/templates/content/chapter.tpl +1 -1
  111. data/test/template_language_test/templates/root.tpl +17 -8
  112. data/test/template_language_test/testout.txt +24 -3
  113. data/test/testmodel/class_model_checker.rb +119 -0
  114. data/test/{xmi_instantiator_test/testmodel.eap → testmodel/ea_testmodel.eap} +0 -0
  115. data/test/{xmi_instantiator_test/testmodel.xml → testmodel/ea_testmodel.xml} +81 -14
  116. data/test/testmodel/ea_testmodel_partial.xml +317 -0
  117. data/test/testmodel/ecore_model_checker.rb +101 -0
  118. data/test/testmodel/manual_testmodel.xml +22 -0
  119. data/test/testmodel/object_model_checker.rb +67 -0
  120. data/test/transformer_test.rb +18 -10
  121. data/test/xml_instantiator_test.rb +81 -8
  122. data/test/xml_instantiator_test/simple_ecore_model_checker.rb +94 -0
  123. data/test/xml_instantiator_test/simple_xmi_ecore_instantiator.rb +53 -0
  124. data/test/xml_instantiator_test/simple_xmi_metamodel.rb +49 -0
  125. data/test/xml_instantiator_test/simple_xmi_to_ecore.rb +75 -0
  126. metadata +126 -28
  127. data/lib/ea/xmi_class_instantiator.rb +0 -46
  128. data/lib/ea/xmi_helper.rb +0 -26
  129. data/lib/ea/xmi_metamodel.rb +0 -34
  130. data/lib/ea/xmi_object_instantiator.rb +0 -46
  131. data/lib/ea/xmi_to_classmodel.rb +0 -78
  132. data/lib/ea/xmi_to_objectmodel.rb +0 -92
  133. data/lib/mmgen/mm_ext/uml_classmodel_ext.rb +0 -71
  134. data/lib/mmgen/templates/uml_classmodel.tpl +0 -63
  135. data/lib/rgen/xml_instantiator.rb +0 -132
  136. data/lib/uml/objectmodel_instantiator.rb +0 -53
  137. data/lib/uml/uml_classmodel.rb +0 -92
  138. data/lib/uml/uml_objectmodel.rb +0 -65
  139. data/test/metamodel_generator_test.rb +0 -44
  140. data/test/metamodel_generator_test/TestModel.rb +0 -40
  141. data/test/metamodel_generator_test/expected_result.txt +0 -40
  142. data/test/xmi_class_instantiator_test.rb +0 -24
  143. data/test/xmi_instantiator_test/class_model_checker.rb +0 -97
  144. data/test/xmi_object_instantiator_test.rb +0 -65
  145. data/test/xml_instantiator_test/testmodel.xml +0 -7
@@ -0,0 +1,53 @@
1
+ require 'rgen/instantiator/default_xml_instantiator'
2
+ require 'rgen/environment'
3
+ require 'rgen/ecore/ecore'
4
+ require 'xml_instantiator_test/simple_xmi_metamodel'
5
+
6
+ # SimpleXMIECoreInstantiator demonstrates the usage of the DefaultXMLInstantiator.
7
+ # It can be used to instantiate an ECore model from an XMI description
8
+ # produced by Enterprise Architect.
9
+ #
10
+ # Note however, that this is *not* the recommended way to read an EA model.
11
+ # See EAInstantiatorTest for the clean way to do this.
12
+ #
13
+ # This example shows how arbitrary XML content can be used to instantiate
14
+ # an implicit metamodel. The resulting model is transformed into a simple
15
+ # ECore model.
16
+ #
17
+ # See XMLInstantiatorTest for an example of how to use this class.
18
+ #
19
+ class SimpleXMIECoreInstantiator < RGen::Instantiator::DefaultXMLInstantiator
20
+
21
+ map_tag_ns "omg.org/UML1.3", SimpleXMIMetaModel::UML
22
+
23
+ resolve_by_id :typeClass, :src => :type, :id => :xmi_id
24
+ resolve_by_id :subtypeClass, :src => :subtype, :id => :xmi_id
25
+ resolve_by_id :supertypeClass, :src => :supertype, :id => :xmi_id
26
+
27
+ def initialize
28
+ @envXMI = RGen::Environment.new
29
+ super(@envXMI, SimpleXMIMetaModel, true)
30
+ end
31
+
32
+ def new_object(node)
33
+ if node.tag == "EAStub"
34
+ class_name = saneClassName(node.attributes["UMLType"])
35
+ mod = XMIMetaModel::UML
36
+ build_on_error(NameError, :build_class, class_name, mod) do
37
+ mod.const_get(class_name).new
38
+ end
39
+ else
40
+ super
41
+ end
42
+ end
43
+
44
+ # This method does the actual work.
45
+ def instantiateECoreModel(envOut, str)
46
+ instantiate(str)
47
+
48
+ require 'xml_instantiator_test/simple_xmi_to_ecore'
49
+
50
+ SimpleXmiToECore.new(@envXMI,envOut).transform
51
+ end
52
+
53
+ end
@@ -0,0 +1,49 @@
1
+ # This is an extension of the implicit metamodel created by the
2
+ # DefaultXMLInstantiator when it reads an Enterprise Architect
3
+ # XMI file.
4
+ #
5
+ module SimpleXMIMetaModel
6
+
7
+ module UML
8
+ include RGen::MetamodelBuilder
9
+
10
+ class Classifier_feature < MMBase
11
+ end
12
+
13
+ class ClassifierRole < MMBase
14
+ end
15
+
16
+ class Clazz < ClassifierRole
17
+ end
18
+
19
+ class Interface < ClassifierRole
20
+ end
21
+
22
+ class Operation < MMBase
23
+ end
24
+
25
+ class Generalization < MMBase
26
+ end
27
+
28
+ class ModelElement_stereotype < MMBase
29
+ end
30
+
31
+ class AssociationEnd < MMBase
32
+ module ClassModule
33
+ def otherEnd
34
+ parent.associationEnd.find{|ae| ae != self}
35
+ end
36
+ end
37
+ end
38
+
39
+ class AssociationEndRole < MMBase
40
+ end
41
+
42
+ ClassifierRole.one_to_many 'associationEnds', AssociationEnd, 'typeClass'
43
+ ClassifierRole.one_to_many 'associationEndRoles', AssociationEndRole, 'typeClass'
44
+ Clazz.one_to_many 'generalizationsAsSubtype', Generalization, 'subtypeClass'
45
+ Clazz.one_to_many 'generalizationsAsSupertype', Generalization, 'supertypeClass'
46
+
47
+ end
48
+
49
+ end
@@ -0,0 +1,75 @@
1
+ require 'rgen/transformer'
2
+ require 'rgen/ecore/ecore'
3
+ require 'rgen/array_extensions'
4
+ require 'xml_instantiator_test/simple_xmi_metamodel'
5
+
6
+ class SimpleXmiToECore < RGen::Transformer
7
+ include RGen::ECore
8
+
9
+ class MapHelper
10
+ def initialize(keyMethod,valueMethod,elements)
11
+ @keyMethod, @valueMethod, @elements = keyMethod, valueMethod, elements
12
+ end
13
+ def [](key)
14
+ return @elements.select{|e| e.send(@keyMethod) == key}.first.send(@valueMethod) rescue NoMethodError
15
+ nil
16
+ end
17
+ end
18
+
19
+ class TaggedValueHelper < MapHelper
20
+ def initialize(element)
21
+ super('tag','value',element.modelElement_taggedValue.taggedValue)
22
+ end
23
+ end
24
+
25
+ # Do the actual transformation.
26
+ # Input and output environment have to be provided to the transformer constructor.
27
+ def transform
28
+ trans(:class => SimpleXMIMetaModel::UML::Clazz)
29
+ end
30
+
31
+ transform SimpleXMIMetaModel::UML::Package, :to => EPackage do
32
+ { :name => name,
33
+ :eSuperPackage => trans(parent.parent.is_a?(SimpleXMIMetaModel::UML::Package) ? parent.parent : nil) }
34
+ end
35
+
36
+ transform SimpleXMIMetaModel::UML::Clazz, :to => EClass do
37
+ { :name => name,
38
+ :ePackage => trans(parent.parent.is_a?(SimpleXMIMetaModel::UML::Package) ? parent.parent : nil),
39
+ :eStructuralFeatures => trans(classifier_feature.attribute + associationEnds),
40
+ :eOperations => trans(classifier_feature.operation),
41
+ :eSuperTypes => trans(generalizationsAsSubtype.supertypeClass),
42
+ :eAnnotations => [ EAnnotation.new(:details => trans(modelElement_taggedValue.taggedValue)) ] }
43
+ end
44
+
45
+ transform SimpleXMIMetaModel::UML::TaggedValue, :to => EStringToStringMapEntry do
46
+ { :key => tag, :value => value}
47
+ end
48
+
49
+ transform SimpleXMIMetaModel::UML::Attribute, :to => EAttribute do
50
+ typemap = { "String" => EString, "boolean" => EBoolean, "int" => EInt, "float" => EFloat }
51
+ tv = TaggedValueHelper.new(@current_object)
52
+ { :name => name, :eType => typemap[tv['type']],
53
+ :eAnnotations => [ EAnnotation.new(:details => trans(modelElement_taggedValue.taggedValue)) ] }
54
+ end
55
+
56
+ transform SimpleXMIMetaModel::UML::Operation, :to => EOperation do
57
+ { :name => name }
58
+ end
59
+
60
+ transform SimpleXMIMetaModel::UML::AssociationEnd, :to => EReference, :if => :isReference do
61
+ { :eType => trans(otherEnd.typeClass),
62
+ :name => otherEnd.name,
63
+ :eOpposite => trans(otherEnd),
64
+ :lowerBound => (otherEnd.multiplicity || '0').split('..').first.to_i,
65
+ :upperBound => (otherEnd.multiplicity || '1').split('..').last.gsub('*','-1').to_i,
66
+ :containment => (aggregation == 'composite'),
67
+ :eAnnotations => [ EAnnotation.new(:details => trans(modelElement_taggedValue.taggedValue)) ] }
68
+ end
69
+
70
+ method :isReference do
71
+ otherEnd.isNavigable == 'true' ||
72
+ # composite assocations are bidirectional
73
+ aggregation == 'composite' || otherEnd.aggregation == 'composite'
74
+ end
75
+ end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: rgen
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.3.0
7
- date: 2006-10-08 00:00:00 +02:00
6
+ version: 0.4.0
7
+ date: 2007-08-08 00:00:00 +02:00
8
8
  summary: Ruby Modelling and Generator Framework
9
9
  require_paths:
10
10
  - lib
@@ -29,75 +29,167 @@ post_install_message:
29
29
  authors:
30
30
  - Martin Thiede
31
31
  files:
32
- - lib/ea
32
+ - lib/instantiators
33
+ - lib/metamodels
33
34
  - lib/mmgen
34
35
  - lib/rgen
35
- - lib/uml
36
- - lib/ea/xmi_class_instantiator.rb
37
- - lib/ea/xmi_helper.rb
38
- - lib/ea/xmi_metamodel.rb
39
- - lib/ea/xmi_object_instantiator.rb
40
- - lib/ea/xmi_to_classmodel.rb
41
- - lib/ea/xmi_to_objectmodel.rb
36
+ - lib/transformers
37
+ - lib/instantiators/ea_instantiator.rb
38
+ - lib/metamodels/uml13_metamodel.rb
39
+ - lib/metamodels/uml13_metamodel_ext.rb
42
40
  - lib/mmgen/metamodel_generator.rb
43
41
  - lib/mmgen/mmgen.rb
44
42
  - lib/mmgen/mm_ext
45
43
  - lib/mmgen/templates
46
- - lib/mmgen/mm_ext/uml_classmodel_ext.rb
47
- - lib/mmgen/templates/uml_classmodel.tpl
44
+ - lib/mmgen/mm_ext/ecore_ext.rb
45
+ - lib/mmgen/templates/annotations.tpl
46
+ - lib/mmgen/templates/metamodel_generator.tpl
48
47
  - lib/rgen/array_extensions.rb
49
48
  - lib/rgen/auto_class_creator.rb
49
+ - lib/rgen/ecore
50
50
  - lib/rgen/environment.rb
51
- - lib/rgen/instantiator.rb
51
+ - lib/rgen/find_helper.rb
52
+ - lib/rgen/instantiator
52
53
  - lib/rgen/metamodel_builder
53
54
  - lib/rgen/metamodel_builder.rb
55
+ - lib/rgen/model_comparator.rb
54
56
  - lib/rgen/model_dumper.rb
55
57
  - lib/rgen/name_helper.rb
56
58
  - lib/rgen/template_language
57
59
  - lib/rgen/template_language.rb
58
60
  - lib/rgen/transformer.rb
59
- - lib/rgen/xml_instantiator.rb
61
+ - lib/rgen/ecore/ecore.rb
62
+ - lib/rgen/ecore/ecore_instantiator.rb
63
+ - lib/rgen/ecore/ecore_transformer.rb
64
+ - lib/rgen/instantiator/abstract_instantiator.rb
65
+ - lib/rgen/instantiator/abstract_xml_instantiator.rb
66
+ - lib/rgen/instantiator/default_xml_instantiator.rb
67
+ - lib/rgen/instantiator/ecore_xml_instantiator.rb
68
+ - lib/rgen/instantiator/nodebased_xml_instantiator.rb
69
+ - lib/rgen/instantiator/xmi11_instantiator.rb
60
70
  - lib/rgen/metamodel_builder/builder_extensions.rb
61
71
  - lib/rgen/metamodel_builder/builder_runtime.rb
62
72
  - lib/rgen/metamodel_builder/build_helper.rb
73
+ - lib/rgen/metamodel_builder/data_types.rb
74
+ - lib/rgen/metamodel_builder/intermediate
75
+ - lib/rgen/metamodel_builder/metamodel_description.rb
76
+ - lib/rgen/metamodel_builder/mm_multiple.rb
77
+ - lib/rgen/metamodel_builder/module_extension.rb
78
+ - lib/rgen/metamodel_builder/intermediate/annotation.rb
63
79
  - lib/rgen/template_language/directory_template_container.rb
64
80
  - lib/rgen/template_language/output_handler.rb
65
81
  - lib/rgen/template_language/template_container.rb
66
82
  - lib/rgen/template_language/template_helper.rb
67
- - lib/uml/objectmodel_instantiator.rb
68
- - lib/uml/uml_classmodel.rb
69
- - lib/uml/uml_objectmodel.rb
83
+ - lib/transformers/uml13_to_ecore.rb
70
84
  - test/array_extensions_test.rb
85
+ - test/ea_instantiator_test.rb
86
+ - test/ecore_self_test.rb
71
87
  - test/environment_test.rb
72
88
  - test/metamodel_builder_test.rb
73
- - test/metamodel_generator_test
74
- - test/metamodel_generator_test.rb
89
+ - test/metamodel_roundtrip_test
90
+ - test/metamodel_roundtrip_test.rb
75
91
  - test/output_handler_test.rb
76
92
  - test/rgen_test.rb
77
93
  - test/template_language_test
78
94
  - test/template_language_test.rb
95
+ - test/testmodel
79
96
  - test/transformer_test.rb
80
- - test/xmi_class_instantiator_test.rb
81
- - test/xmi_instantiator_test
82
- - test/xmi_object_instantiator_test.rb
83
97
  - test/xml_instantiator_test
84
98
  - test/xml_instantiator_test.rb
85
- - test/metamodel_generator_test/expected_result.txt
86
- - test/metamodel_generator_test/TestModel.rb
99
+ - test/metamodel_roundtrip_test/houseMetamodel.ecore
100
+ - test/metamodel_roundtrip_test/houseMetamodel_from_ecore.rb
101
+ - test/metamodel_roundtrip_test/TestModel.rb
102
+ - test/metamodel_roundtrip_test/TestModel_Regenerated.rb
87
103
  - test/template_language_test/expected_result.txt
88
104
  - test/template_language_test/templates
89
105
  - test/template_language_test/testout.txt
106
+ - test/template_language_test/templates/code
90
107
  - test/template_language_test/templates/content
91
108
  - test/template_language_test/templates/index
92
109
  - test/template_language_test/templates/root.tpl
110
+ - test/template_language_test/templates/code/array.tpl
111
+ - test/template_language_test/templates/content/author.tpl
93
112
  - test/template_language_test/templates/content/chapter.tpl
94
113
  - test/template_language_test/templates/index/c
95
114
  - test/template_language_test/templates/index/chapter.tpl
96
115
  - test/template_language_test/templates/index/c/cmod.tpl
97
- - test/xmi_instantiator_test/class_model_checker.rb
98
- - test/xmi_instantiator_test/testmodel.eap
99
- - test/xmi_instantiator_test/testmodel.xml
100
- - test/xml_instantiator_test/testmodel.xml
116
+ - test/testmodel/class_model_checker.rb
117
+ - test/testmodel/ea_testmodel.eap
118
+ - test/testmodel/ea_testmodel.xml
119
+ - test/testmodel/ea_testmodel_partial.xml
120
+ - test/testmodel/ecore_model_checker.rb
121
+ - test/testmodel/manual_testmodel.xml
122
+ - test/testmodel/object_model_checker.rb
123
+ - test/xml_instantiator_test/simple_ecore_model_checker.rb
124
+ - test/xml_instantiator_test/simple_xmi_ecore_instantiator.rb
125
+ - test/xml_instantiator_test/simple_xmi_metamodel.rb
126
+ - test/xml_instantiator_test/simple_xmi_to_ecore.rb
127
+ - redist/xmlscan
128
+ - redist/xmlscan/ChangeLog
129
+ - redist/xmlscan/doc
130
+ - redist/xmlscan/install.rb
131
+ - redist/xmlscan/lib
132
+ - redist/xmlscan/memo
133
+ - redist/xmlscan/README
134
+ - redist/xmlscan/samples
135
+ - redist/xmlscan/test.rb
136
+ - redist/xmlscan/tests
137
+ - redist/xmlscan/THANKS
138
+ - redist/xmlscan/doc/changes.html
139
+ - redist/xmlscan/doc/changes.rd
140
+ - redist/xmlscan/doc/en
141
+ - redist/xmlscan/doc/ja
142
+ - redist/xmlscan/doc/src
143
+ - redist/xmlscan/doc/en/conformance.html
144
+ - redist/xmlscan/doc/en/conformance.rd
145
+ - redist/xmlscan/doc/en/manual.html
146
+ - redist/xmlscan/doc/en/manual.rd
147
+ - redist/xmlscan/doc/ja/conformance.ja.html
148
+ - redist/xmlscan/doc/ja/conformance.ja.rd
149
+ - redist/xmlscan/doc/ja/manual.ja.html
150
+ - redist/xmlscan/doc/ja/manual.ja.rd
151
+ - redist/xmlscan/doc/src/conformance.rd.src
152
+ - redist/xmlscan/doc/src/langsplit.rb
153
+ - redist/xmlscan/doc/src/Makefile
154
+ - redist/xmlscan/doc/src/manual.rd.src
155
+ - redist/xmlscan/lib/xmlscan
156
+ - redist/xmlscan/lib/xmlscan/encoding.rb
157
+ - redist/xmlscan/lib/xmlscan/htmlscan.rb
158
+ - redist/xmlscan/lib/xmlscan/namespace.rb
159
+ - redist/xmlscan/lib/xmlscan/parser.rb
160
+ - redist/xmlscan/lib/xmlscan/scanner.rb
161
+ - redist/xmlscan/lib/xmlscan/version.rb
162
+ - redist/xmlscan/lib/xmlscan/visitor.rb
163
+ - redist/xmlscan/lib/xmlscan/xmlchar.rb
164
+ - redist/xmlscan/memo/CONFORMANCE
165
+ - redist/xmlscan/memo/contentspec.ry
166
+ - redist/xmlscan/memo/PRODUCTIONS
167
+ - redist/xmlscan/samples/chibixml.rb
168
+ - redist/xmlscan/samples/getxmlchar.rb
169
+ - redist/xmlscan/samples/rexml.rb
170
+ - redist/xmlscan/samples/xmlbench
171
+ - redist/xmlscan/samples/xmlbench.rb
172
+ - redist/xmlscan/samples/xmlconftest.rb
173
+ - redist/xmlscan/samples/xmlbench/parser
174
+ - redist/xmlscan/samples/xmlbench/xmlbench-lib.rb
175
+ - redist/xmlscan/samples/xmlbench/parser/chibixml.rb
176
+ - redist/xmlscan/samples/xmlbench/parser/nqxml.rb
177
+ - redist/xmlscan/samples/xmlbench/parser/rexml.rb
178
+ - redist/xmlscan/samples/xmlbench/parser/xmlparser.rb
179
+ - redist/xmlscan/samples/xmlbench/parser/xmlscan-0.0.10.rb
180
+ - redist/xmlscan/samples/xmlbench/parser/xmlscan-chibixml.rb
181
+ - redist/xmlscan/samples/xmlbench/parser/xmlscan-rexml.rb
182
+ - redist/xmlscan/samples/xmlbench/parser/xmlscan.rb
183
+ - redist/xmlscan/tests/deftestcase.rb
184
+ - redist/xmlscan/tests/runtest.rb
185
+ - redist/xmlscan/tests/testall.rb
186
+ - redist/xmlscan/tests/testencoding.rb
187
+ - redist/xmlscan/tests/testhtmlscan.rb
188
+ - redist/xmlscan/tests/testnamespace.rb
189
+ - redist/xmlscan/tests/testparser.rb
190
+ - redist/xmlscan/tests/testscanner.rb
191
+ - redist/xmlscan/tests/testxmlchar.rb
192
+ - redist/xmlscan/tests/visitor.rb
101
193
  - README
102
194
  - CHANGELOG
103
195
  - MIT-LICENSE
@@ -106,6 +198,12 @@ test_files: []
106
198
  rdoc_options:
107
199
  - --main
108
200
  - README
201
+ - -x
202
+ - redist
203
+ - -x
204
+ - test
205
+ - -x
206
+ - metamodels
109
207
  extra_rdoc_files:
110
208
  - README
111
209
  - CHANGELOG
@@ -1,46 +0,0 @@
1
- require 'rgen/xml_instantiator'
2
- require 'rgen/environment'
3
- require 'uml/uml_classmodel'
4
- require 'ea/xmi_metamodel'
5
-
6
- # This module can be used to instantiate an UMLClassModel from an XMI description.
7
- #
8
- # Here is an example:
9
- #
10
- # envUML = RGen::Environment.new
11
- # File.open(MODEL_DIR+"/testmodel.xml") { |f|
12
- # XMIClassInstantiator.new.instantiateUMLClassModel(envUML, f.read)
13
- # }
14
- #
15
- # # now use the newly created UML model
16
- # envUML.find(:class => UMLClassModel::UMLClass).each { |c|
17
- # puts c.name
18
- # }
19
- #
20
- # This module relies on XmiToClassmodel to do the actual transformation.
21
- #
22
- class XMIClassInstantiator < RGen::XMLInstantiator
23
-
24
- include UMLClassModel
25
-
26
- map_tag_ns "omg.org/UML1.3", XMIMetaModel::UML
27
-
28
- resolve_by_id :typeClass, :src => :type, :id => :xmi_id
29
- resolve_by_id :subtypeClass, :src => :subtype, :id => :xmi_id
30
- resolve_by_id :supertypeClass, :src => :supertype, :id => :xmi_id
31
-
32
- def initialize
33
- @envXMI = RGen::Environment.new
34
- super(@envXMI, XMIMetaModel, true)
35
- end
36
-
37
- # This method does the actual work.
38
- def instantiateUMLClassModel(envOut, str)
39
- instantiate(str)
40
-
41
- require 'ea/xmi_to_classmodel'
42
-
43
- XmiToClassmodel.new(@envXMI,envOut).transform
44
- end
45
-
46
- end
data/lib/ea/xmi_helper.rb DELETED
@@ -1,26 +0,0 @@
1
- require 'rgen/metamodel_builder'
2
-
3
- module RGen
4
-
5
- module XMIHelper
6
-
7
- class MapHelper
8
- def initialize(keyMethod,valueMethod,elements)
9
- @keyMethod, @valueMethod, @elements = keyMethod, valueMethod, elements
10
- end
11
- def [](key)
12
- return @elements.select{|e| e.send(@keyMethod) == key}.first.send(@valueMethod) rescue NoMethodError
13
- nil
14
- end
15
- end
16
-
17
- class TaggedValueHelper < MapHelper
18
- def initialize(element)
19
- super('tag','value',element.modelElement_taggedValue.taggedValue)
20
- end
21
- end
22
-
23
-
24
- end
25
-
26
- end