Class: PgVerify::Interpret::SpecContext

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text, expression, parent) ⇒ SpecContext

Returns a new instance of SpecContext.



16
17
18
19
20
21
# File 'lib/pg-verify/interpret/spec/spec_context.rb', line 16

def initialize(text, expression, parent)
    @text, @expression, @parent = text, expression, parent
    @expression = Model::ParsedExpression.new(expression, Model::ParsedExpression::TYPE_TL)
    @expression.source_location = parent.parent_graph.parent_script.find_source_location()
    @source_location = parent.parent_graph.parent_script.find_source_location()
end

Instance Attribute Details

#expressionObject

The LTL/CTL expression of this spec



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

def expression
  @expression
end

#parentObject

The parent set of this spec



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

def parent
  @parent
end

#source_locationObject

Returns the value of attribute source_location.



14
15
16
# File 'lib/pg-verify/interpret/spec/spec_context.rb', line 14

def source_location
  @source_location
end

#textObject

The text of this spec as a string.



6
7
8
# File 'lib/pg-verify/interpret/spec/spec_context.rb', line 6

def text
  @text
end

Instance Method Details

#to_model(parent) ⇒ Object



23
24
25
26
27
# File 'lib/pg-verify/interpret/spec/spec_context.rb', line 23

def to_model(parent)
    spec = Model::Spec.new(@text, @expression, parent)
    spec.source_location = @source_location
    return spec
end