class SFRP::Poly::DSL::NodeProxy

Public Class Methods

new(node_str, type_annot) click to toggle source
# File lib/sfrp/poly/dsl.rb, line 111
def initialize(node_str, type_annot)
  @node_str = node_str
  @type_annot = type_annot || TypeAnnotationVar.new('%a0')
  @node_refs = []
  @type_annots = []
end

Public Instance Methods

c(node_str) click to toggle source
# File lib/sfrp/poly/dsl.rb, line 118
def c(node_str)
  dep(node_str, false)
end
dep(node_str, last) click to toggle source
# File lib/sfrp/poly/dsl.rb, line 126
def dep(node_str, last)
  @node_refs << Node::NodeRef.new(node_str, last)
  @type_annots << TypeAnnotationVar.new('%a' + @node_refs.size.to_s)
end
eval_func(func_str, ret_type_annot = nil, &block) click to toggle source
# File lib/sfrp/poly/dsl.rb, line 131
def eval_func(func_str, ret_type_annot = nil, &block)
  @eval_func_str = func_str
  DSL.func(func_str, ret_type_annot, &block)
end
eval_func_str(func_str) click to toggle source
# File lib/sfrp/poly/dsl.rb, line 141
def eval_func_str(func_str)
  @eval_func_str = func_str
end
init_func(func_str, ret_type_annot = nil, &block) click to toggle source
# File lib/sfrp/poly/dsl.rb, line 136
def init_func(func_str, ret_type_annot = nil, &block)
  @init_func_str = func_str
  DSL.func(func_str, ret_type_annot, &block)
end
init_func_str(func_str) click to toggle source
# File lib/sfrp/poly/dsl.rb, line 145
def init_func_str(func_str)
  @init_func_str = func_str
end
l(node_str) click to toggle source
# File lib/sfrp/poly/dsl.rb, line 122
def l(node_str)
  dep(node_str, true)
end
to_node() click to toggle source
# File lib/sfrp/poly/dsl.rb, line 149
def to_node
  a = @node_refs.size.times.map { |i| TypeAnnotationVar.new("a#{i}") }
  annot = FuncTypeAnnotation.new(@type_annot, a)
  Node.new(@node_str, @node_refs, annot, @eval_func_str, @init_func_str)
end