Class: Dhaka::Precedence
- Inherits:
-
Object
- Object
- Dhaka::Precedence
- Includes:
- Comparable
- Defined in:
- lib/dhaka/grammar/precedence.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#associativity ⇒ Object
readonly
Returns the value of attribute associativity.
-
#precedence_level ⇒ Object
readonly
Returns the value of attribute precedence_level.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(precedence_level, associativity) ⇒ Precedence
constructor
A new instance of Precedence.
- #to_s ⇒ Object
Constructor Details
#initialize(precedence_level, associativity) ⇒ Precedence
Returns a new instance of Precedence.
6 7 8 9 |
# File 'lib/dhaka/grammar/precedence.rb', line 6 def initialize(precedence_level, associativity) @precedence_level = precedence_level @associativity = associativity end |
Instance Attribute Details
#associativity ⇒ Object (readonly)
Returns the value of attribute associativity.
4 5 6 |
# File 'lib/dhaka/grammar/precedence.rb', line 4 def associativity @associativity end |
#precedence_level ⇒ Object (readonly)
Returns the value of attribute precedence_level.
4 5 6 |
# File 'lib/dhaka/grammar/precedence.rb', line 4 def precedence_level @precedence_level end |
Instance Method Details
#<=>(other) ⇒ Object
11 12 13 |
# File 'lib/dhaka/grammar/precedence.rb', line 11 def <=> other precedence_level <=> other.precedence_level end |
#to_s ⇒ Object
15 16 17 |
# File 'lib/dhaka/grammar/precedence.rb', line 15 def to_s "Precedence: #{precedence_level} Associativity: #{associativity}" end |