Class: Aurum::Grammar::SyntaxRules::Precedence
- Inherits:
-
Struct
- Object
- Struct
- Aurum::Grammar::SyntaxRules::Precedence
- Includes:
- Comparable
- Defined in:
- lib/aurum/grammar/syntax_rules.rb
Instance Attribute Summary collapse
-
#associativity ⇒ Object
Returns the value of attribute associativity.
-
#level ⇒ Object
Returns the value of attribute level.
Instance Method Summary collapse
Instance Attribute Details
#associativity ⇒ Object
Returns the value of attribute associativity
46 47 48 |
# File 'lib/aurum/grammar/syntax_rules.rb', line 46 def associativity @associativity end |
#level ⇒ Object
Returns the value of attribute level
46 47 48 |
# File 'lib/aurum/grammar/syntax_rules.rb', line 46 def level @level end |
Instance Method Details
#<=>(other) ⇒ Object
49 50 51 52 53 54 |
# File 'lib/aurum/grammar/syntax_rules.rb', line 49 def <=> other return level <=> other.level unless level == other.level return 1 if associativity == :left_associative return -1 if associativity == :right_associative #TODO non_associative end |