Class: SFRP::Raw::Node

Inherits:
Struct
  • Object
show all
Defined in:
lib/sfrp/raw/elements.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#expObject

Returns the value of attribute exp

Returns:

  • (Object)

    the current value of exp



81
82
83
# File 'lib/sfrp/raw/elements.rb', line 81

def exp
  @exp
end

#init_expObject

Returns the value of attribute init_exp

Returns:

  • (Object)

    the current value of init_exp



81
82
83
# File 'lib/sfrp/raw/elements.rb', line 81

def init_exp
  @init_exp
end

#nsObject

Returns the value of attribute ns

Returns:

  • (Object)

    the current value of ns



81
82
83
# File 'lib/sfrp/raw/elements.rb', line 81

def ns
  @ns
end

#rnameObject

Returns the value of attribute rname

Returns:

  • (Object)

    the current value of rname



81
82
83
# File 'lib/sfrp/raw/elements.rb', line 81

def rname
  @rname
end

#spObject

Returns the value of attribute sp

Returns:

  • (Object)

    the current value of sp



81
82
83
# File 'lib/sfrp/raw/elements.rb', line 81

def sp
  @sp
end

#taObject

Returns the value of attribute ta

Returns:

  • (Object)

    the current value of ta



81
82
83
# File 'lib/sfrp/raw/elements.rb', line 81

def ta
  @ta
end

Instance Method Details

#absolute_nameObject



82
83
84
# File 'lib/sfrp/raw/elements.rb', line 82

def absolute_name
  ns.absolute_name(rname)
end

#gen_flat(src_set, dest_set) ⇒ Object



90
91
92
93
94
95
96
# File 'lib/sfrp/raw/elements.rb', line 90

def gen_flat(src_set, dest_set)
  exp.blame_side_effect
  flat_ta = ta && ta.to_flat(src_set, ns)
  flat_init_exp = init_exp && init_exp.to_flat(src_set, ns)
  flat_exp = exp && exp.to_flat(src_set, ns)
  dest_set << Flat::Node.new(absolute_name, flat_ta, flat_exp, flat_init_exp, sp)
end

#vconst_refsObject



86
87
88
# File 'lib/sfrp/raw/elements.rb', line 86

def vconst_refs
  [exp, init_exp].reject(&:nil?).flat_map(&:vconst_refs)
end