File: abstract-syntax/result.rb

Overview
Module Structure
Class Hierarchy
Code

Overview

Module Structure

  module: <Toplevel Module>
  module: Umu#6
  module: AbstractSyntax#8
  module: Result#10
has properties
function: make_value / 1 #41
function: make_environment / 1 #46
  class: Abstract#12
inherits from
  Object ( Builtin-Module )
  class: Value#15
inherits from
  Abstract ( Umu::AbstractSyntax::Result )
has properties
attribute: value [R] #16
method: initialize / 1 #19
  class: Environment#27
inherits from
  Abstract ( Umu::AbstractSyntax::Result )
has properties
attribute: env [R] #28
method: initialize / 1 #31

Class Hierarchy

Object ( Builtin-Module )
Abstract ( Umu::AbstractSyntax::Result ) — #12
  Value    #15
  Environment    #27

Code

   1  # coding: utf-8
   2  # frozen_string_literal: true
   3 
   4 
   5 
   6  module Umu
   7 
   8  module AbstractSyntax
   9 
  10  module Result
  11 
  12  class Abstract; end
  13 
  14 
  15  class Value < Abstract
  16      attr_reader :value
  17 
  18 
  19      def initialize(value)
  20          ASSERT.kind_of value, VC::Top
  21 
  22          @value = value
  23      end
  24  end
  25 
  26 
  27  class Environment < Abstract
  28      attr_reader :env
  29 
  30 
  31      def initialize(env)
  32          ASSERT.kind_of env, E::Entry
  33 
  34          @env = env
  35      end
  36  end
  37 
  38 
  39  module_function
  40 
  41      def make_value(value)
  42          Result::Value.new(value).freeze
  43      end
  44 
  45 
  46      def make_environment(env)
  47          Result::Environment.new(env).freeze
  48      end
  49 
  50  end # Umu::AbstractSyntax::Result
  51 
  52  end # Umu::AbstractSyntax
  53 
  54  end # Umu