<Toplevel Module>
Umu
—
#8
Exception
—
#10
Abstraction
—
#12
Abstract
—
#14
inherits from |
|
Expected
—
#18
inherits from |
| ||||||||||||||||
has properties |
|
ExecutionError
—
#43
inherits from |
| ||||||||||||
has properties |
|
RuntimeError
—
#63
inherits from |
| ||||||||||||
has properties |
|
SubclassResponsibility
—
#84
inherits from |
|
CommandError
—
#90
inherits from |
|
SyntaxErrorWithoutLocation
—
#92
inherits from |
| ||||
has properties |
|
LexicalError
—
#103
inherits from |
|
SyntaxError
—
#104
inherits from |
|
NameError
—
#108
inherits from |
|
TypeError
—
#109
inherits from |
|
ValueError
—
#110
inherits from |
|
ArgumentError
—
#111
inherits from |
|
ApplicationError
—
#112
inherits from |
|
SelectionError
—
#113
inherits from |
|
NoMessageError
—
#114
inherits from |
|
UnmatchError
—
#115
inherits from |
|
ZeroDivisionError
—
#116
inherits from |
|
EmptyError
—
#117
inherits from |
|
IndexError
—
#118
inherits from |
|
AssertionFailure
—
#119
inherits from |
|
Panic
—
#121
inherits from |
| ||||
has properties |
|
EqualityError
—
#133
inherits from |
|
OrderError
—
#134
inherits from |
|
NotImplemented
—
#135
inherits from |
|
InternalSubclassResponsibility
—
#139
inherits from |
|
Object
(
Builtin-Module
)
Exception
(
Builtin-Module
)
StandardError
(
Builtin-Module
)
Abstract
(
Umu::Exception::Abstraction
)
—
#14
Expected
(
Umu::Exception::Abstraction
)
—
#18
ExecutionError
(
Umu::Exception::Abstraction
)
—
#43
RuntimeError
(
Umu::Exception::Abstraction
)
—
#63
SubclassResponsibility
(
Umu::Exception::Abstraction
)
—
#84
EqualityError
| ( |
Umu::Exception
)
| — | #133 | ||
OrderError
| ( |
Umu::Exception
)
| — | #134 | ||
NotImplemented
| ( |
Umu::Exception
)
| — | #135 |
NameError
(
Umu::Exception
)
—
#108
TypeError
(
Umu::Exception
)
—
#109
ValueError
(
Umu::Exception
)
—
#110
ArgumentError
(
Umu::Exception
)
—
#111
ApplicationError
(
Umu::Exception
)
—
#112
SelectionError
(
Umu::Exception
)
—
#113
NoMessageError
(
Umu::Exception
)
—
#114
UnmatchError
(
Umu::Exception
)
—
#115
ZeroDivisionError
(
Umu::Exception
)
—
#116
EmptyError
(
Umu::Exception
)
—
#117
IndexError
(
Umu::Exception
)
—
#118
AssertionFailure
(
Umu::Exception
)
—
#119
Panic
(
Umu::Exception
)
—
#121
LexicalError
(
Umu::Exception
)
—
#103
SyntaxError
(
Umu::Exception
)
—
#104
CommandError
(
Umu::Exception
)
—
#90
SyntaxErrorWithoutLocation
(
Umu::Exception
)
—
#92
InternalSubclassResponsibility
(
Umu::Exception
)
—
#139
1 # coding: utf-8 2 # frozen_string_literal: true 3 4 require_relative 'assertion' 5 6 7 8 module Umu 9 10 module Exception 11 12 module Abstraction 13 14 class Abstract < ::StandardError; end 15 16 17 18 class Expected < Abstract 19 attr_reader :msg 20 21 22 def initialize(msg, *args) 23 ASSERT.kind_of msg, ::String 24 25 @msg = format msg, *args 26 end 27 28 29 def to_s 30 format "[%s] %s", __category__, self.msg 31 end 32 33 34 private 35 36 def __category__ 37 self.class.to_s.split(/::/)[2] 38 end 39 end 40 41 42 43 class ExecutionError < Expected 44 attr_reader :loc 45 46 47 def initialize(loc, msg, *args) 48 ASSERT.kind_of loc, LOC::Entry 49 50 super(msg, *args) 51 52 @loc = loc 53 end 54 55 56 def to_s 57 format "%s -- %s", super.to_s, self.loc.to_s 58 end 59 end 60 61 62 63 class RuntimeError < ExecutionError 64 attr_reader :env 65 66 67 def initialize(loc, env, msg, *args) 68 ASSERT.kind_of loc, LOC::Entry 69 ASSERT.kind_of env, E::Entry 70 71 super(loc, msg, *args) 72 73 @env = env 74 end 75 76 77 def print_backtrace 78 self.env.print_backtrace 79 end 80 end 81 82 83 84 class SubclassResponsibility < RuntimeError; end 85 86 end # Umu::Exception::Abstraction 87 88 89 90 class CommandError < Abstraction::Expected; end 91 92 class SyntaxErrorWithoutLocation < Abstraction::Expected 93 94 private 95 96 def __category__ 97 'SyntaxError' 98 end 99 end 100 101 102 103 class LexicalError < Abstraction::ExecutionError; end 104 class SyntaxError < Abstraction::ExecutionError; end 105 106 107 108 class NameError < Abstraction::RuntimeError; end 109 class TypeError < Abstraction::RuntimeError; end 110 class ValueError < Abstraction::RuntimeError; end 111 class ArgumentError < Abstraction::RuntimeError; end 112 class ApplicationError < Abstraction::RuntimeError; end 113 class SelectionError < Abstraction::RuntimeError; end 114 class NoMessageError < Abstraction::RuntimeError; end 115 class UnmatchError < Abstraction::RuntimeError; end 116 class ZeroDivisionError < Abstraction::RuntimeError; end 117 class EmptyError < Abstraction::RuntimeError; end 118 class IndexError < Abstraction::RuntimeError; end 119 class AssertionFailure < Abstraction::RuntimeError; end 120 121 class Panic < Abstraction::RuntimeError 122 def initialize(loc, env, msg, *args) 123 ASSERT.kind_of loc, LOC::Entry 124 ASSERT.kind_of env, E::Entry 125 ASSERT.kind_of msg, ::String 126 127 super(loc, env, msg.gsub(/%/, '%%'), *args) 128 end 129 end 130 131 132 133 class EqualityError < Abstraction::SubclassResponsibility; end 134 class OrderError < Abstraction::SubclassResponsibility; end 135 class NotImplemented < Abstraction::SubclassResponsibility; end 136 137 138 139 class InternalSubclassResponsibility < Abstraction::Abstract; end 140 141 end # Umu::Exception 142 143 end # Umu