Class: SFRP::Raw::PrimTConst

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#native_strObject

Returns the value of attribute native_str

Returns:

  • (Object)

    the current value of native_str



46
47
48
# File 'lib/sfrp/raw/elements.rb', line 46

def native_str
  @native_str
end

#nsObject

Returns the value of attribute ns

Returns:

  • (Object)

    the current value of ns



46
47
48
# File 'lib/sfrp/raw/elements.rb', line 46

def ns
  @ns
end

#patObject

Returns the value of attribute pat

Returns:

  • (Object)

    the current value of pat



46
47
48
# File 'lib/sfrp/raw/elements.rb', line 46

def pat
  @pat
end

#repObject

Returns the value of attribute rep

Returns:

  • (Object)

    the current value of rep



46
47
48
# File 'lib/sfrp/raw/elements.rb', line 46

def rep
  @rep
end

#rnameObject

Returns the value of attribute rname

Returns:

  • (Object)

    the current value of rname



46
47
48
# File 'lib/sfrp/raw/elements.rb', line 46

def rname
  @rname
end

#spObject

Returns the value of attribute sp

Returns:

  • (Object)

    the current value of sp



46
47
48
# File 'lib/sfrp/raw/elements.rb', line 46

def sp
  @sp
end

Instance Method Details

#absolute_nameObject



47
48
49
# File 'lib/sfrp/raw/elements.rb', line 47

def absolute_name
  ns.absolute_name(rname)
end

#gen_flat(_src_set, dest_set) ⇒ Object



60
61
62
# File 'lib/sfrp/raw/elements.rb', line 60

def gen_flat(_src_set, dest_set)
  dest_set << Flat::TConst.new(absolute_name, [], nil, native_str, true, sp)
end

#make_vconst(vconst_str) ⇒ Object



55
56
57
58
# File 'lib/sfrp/raw/elements.rb', line 55

def make_vconst(vconst_str)
  raise vconst_str unless vconst_match?(vconst_str)
  VConst.new(vconst_str, rname, ns, vconst_str.gsub(pat, rep), [], sp)
end

#vconst_match?(vconst_str) ⇒ Boolean

Returns:

  • (Boolean)


51
52
53
# File 'lib/sfrp/raw/elements.rb', line 51

def vconst_match?(vconst_str)
  pat.match(vconst_str)
end