File: abstract-syntax/core/declaration/abstract.rb

Overview
Module Structure
Class Hierarchy
Code

Overview

Module Structure

  module: <Toplevel Module>
  module: Umu#6
  module: AbstractSyntax#8
  module: Core#10
  module: Declaration#12
  class: Abstract#14
inherits from
  Abstract ( Umu::AbstractSyntax )
has properties
method: evaluate / 1 #15
method: __evaluate__ / 1 #39

Code

   1  # coding: utf-8
   2  # frozen_string_literal: true
   3 
   4 
   5 
   6  module Umu
   7 
   8  module AbstractSyntax
   9 
  10  module Core
  11 
  12  module Declaration
  13 
  14  class Abstract < AbstractSyntax::Abstract
  15      def evaluate(env)
  16          ASSERT.kind_of env, E::Entry
  17 
  18          new_env = E::Tracer.trace(
  19                      env.pref,
  20                      env.trace_stack.count,
  21                      'Eval(Decl)',
  22                      self.class,
  23                      self.loc,
  24                      self.to_s
  25          ) { |event|
  26              before_env = env.enter(event)
  27 
  28              after_env = __evaluate__ before_env
  29 
  30              after_env.leave
  31          }
  32 
  33          ASR.make_environment new_env
  34      end
  35 
  36 
  37  private
  38 
  39      def __evaluate__(_env)
  40          raise X::InternalSubclassResponsibility
  41      end
  42  end
  43 
  44  end # Umu::AbstractSyntax::Core::Declaration
  45 
  46  end # Umu::AbstractSyntax::Core
  47 
  48  end # Umu::AbstractSyntax
  49 
  50  end # Umu