Class: Collie::AST::Alternative

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

Overview

Alternative production for a rule

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(symbols: [], action: nil, prec: nil, location: nil) ⇒ Alternative

Returns a new instance of Alternative.



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

def initialize(symbols: [], action: nil, prec: nil, location: nil)
  @symbols = symbols
  @action = action
  @prec = prec
  @location = location
end

Instance Attribute Details

#actionObject

Returns the value of attribute action.



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

def action
  @action
end

#locationObject

Returns the value of attribute location.



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

def location
  @location
end

#precObject

Returns the value of attribute prec.



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

def prec
  @prec
end

#symbolsObject

Returns the value of attribute symbols.



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

def symbols
  @symbols
end