Class: Stupidedi::Builder::TransmissionState
- Inherits:
-
AbstractState
- Object
- AbstractState
- Stupidedi::Builder::TransmissionState
- Defined in:
- lib/stupidedi/builder/states/transmission_state.rb
Instance Attribute Summary collapse
- #children ⇒ Array<AbstractState> readonly
- #instructions ⇒ InstructionTable readonly
- #segment_dict ⇒ Reader::SegmentDict readonly
- #separators ⇒ Reader::Separators readonly
- #zipper ⇒ Zipper::AbstractCursor readonly
Constructors collapse
Instance Method Summary collapse
- #copy(changes = {}) ⇒ TransmissionState
-
#initialize(separators, segment_dict, instructions, zipper, children) ⇒ TransmissionState
constructor
A new instance of TransmissionState.
Methods inherited from AbstractState
#leaf?, lsequence, mkcomposite, mkelement, mkrepeated, mksegment, mksimple, #pretty_print, sequence, tsequence
Methods included from Inspect
Constructor Details
#initialize(separators, segment_dict, instructions, zipper, children) ⇒ TransmissionState
Returns a new instance of TransmissionState.
25 26 27 28 |
# File 'lib/stupidedi/builder/states/transmission_state.rb', line 25 def initialize(separators, segment_dict, instructions, zipper, children) @separators, @segment_dict, @instructions, @zipper, @children = separators, segment_dict, instructions, zipper, children end |
Instance Attribute Details
#children ⇒ Array<AbstractState> (readonly)
23 24 25 |
# File 'lib/stupidedi/builder/states/transmission_state.rb', line 23 def children @children end |
#instructions ⇒ InstructionTable (readonly)
17 18 19 |
# File 'lib/stupidedi/builder/states/transmission_state.rb', line 17 def instructions @instructions end |
#segment_dict ⇒ Reader::SegmentDict (readonly)
14 15 16 |
# File 'lib/stupidedi/builder/states/transmission_state.rb', line 14 def segment_dict @segment_dict end |
#separators ⇒ Reader::Separators (readonly)
11 12 13 |
# File 'lib/stupidedi/builder/states/transmission_state.rb', line 11 def separators @separators end |
#zipper ⇒ Zipper::AbstractCursor (readonly)
20 21 22 |
# File 'lib/stupidedi/builder/states/transmission_state.rb', line 20 def zipper @zipper end |
Class Method Details
.push(zipper, parent, segment_tok, segment_use, config) ⇒ Zipper::AbstractCursor
46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/stupidedi/builder/states/transmission_state.rb', line 46 def push(zipper, parent, segment_tok, segment_use, config) zipper = zipper.append_child new( parent.separators, parent.segment_dict, parent.instructions.push([ Instruction.new(:ISA, nil, 0, 0, InterchangeState)]), parent.zipper.dangle.last, []) InterchangeState.push(zipper, zipper.node, segment_tok, segment_use, config) end |
Instance Method Details
#copy(changes = {}) ⇒ TransmissionState
31 32 33 34 35 36 37 38 |
# File 'lib/stupidedi/builder/states/transmission_state.rb', line 31 def copy(changes = {}) TransmissionState.new \ changes.fetch(:separators, @separators), changes.fetch(:segment_dict, @segment_dict), changes.fetch(:instructions, @instructions), changes.fetch(:zipper, @zipper), changes.fetch(:children, @children) end |