Class: Dhaka::LexerSpecificationItem

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/dhaka/lexer/specification.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pattern, priority, action) ⇒ LexerSpecificationItem

Returns a new instance of LexerSpecificationItem.



87
88
89
# File 'lib/dhaka/lexer/specification.rb', line 87

def initialize(pattern, priority, action)
  @pattern, @priority, @action = pattern, priority, action
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



86
87
88
# File 'lib/dhaka/lexer/specification.rb', line 86

def action
  @action
end

#patternObject (readonly)

Returns the value of attribute pattern.



86
87
88
# File 'lib/dhaka/lexer/specification.rb', line 86

def pattern
  @pattern
end

#priorityObject (readonly)

Returns the value of attribute priority.



86
87
88
# File 'lib/dhaka/lexer/specification.rb', line 86

def priority
  @priority
end

Instance Method Details

#<=>(other) ⇒ Object



91
92
93
# File 'lib/dhaka/lexer/specification.rb', line 91

def <=> other
  priority <=> other.priority
end