Class: Lrama::State::Action::Shift

Inherits:
Object
  • Object
show all
Defined in:
lib/lrama/state/action/shift.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(from_state, next_sym, to_items, to_state) ⇒ Shift

Returns a new instance of Shift.



25
26
27
28
29
30
# File 'lib/lrama/state/action/shift.rb', line 25

def initialize(from_state, next_sym, to_items, to_state)
  @from_state = from_state
  @next_sym = next_sym
  @to_items = to_items
  @to_state = to_state
end

Instance Attribute Details

#from_stateObject (readonly)

TODO: rbs-inline 0.11.0 doesn't support instance variables. Move these type declarations above instance variable definitions, once it's supported. see: https://github.com/soutaro/rbs-inline/pull/149

@rbs! @from_state: State @next_sym: Grammar::Symbol @to_items: Array @to_state: State



18
19
20
# File 'lib/lrama/state/action/shift.rb', line 18

def from_state
  @from_state
end

#next_symObject (readonly)

: Grammar::Symbol



19
20
21
# File 'lib/lrama/state/action/shift.rb', line 19

def next_sym
  @next_sym
end

#not_selectedObject

: bool



22
23
24
# File 'lib/lrama/state/action/shift.rb', line 22

def not_selected
  @not_selected
end

#to_itemsObject (readonly)

: Array



20
21
22
# File 'lib/lrama/state/action/shift.rb', line 20

def to_items
  @to_items
end

#to_stateObject (readonly)

: State



21
22
23
# File 'lib/lrama/state/action/shift.rb', line 21

def to_state
  @to_state
end

Instance Method Details

#clear_conflictsObject



33
34
35
# File 'lib/lrama/state/action/shift.rb', line 33

def clear_conflicts
  @not_selected = nil
end