Class: CPEE::ProcessTransformation::Target::CPEE

Inherits:
Object
  • Object
show all
Defined in:
lib/cpee/processtransformation/cpee.rb

Instance Method Summary collapse

Constructor Details

#initialize(tree) ⇒ CPEE

Returns a new instance of CPEE.



28
29
30
# File 'lib/cpee/processtransformation/cpee.rb', line 28

def initialize(tree)
  @tree = tree
end

Instance Method Details

#generateObject



31
32
33
34
35
36
# File 'lib/cpee/processtransformation/cpee.rb', line 31

def generate
  res = XML::Smart.string("<description xmlns='http://cpee.org/ns/description/1.0'/>")
  res.register_namespace 'd', 'http://cpee.org/ns/description/1.0'
  generate_for_list(@tree,res.root)
  res
end


46
47
48
# File 'lib/cpee/processtransformation/cpee.rb', line 46

def print_Break(node,res)
  res.add('break')
end


50
51
52
53
# File 'lib/cpee/processtransformation/cpee.rb', line 50

def print_InfiniteLoop(node,res)
  s1 = res.add('loop', 'pre_test' => 'true')
  generate_for_list(node,s1)
end


54
55
56
57
58
# File 'lib/cpee/processtransformation/cpee.rb', line 54

def print_Loop(node,res)
  s1 = res.add('loop', 'pre_test' => node.condition.join(' && '))
  s1.attributes['language'] = node.condition_type unless node.condition_type.nil?
  generate_for_list(node,s1)
end