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, explicit_empty: false, empty_marker: nil, location: nil) ⇒ Alternative

Returns a new instance of Alternative.



112
113
114
115
116
117
118
119
# File 'lib/collie/ast.rb', line 112

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

Instance Attribute Details

#actionObject

Returns the value of attribute action.



110
111
112
# File 'lib/collie/ast.rb', line 110

def action
  @action
end

#empty_markerObject

Returns the value of attribute empty_marker.



110
111
112
# File 'lib/collie/ast.rb', line 110

def empty_marker
  @empty_marker
end

#explicit_emptyObject

Returns the value of attribute explicit_empty.



110
111
112
# File 'lib/collie/ast.rb', line 110

def explicit_empty
  @explicit_empty
end

#locationObject

Returns the value of attribute location.



110
111
112
# File 'lib/collie/ast.rb', line 110

def location
  @location
end

#precObject

Returns the value of attribute prec.



110
111
112
# File 'lib/collie/ast.rb', line 110

def prec
  @prec
end

#symbolsObject

Returns the value of attribute symbols.



110
111
112
# File 'lib/collie/ast.rb', line 110

def symbols
  @symbols
end