Class: Collie::AST::PrecedenceDeclaration
- Inherits:
-
Object
- Object
- Collie::AST::PrecedenceDeclaration
- Defined in:
- lib/collie/ast.rb
Overview
Precedence declaration node (%left, %right, %nonassoc)
Instance Attribute Summary collapse
-
#associativity ⇒ Object
Returns the value of attribute associativity.
-
#location ⇒ Object
Returns the value of attribute location.
-
#tokens ⇒ Object
Returns the value of attribute tokens.
Instance Method Summary collapse
-
#initialize(associativity:, tokens:, location: nil) ⇒ PrecedenceDeclaration
constructor
A new instance of PrecedenceDeclaration.
Constructor Details
#initialize(associativity:, tokens:, location: nil) ⇒ PrecedenceDeclaration
Returns a new instance of PrecedenceDeclaration.
60 61 62 63 64 |
# File 'lib/collie/ast.rb', line 60 def initialize(associativity:, tokens:, location: nil) @associativity = associativity # :left, :right, :nonassoc @tokens = tokens @location = location end |
Instance Attribute Details
#associativity ⇒ Object
Returns the value of attribute associativity.
58 59 60 |
# File 'lib/collie/ast.rb', line 58 def associativity @associativity end |
#location ⇒ Object
Returns the value of attribute location.
58 59 60 |
# File 'lib/collie/ast.rb', line 58 def location @location end |
#tokens ⇒ Object
Returns the value of attribute tokens.
58 59 60 |
# File 'lib/collie/ast.rb', line 58 def tokens @tokens end |