Class: PgVerify::Interpret::TransitionContext

Inherits:
Object
  • Object
show all
Defined in:
lib/pg-verify/interpret/transition_context.rb

Defined Under Namespace

Classes: TempExpression

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent_component, src_state, tgt_state) ⇒ TransitionContext

Returns a new instance of TransitionContext.



20
21
22
23
24
# File 'lib/pg-verify/interpret/transition_context.rb', line 20

def initialize(parent_component, src_state, tgt_state)
    @parent_component = parent_component
    @src_state, @tgt_state = src_state, tgt_state
    @source_location = @parent_component.parent_graph.parent_script.find_source_location()
end

Instance Attribute Details

#action(str) ⇒ Object

Strings for the guars, actions and preconditions



15
16
17
# File 'lib/pg-verify/interpret/transition_context.rb', line 15

def action
  @action
end

#guard(str) ⇒ Object

Strings for the guars, actions and preconditions



15
16
17
# File 'lib/pg-verify/interpret/transition_context.rb', line 15

def guard
  @guard
end

#parent_componentObject

Back-reference to the component which owns this transition



9
10
11
# File 'lib/pg-verify/interpret/transition_context.rb', line 9

def parent_component
  @parent_component
end

#precon(str) ⇒ Object

Strings for the guars, actions and preconditions



15
16
17
# File 'lib/pg-verify/interpret/transition_context.rb', line 15

def precon
  @precon
end

#source_locationObject

Source location for this transition



18
19
20
# File 'lib/pg-verify/interpret/transition_context.rb', line 18

def source_location
  @source_location
end

#src_stateObject

Source and target states as symbols



12
13
14
# File 'lib/pg-verify/interpret/transition_context.rb', line 12

def src_state
  @src_state
end

#tgt_stateObject

Source and target states as symbols



12
13
14
# File 'lib/pg-verify/interpret/transition_context.rb', line 12

def tgt_state
  @tgt_state
end

Instance Method Details

#to_modelObject



47
48
49
# File 'lib/pg-verify/interpret/transition_context.rb', line 47

def to_model()
    Model::Transition.new(@src_state, @tgt_state, action: @action, precon: @precon, guard: @guard)
end