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



91
92
93
94
95
# File 'lib/collie/ast.rb', line 91

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

Instance Attribute Details

#alternativesObject

Returns the value of attribute alternatives.



89
90
91
# File 'lib/collie/ast.rb', line 89

def alternatives
  @alternatives
end

#locationObject

Returns the value of attribute location.



89
90
91
# File 'lib/collie/ast.rb', line 89

def location
  @location
end

#nameObject

Returns the value of attribute name.



89
90
91
# File 'lib/collie/ast.rb', line 89

def name
  @name
end