Class: Collie::AST::Rule

Inherits:
Object
  • Object
show all
Defined in:
lib/collie/ast.rb

Overview

Grammar rule node

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, alternatives: [], location: nil) ⇒ Rule

Returns a new instance of Rule.



101
102
103
104
105
# File 'lib/collie/ast.rb', line 101

def initialize(name:, alternatives: [], location: nil)
  @name = name
  @alternatives = alternatives
  @location = location
end

Instance Attribute Details

#alternativesObject

Returns the value of attribute alternatives.



99
100
101
# File 'lib/collie/ast.rb', line 99

def alternatives
  @alternatives
end

#locationObject

Returns the value of attribute location.



99
100
101
# File 'lib/collie/ast.rb', line 99

def location
  @location
end

#nameObject

Returns the value of attribute name.



99
100
101
# File 'lib/collie/ast.rb', line 99

def name
  @name
end