Class: Rley::Parser::ErrorReason

Inherits:
Object
  • Object
show all
Defined in:
lib/rley/parser/error_reason.rb

Overview

Abstract class. An instance represents an explanation describing the likely cause of a parse error detected by Rley.

Direct Known Subclasses

ExpectationNotMet, NoInput

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(aRank) ⇒ ErrorReason

Constructor



15
16
17
# File 'lib/rley/parser/error_reason.rb', line 15

def initialize(aRank)
  @rank = aRank
end

Instance Attribute Details

#rankObject (readonly)

Returns the value of attribute rank.



11
12
13
# File 'lib/rley/parser/error_reason.rb', line 11

def rank
  @rank
end

Instance Method Details

#inspectString



25
26
27
# File 'lib/rley/parser/error_reason.rb', line 25

def inspect
  "#{self.class.name}: #{message}"
end

#messageString



20
21
22
# File 'lib/rley/parser/error_reason.rb', line 20

def message()
  return to_s
end