Class: Resyma::Core::Field

Inherits:
Object
  • Object
show all
Defined in:
lib/resyma/core/parsetree/definition.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, start, trans) ⇒ Field

Create an instance of Field, which is set and used by the matching

algorithm

Parameters:

  • id (Integer)

    ID of the node

  • start (Hash<Integer, Set<Resyma::Core::Tuple2>>)

    Sets of 2 tuples, corresponding to different automata

  • trans (Hash<Integer, Set<Resyma::Core::Tuple4>>)

    Sets of 4 tuples, corresponding to different automata



16
17
18
19
20
# File 'lib/resyma/core/parsetree/definition.rb', line 16

def initialize(id, start, trans)
  @id = id
  @start = start
  @trans = trans
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



22
23
24
# File 'lib/resyma/core/parsetree/definition.rb', line 22

def id
  @id
end

#startObject

Returns the value of attribute start.



22
23
24
# File 'lib/resyma/core/parsetree/definition.rb', line 22

def start
  @start
end

#transObject

Returns the value of attribute trans.



22
23
24
# File 'lib/resyma/core/parsetree/definition.rb', line 22

def trans
  @trans
end

Class Method Details

.clean_fieldObject



24
25
26
27
28
# File 'lib/resyma/core/parsetree/definition.rb', line 24

def self.clean_field
  start = Hash.new { |hash, key| hash[key] = Set[] }
  trans = Hash.new { |hash, key| hash[key] = Set[] }
  new(-1, start, trans)
end