Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: WIP parse UML 1.3 #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion lib/xmi/root13.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
require "shale"

module Xmi

# OMG 1.3
class EaXmiHeaderDocumentation < Shale::Mapper
attribute :exporter, Shale::Type::String
Expand Down
7 changes: 7 additions & 0 deletions lib/xmi/uml13.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# frozen_string_literal: true

module Xmi
module Uml13
end
end

require_relative "uml13/abstraction"
require_relative "uml13/action"
require_relative "uml13/action_sequence"
Expand Down
300 changes: 153 additions & 147 deletions lib/xmi/uml13/abstraction.rb

Large diffs are not rendered by default.

286 changes: 146 additions & 140 deletions lib/xmi/uml13/action.rb

Large diffs are not rendered by default.

254 changes: 130 additions & 124 deletions lib/xmi/uml13/action_sequence.rb
Original file line number Diff line number Diff line change
@@ -1,130 +1,136 @@
require 'shale'
# frozen_string_literal: true

require_relative 'action_sequenceaction'
require_relative 'action_sequencestate'
require_relative 'action_sequencestate2'
require_relative 'action_sequencetransition'
require_relative 'model_elementbehavior'
require_relative 'model_elementbinding'
require_relative 'model_elementcollaboration'
require_relative 'model_elementconstraint'
require_relative 'model_elementelement_reference'
require_relative 'model_elementimplementation'
require_relative 'model_elementname'
require_relative 'model_elementnamespace'
require_relative 'model_elementpartition'
require_relative 'model_elementpresentation'
require_relative 'model_elementprovision'
require_relative 'model_elementrequirement'
require_relative 'model_elementstereotype'
require_relative 'model_elementtagged_value'
require_relative 'model_elementtemplate'
require_relative 'model_elementtemplate_parameter'
require_relative 'model_elementview'
require_relative 'model_elementvisibility'
require_relative 'xm_iextension'
require "shale"

class ActionSequence < Shale::Mapper
attribute :name, Shale::Type::Value
attribute :visibility, Shale::Type::String
attribute :binding, Shale::Type::Value
attribute :template, Shale::Type::Value
attribute :template_parameter, Shale::Type::Value
attribute :implementation, Shale::Type::Value
attribute :view, Shale::Type::Value
attribute :presentation, Shale::Type::Value
attribute :namespace, Shale::Type::Value
attribute :constraint, Shale::Type::Value
attribute :requirement, Shale::Type::Value
attribute :provision, Shale::Type::Value
attribute :stereotype, Shale::Type::Value
attribute :element_reference, Shale::Type::Value
attribute :collaboration, Shale::Type::Value
attribute :behavior, Shale::Type::Value
attribute :partition, Shale::Type::Value
attribute :transition, Shale::Type::Value
attribute :state, Shale::Type::Value
attribute :state2, Shale::Type::Value
attribute :xmi_id, Shale::Type::Value
attribute :xmi_label, Shale::Type::Value
attribute :xmi_uuid, Shale::Type::Value
attribute :href, Shale::Type::Value
attribute :xmi_idref, Shale::Type::Value
attribute :model_element_name, ModelElementname, collection: true
attribute :model_element_visibility, ModelElementvisibility, collection: true
attribute :xmi_extension, XMIextension, collection: true
attribute :model_element_binding, ModelElementbinding, collection: true
attribute :model_element_template, ModelElementtemplate, collection: true
attribute :model_element_template_parameter, ModelElementtemplateParameter, collection: true
attribute :model_element_implementation, ModelElementimplementation, collection: true
attribute :model_element_view, ModelElementview, collection: true
attribute :model_element_presentation, ModelElementpresentation, collection: true
attribute :model_element_namespace, ModelElementnamespace, collection: true
attribute :model_element_constraint, ModelElementconstraint, collection: true
attribute :model_element_requirement, ModelElementrequirement, collection: true
attribute :model_element_provision, ModelElementprovision, collection: true
attribute :model_element_stereotype, ModelElementstereotype, collection: true
attribute :model_element_element_reference, ModelElementelementReference, collection: true
attribute :model_element_collaboration, ModelElementcollaboration, collection: true
attribute :model_element_behavior, ModelElementbehavior, collection: true
attribute :model_element_partition, ModelElementpartition, collection: true
attribute :action_sequence_transition, ActionSequencetransition, collection: true
attribute :action_sequence_state, ActionSequencestate, collection: true
attribute :action_sequence_state2, ActionSequencestate2, collection: true
attribute :model_element_tagged_value, ModelElementtaggedValue, collection: true
attribute :action_sequence_action, ActionSequenceaction, collection: true
require_relative "action_sequenceaction"
require_relative "action_sequencestate"
require_relative "action_sequencestate2"
require_relative "action_sequencetransition"
require_relative "model_elementbehavior"
require_relative "model_elementbinding"
require_relative "model_elementcollaboration"
require_relative "model_elementconstraint"
require_relative "model_elementelement_reference"
require_relative "model_elementimplementation"
require_relative "model_elementname"
require_relative "model_elementnamespace"
require_relative "model_elementpartition"
require_relative "model_elementpresentation"
require_relative "model_elementprovision"
require_relative "model_elementrequirement"
require_relative "model_elementstereotype"
require_relative "model_elementtagged_value"
require_relative "model_elementtemplate"
require_relative "model_elementtemplate_parameter"
require_relative "model_elementview"
require_relative "model_elementvisibility"
require_relative "xm_iextension"

xml do
root 'ActionSequence'
namespace 'omg.org/UML1.3', 'UML'
module Xmi
module Uml13
class ActionSequence < Shale::Mapper
attribute :name, Shale::Type::Value
attribute :visibility, Shale::Type::String
attribute :binding, Shale::Type::Value
attribute :template, Shale::Type::Value
attribute :template_parameter, Shale::Type::Value
attribute :implementation, Shale::Type::Value
attribute :view, Shale::Type::Value
attribute :presentation, Shale::Type::Value
attribute :namespace, Shale::Type::Value
attribute :constraint, Shale::Type::Value
attribute :requirement, Shale::Type::Value
attribute :provision, Shale::Type::Value
attribute :stereotype, Shale::Type::Value
attribute :element_reference, Shale::Type::Value
attribute :collaboration, Shale::Type::Value
attribute :behavior, Shale::Type::Value
attribute :partition, Shale::Type::Value
attribute :transition, Shale::Type::Value
attribute :state, Shale::Type::Value
attribute :state2, Shale::Type::Value
attribute :xmi_id, Shale::Type::Value
attribute :xmi_label, Shale::Type::Value
attribute :xmi_uuid, Shale::Type::Value
attribute :href, Shale::Type::Value
attribute :xmi_idref, Shale::Type::Value
attribute :model_element_name, ModelElementname, collection: true
attribute :model_element_visibility, ModelElementvisibility, collection: true
attribute :xmi_extension, XMIextension, collection: true
attribute :model_element_binding, ModelElementbinding, collection: true
attribute :model_element_template, ModelElementtemplate, collection: true
attribute :model_element_template_parameter, ModelElementtemplateParameter, collection: true
attribute :model_element_implementation, ModelElementimplementation, collection: true
attribute :model_element_view, ModelElementview, collection: true
attribute :model_element_presentation, ModelElementpresentation, collection: true
attribute :model_element_namespace, ModelElementnamespace, collection: true
attribute :model_element_constraint, ModelElementconstraint, collection: true
attribute :model_element_requirement, ModelElementrequirement, collection: true
attribute :model_element_provision, ModelElementprovision, collection: true
attribute :model_element_stereotype, ModelElementstereotype, collection: true
attribute :model_element_element_reference, ModelElementelementReference, collection: true
attribute :model_element_collaboration, ModelElementcollaboration, collection: true
attribute :model_element_behavior, ModelElementbehavior, collection: true
attribute :model_element_partition, ModelElementpartition, collection: true
attribute :action_sequence_transition, ActionSequencetransition, collection: true
attribute :action_sequence_state, ActionSequencestate, collection: true
attribute :action_sequence_state2, ActionSequencestate2, collection: true
attribute :model_element_tagged_value, ModelElementtaggedValue, collection: true
attribute :action_sequence_action, ActionSequenceaction, collection: true

map_attribute 'name', to: :name
map_attribute 'visibility', to: :visibility
map_attribute 'binding', to: :binding
map_attribute 'template', to: :template
map_attribute 'templateParameter', to: :template_parameter
map_attribute 'implementation', to: :implementation
map_attribute 'view', to: :view
map_attribute 'presentation', to: :presentation
map_attribute 'namespace', to: :namespace
map_attribute 'constraint', to: :constraint
map_attribute 'requirement', to: :requirement
map_attribute 'provision', to: :provision
map_attribute 'stereotype', to: :stereotype
map_attribute 'elementReference', to: :element_reference
map_attribute 'collaboration', to: :collaboration
map_attribute 'behavior', to: :behavior
map_attribute 'partition', to: :partition
map_attribute 'transition', to: :transition
map_attribute 'state', to: :state
map_attribute 'state2', to: :state2
map_attribute 'xmi.id', to: :xmi_id
map_attribute 'xmi.label', to: :xmi_label
map_attribute 'xmi.uuid', to: :xmi_uuid
map_attribute 'href', to: :href
map_attribute 'xmi.idref', to: :xmi_idref
map_element 'ModelElement.name', to: :model_element_name
map_element 'ModelElement.visibility', to: :model_element_visibility
map_element 'XMI.extension', to: :xmi_extension, prefix: nil, namespace: nil
map_element 'ModelElement.binding', to: :model_element_binding
map_element 'ModelElement.template', to: :model_element_template
map_element 'ModelElement.templateParameter', to: :model_element_template_parameter
map_element 'ModelElement.implementation', to: :model_element_implementation
map_element 'ModelElement.view', to: :model_element_view
map_element 'ModelElement.presentation', to: :model_element_presentation
map_element 'ModelElement.namespace', to: :model_element_namespace
map_element 'ModelElement.constraint', to: :model_element_constraint
map_element 'ModelElement.requirement', to: :model_element_requirement
map_element 'ModelElement.provision', to: :model_element_provision
map_element 'ModelElement.stereotype', to: :model_element_stereotype
map_element 'ModelElement.elementReference', to: :model_element_element_reference
map_element 'ModelElement.collaboration', to: :model_element_collaboration
map_element 'ModelElement.behavior', to: :model_element_behavior
map_element 'ModelElement.partition', to: :model_element_partition
map_element 'ActionSequence.transition', to: :action_sequence_transition
map_element 'ActionSequence.state', to: :action_sequence_state
map_element 'ActionSequence.state2', to: :action_sequence_state2
map_element 'ModelElement.taggedValue', to: :model_element_tagged_value
map_element 'ActionSequence.action', to: :action_sequence_action
xml do
root "ActionSequence"
namespace "omg.org/UML1.3", "UML"

map_attribute "name", to: :name
map_attribute "visibility", to: :visibility
map_attribute "binding", to: :binding
map_attribute "template", to: :template
map_attribute "templateParameter", to: :template_parameter
map_attribute "implementation", to: :implementation
map_attribute "view", to: :view
map_attribute "presentation", to: :presentation
map_attribute "namespace", to: :namespace
map_attribute "constraint", to: :constraint
map_attribute "requirement", to: :requirement
map_attribute "provision", to: :provision
map_attribute "stereotype", to: :stereotype
map_attribute "elementReference", to: :element_reference
map_attribute "collaboration", to: :collaboration
map_attribute "behavior", to: :behavior
map_attribute "partition", to: :partition
map_attribute "transition", to: :transition
map_attribute "state", to: :state
map_attribute "state2", to: :state2
map_attribute "xmi.id", to: :xmi_id
map_attribute "xmi.label", to: :xmi_label
map_attribute "xmi.uuid", to: :xmi_uuid
map_attribute "href", to: :href
map_attribute "xmi.idref", to: :xmi_idref
map_element "ModelElement.name", to: :model_element_name
map_element "ModelElement.visibility", to: :model_element_visibility
map_element "XMI.extension", to: :xmi_extension, prefix: nil, namespace: nil
map_element "ModelElement.binding", to: :model_element_binding
map_element "ModelElement.template", to: :model_element_template
map_element "ModelElement.templateParameter", to: :model_element_template_parameter
map_element "ModelElement.implementation", to: :model_element_implementation
map_element "ModelElement.view", to: :model_element_view
map_element "ModelElement.presentation", to: :model_element_presentation
map_element "ModelElement.namespace", to: :model_element_namespace
map_element "ModelElement.constraint", to: :model_element_constraint
map_element "ModelElement.requirement", to: :model_element_requirement
map_element "ModelElement.provision", to: :model_element_provision
map_element "ModelElement.stereotype", to: :model_element_stereotype
map_element "ModelElement.elementReference", to: :model_element_element_reference
map_element "ModelElement.collaboration", to: :model_element_collaboration
map_element "ModelElement.behavior", to: :model_element_behavior
map_element "ModelElement.partition", to: :model_element_partition
map_element "ActionSequence.transition", to: :action_sequence_transition
map_element "ActionSequence.state", to: :action_sequence_state
map_element "ActionSequence.state2", to: :action_sequence_state2
map_element "ModelElement.taggedValue", to: :model_element_tagged_value
map_element "ActionSequence.action", to: :action_sequence_action
end
end
end
end
70 changes: 38 additions & 32 deletions lib/xmi/uml13/action_sequenceaction.rb
Original file line number Diff line number Diff line change
@@ -1,38 +1,44 @@
require 'shale'
# frozen_string_literal: true

require_relative 'action'
require_relative 'call_action'
require_relative 'create_action'
require_relative 'destroy_action'
require_relative 'local_invocation'
require_relative 'return_action'
require_relative 'send_action'
require_relative 'terminate_action'
require_relative 'uninterpreted_action'
require "shale"

class ActionSequenceaction < Shale::Mapper
attribute :action, Action, collection: true
attribute :create_action, CreateAction, collection: true
attribute :call_action, CallAction, collection: true
attribute :local_invocation, LocalInvocation, collection: true
attribute :return_action, ReturnAction, collection: true
attribute :send_action, SendAction, collection: true
attribute :uninterpreted_action, UninterpretedAction, collection: true
attribute :terminate_action, TerminateAction, collection: true
attribute :destroy_action, DestroyAction, collection: true
require_relative "action"
require_relative "call_action"
require_relative "create_action"
require_relative "destroy_action"
require_relative "local_invocation"
require_relative "return_action"
require_relative "send_action"
require_relative "terminate_action"
require_relative "uninterpreted_action"

xml do
root 'ActionSequence.action'
namespace 'omg.org/UML1.3', 'UML'
module Xmi
module Uml13
class ActionSequenceaction < Shale::Mapper
attribute :action, Action, collection: true
attribute :create_action, CreateAction, collection: true
attribute :call_action, CallAction, collection: true
attribute :local_invocation, LocalInvocation, collection: true
attribute :return_action, ReturnAction, collection: true
attribute :send_action, SendAction, collection: true
attribute :uninterpreted_action, UninterpretedAction, collection: true
attribute :terminate_action, TerminateAction, collection: true
attribute :destroy_action, DestroyAction, collection: true

map_element 'Action', to: :action
map_element 'CreateAction', to: :create_action
map_element 'CallAction', to: :call_action
map_element 'LocalInvocation', to: :local_invocation
map_element 'ReturnAction', to: :return_action
map_element 'SendAction', to: :send_action
map_element 'UninterpretedAction', to: :uninterpreted_action
map_element 'TerminateAction', to: :terminate_action
map_element 'DestroyAction', to: :destroy_action
xml do
root "ActionSequence.action"
namespace "omg.org/UML1.3", "UML"

map_element "Action", to: :action
map_element "CreateAction", to: :create_action
map_element "CallAction", to: :call_action
map_element "LocalInvocation", to: :local_invocation
map_element "ReturnAction", to: :return_action
map_element "SendAction", to: :send_action
map_element "UninterpretedAction", to: :uninterpreted_action
map_element "TerminateAction", to: :terminate_action
map_element "DestroyAction", to: :destroy_action
end
end
end
end
22 changes: 14 additions & 8 deletions lib/xmi/uml13/action_sequencestate.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
require 'shale'
# frozen_string_literal: true

require_relative 'state'
require "shale"

class ActionSequencestate < Shale::Mapper
attribute :state, State, collection: true
require_relative "state"

xml do
root 'ActionSequence.state'
namespace 'omg.org/UML1.3', 'UML'
module Xmi
module Uml13
class ActionSequencestate < Shale::Mapper
attribute :state, State, collection: true

map_element 'State', to: :state
xml do
root "ActionSequence.state"
namespace "omg.org/UML1.3", "UML"

map_element "State", to: :state
end
end
end
end
Loading
Loading