Class: SFRP::Poly::TConst
- Inherits:
-
Object
- Object
- SFRP::Poly::TConst
- Defined in:
- lib/sfrp/poly/elements.rb
Instance Attribute Summary collapse
-
#str ⇒ Object
readonly
Returns the value of attribute str.
Instance Method Summary collapse
- #clone ⇒ Object
-
#initialize(str, paramc, vconst_strs = nil, static = false, native_str = nil) ⇒ TConst
constructor
A new instance of TConst.
- #to_mono(monofier) ⇒ Object
- #typing ⇒ Object
Constructor Details
#initialize(str, paramc, vconst_strs = nil, static = false, native_str = nil) ⇒ TConst
Returns a new instance of TConst.
114 115 116 117 118 119 120 121 122 |
# File 'lib/sfrp/poly/elements.rb', line 114 def initialize( str, paramc, vconst_strs = nil, static = false, native_str = nil ) @str = str @paramc = paramc @vconst_strs = vconst_strs @static = static @native_str = native_str end |
Instance Attribute Details
#str ⇒ Object (readonly)
Returns the value of attribute str.
112 113 114 |
# File 'lib/sfrp/poly/elements.rb', line 112 def str @str end |
Instance Method Details
#clone ⇒ Object
128 129 130 |
# File 'lib/sfrp/poly/elements.rb', line 128 def clone TConst.new(@str, @paramc, @vconst_strs, @static, @native_str) end |
#to_mono(monofier) ⇒ Object
132 133 134 135 136 137 138 |
# File 'lib/sfrp/poly/elements.rb', line 132 def to_mono(monofier) raise UndeterminableTypeError.new(@str, @typing) unless @typing.mono? type_str = monofier.use_type(@typing) return M.type(type_str, nil, @static, @native_str) unless @vconst_strs vconst_strs = @vconst_strs.map { |s| monofier.use_vconst(s, @typing) } M.type(type_str, vconst_strs, @static, @native_str) end |