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
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
#alternatives ⇒ Object
Returns the value of attribute alternatives.
99 100 101 |
# File 'lib/collie/ast.rb', line 99 def alternatives @alternatives end |
#location ⇒ Object
Returns the value of attribute location.
99 100 101 |
# File 'lib/collie/ast.rb', line 99 def location @location end |
#name ⇒ Object
Returns the value of attribute name.
99 100 101 |
# File 'lib/collie/ast.rb', line 99 def name @name end |