Class: Collie::AST::Rule
- Inherits:
-
Object
- Object
- Collie::AST::Rule
- Defined in:
- lib/collie/ast.rb
Overview
Grammar rule node
Instance Attribute Summary collapse
-
#alternatives ⇒ Object
Returns the value of attribute alternatives.
-
#location ⇒ Object
Returns the value of attribute location.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name:, alternatives: [], location: nil) ⇒ Rule
constructor
A new instance of Rule.
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
#alternatives ⇒ Object
Returns the value of attribute alternatives.
89 90 91 |
# File 'lib/collie/ast.rb', line 89 def alternatives @alternatives end |
#location ⇒ Object
Returns the value of attribute location.
89 90 91 |
# File 'lib/collie/ast.rb', line 89 def location @location end |
#name ⇒ Object
Returns the value of attribute name.
89 90 91 |
# File 'lib/collie/ast.rb', line 89 def name @name end |