Class: StateMachine::OOStructuredFSM::FunctionBehaviourState
Overview
Class responsible for handling Method and constructor state.
Instance Method Summary
collapse
#attribute_capture, #comment_capture, #constructor_capture, #function_capture, #idle_capture, #include_capture, #method_capture, #module_capture, #variable_capture
Constructor Details
Constructor responsible for setup the basic configuration.
18
19
20
21
22
|
# File 'lib/kuniri/state_machine/OO_structured_fsm/function_behaviour_state.rb', line 18
def initialize(pLanguage, pParams = {})
@language = pLanguage
@flagState = pParams[:flagState] || StateMachine::METHOD_STATE
@functionIdentifier = pParams[:functionId] || MethodState::METHOD_LABEL
end
|
Instance Method Details
#aggregation_capture ⇒ Object
55
56
57
|
# File 'lib/kuniri/state_machine/OO_structured_fsm/function_behaviour_state.rb', line 55
def aggregation_capture
@language.set_state(@language.aggregationState)
end
|
#class_capture ⇒ Object
38
39
40
|
# File 'lib/kuniri/state_machine/OO_structured_fsm/function_behaviour_state.rb', line 38
def class_capture
@language.rewind_state
end
|
#conditional_capture ⇒ Object
43
44
45
46
|
# File 'lib/kuniri/state_machine/OO_structured_fsm/function_behaviour_state.rb', line 43
def conditional_capture
@language.flagFunctionBehaviour = @flagState
@language.set_state(@language.conditionalState)
end
|
#execute(pElementFile, pLine) ⇒ Object
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
# File 'lib/kuniri/state_machine/OO_structured_fsm/function_behaviour_state.rb', line 60
def execute(pElementFile, pLine)
functionElement = @language.send("#{@functionIdentifier}Handler")
.send("get_#{@functionIdentifier}", pLine)
if (functionElement)
lastIndex = pElementFile.classes.length - 1
functionElement. = @language.
@language. = ""
pElementFile.classes[lastIndex].send("add_#{@functionIdentifier}",
functionElement)
end
if (@language.endBlockHandler.has_end_of_block?(pLine))
@language.rewind_state
end
return pElementFile
end
|
#handle_line(pLine) ⇒ Object
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/kuniri/state_machine/OO_structured_fsm/function_behaviour_state.rb', line 25
def handle_line(pLine)
if @language.conditionalHandler.get_conditional(pLine)
conditional_capture
elsif @language.repetitionHandler.get_repetition(pLine)
repetition_capture
elsif @language.aggregationHandler.get_aggregation(pLine)
aggregation_capture
else
return
end
end
|
#repetition_capture ⇒ Object
49
50
51
52
|
# File 'lib/kuniri/state_machine/OO_structured_fsm/function_behaviour_state.rb', line 49
def repetition_capture
@language.flagFunctionBehaviour = @flagState
@language.set_state(@language.repetitionState)
end
|