Class: SFRP::Raw::MatchExp::Pattern
- Inherits:
-
Struct
- Object
- Struct
- SFRP::Raw::MatchExp::Pattern
- Defined in:
- lib/sfrp/raw/expression.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#ref_var_str ⇒ Object
Returns the value of attribute ref_var_str.
-
#sp ⇒ Object
Returns the value of attribute sp.
-
#vconst_ref ⇒ Object
Returns the value of attribute vconst_ref.
Instance Method Summary collapse
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args
54 55 56 |
# File 'lib/sfrp/raw/expression.rb', line 54 def args @args end |
#ref_var_str ⇒ Object
Returns the value of attribute ref_var_str
54 55 56 |
# File 'lib/sfrp/raw/expression.rb', line 54 def ref_var_str @ref_var_str end |
#sp ⇒ Object
Returns the value of attribute sp
54 55 56 |
# File 'lib/sfrp/raw/expression.rb', line 54 def sp @sp end |
#vconst_ref ⇒ Object
Returns the value of attribute vconst_ref
54 55 56 |
# File 'lib/sfrp/raw/expression.rb', line 54 def vconst_ref @vconst_ref end |
Instance Method Details
#to_flat(set, ns) ⇒ Object
59 60 61 62 63 64 65 66 67 |
# File 'lib/sfrp/raw/expression.rb', line 59 def to_flat(set, ns) flat_args = args.map { |a| a.to_flat(set, ns) } if vconst_ref ab_vc_name = set.vconst(ns, vconst_ref, sp).absolute_name Flat::MatchExp::Pattern.new(ab_vc_name, ref_var_str, flat_args, sp) else Flat::MatchExp::Pattern.new(nil, ref_var_str, flat_args, sp) end end |
#vconst_refs ⇒ Object
55 56 57 |
# File 'lib/sfrp/raw/expression.rb', line 55 def vconst_refs (vconst_ref ? [vconst_ref] : []) + args.flat_map(&:vconst_refs) end |