Class: StateMachine::OOStructuredFSM::IncludeState

Inherits:
OOStructuredState show all
Defined in:
lib/kuniri/state_machine/OO_structured_fsm/include_state.rb

Overview

Class responsible for handling Include state.

Instance Method Summary collapse

Methods inherited from OOStructuredState

#aggregation_capture, #attribute_capture, #class_capture, #comment_capture, #conditional_capture, #constructor_capture, #function_capture, #include_capture, #method_capture, #module_capture, #repetition_capture, #variable_capture

Constructor Details

#initialize(pLanguage) ⇒ IncludeState

Returns a new instance of IncludeState.



12
13
14
# File 'lib/kuniri/state_machine/OO_structured_fsm/include_state.rb', line 12

def initialize(pLanguage)
  @language = pLanguage
end

Instance Method Details

#execute(pElementFile, pLine) ⇒ Object

See Also:



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/kuniri/state_machine/OO_structured_fsm/include_state.rb', line 33

def execute(pElementFile, pLine)

  requirement = @language.externRequirementHandler.get_requirement(pLine)

  if requirement
   pElementFile.add_extern_requirement(requirement)
  end

  idle_capture

  if (@language.state.is_a? StateMachine::OOStructuredFSM::IdleState)
    pElementFile.comments = @language.string_comment_to_transfer
    @language.string_comment_to_transfer = ""
  end

  return pElementFile
end

#handle_line(pLine) ⇒ Object

See Also:



17
18
19
20
21
22
23
24
25
# File 'lib/kuniri/state_machine/OO_structured_fsm/include_state.rb', line 17

def handle_line(pLine)
  idle_capture
  # TODO: HANDLING MULTIPLE LINE.
  #if @language.idleHandler.get_idle(pLine)
  #  idle_capture
  #else
  # TODO: SAME STATE.
  #end
end

#idle_captureObject

See Also:



28
29
30
# File 'lib/kuniri/state_machine/OO_structured_fsm/include_state.rb', line 28

def idle_capture
  @language.set_state(@language.idleState)
end