Class: Lrama::Grammar::Precedence

Inherits:
Struct
  • Object
show all
Includes:
Comparable
Defined in:
lib/lrama/grammar/precedence.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#precedenceObject

Returns the value of attribute precedence

Returns:

  • (Object)

    the current value of precedence



5
6
7
# File 'lib/lrama/grammar/precedence.rb', line 5

def precedence
  @precedence
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



5
6
7
# File 'lib/lrama/grammar/precedence.rb', line 5

def type
  @type
end

Instance Method Details

#<=>(other) ⇒ Object



8
9
10
# File 'lib/lrama/grammar/precedence.rb', line 8

def <=>(other)
  self.precedence <=> other.precedence
end