Class: StateMachine::OOStructuredFSM::CommentState

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

Overview

CommentState is responsible for handling comments.

Instance Method Summary collapse

Methods inherited from OOStructuredState

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

Constructor Details

#initialize(pLanguage) ⇒ CommentState

Returns a new instance of CommentState.



14
15
16
17
18
# File 'lib/kuniri/state_machine/OO_structured_fsm/comment_state.rb', line 14

def initialize(pLanguage)
  @language = pLanguage
  @multipleLineComment = ""
  @enableMultipleLine = false
end

Instance Method Details

#execute(pElementFile, pLine) ⇒ Object

See Also:



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/kuniri/state_machine/OO_structured_fsm/comment_state.rb', line 24

def execute(pElementFile, pLine)
  # Single line
  if @language.commentHandler.is_single_line_comment?(pLine)
    handling_single_line(pLine)
    return pElementFile
  end

  # Multiple line
  if @language.commentHandler.is_multiple_line_comment?(pLine)
    @enableMultipleLine = true
  end

  if @language.commentHandler.is_multiple_line_comment_end?(pLine)
    handling_multiple_line
  end

  if @enableMultipleLine
    capture_multiple_line_comment(pLine)
  end
 
  return pElementFile

end

#handle_line(pLine) ⇒ Object



20
21
# File 'lib/kuniri/state_machine/OO_structured_fsm/comment_state.rb', line 20

def handle_line(pLine)
end