class SFRP::Flat::MatchExp
Constants
- Case
Public Instance Methods
alpha_convert(table, serial)
click to toggle source
# File lib/sfrp/flat/expression.rb, line 90 def alpha_convert(table, serial) new_left_exp = left_exp.alpha_convert(table, serial) new_cases = cases.map do |c| c.pattern.duplicated_var_check new_table = table.clone new_pattern = c.pattern.alpha_convert(new_table, serial) new_exp = c.exp.alpha_convert(new_table, serial) Case.new(new_pattern, new_exp) end MatchExp.new(new_left_exp, new_cases) end
lift_node_ref(collected_node_refs)
click to toggle source
# File lib/sfrp/flat/expression.rb, line 82 def lift_node_ref(collected_node_refs) new_left_exp = left_exp.lift_node_ref(collected_node_refs) new_cases = cases.map do |c| Case.new(c.pattern, c.exp.lift_node_ref(collected_node_refs)) end MatchExp.new(new_left_exp, new_cases) end
to_poly()
click to toggle source
# File lib/sfrp/flat/expression.rb, line 102 def to_poly poly_cases = cases.map do |c| Poly::MatchExp::Case.new(c.pattern.to_poly, c.exp.to_poly) end Poly::MatchExp.new(left_exp.to_poly, poly_cases) end