Class: StateMachine::OOStructuredFSM::ClassState
Overview
Class responsible for handling class state.
Instance Method Summary
collapse
#class_capture, #conditional_capture, #function_capture, #include_capture, #repetition_capture, #variable_capture
Constructor Details
#initialize(pLanguage) ⇒ ClassState
12
13
14
|
# File 'lib/kuniri/state_machine/OO_structured_fsm/class_state.rb', line 12
def initialize (pLanguage)
@language = pLanguage
end
|
Instance Method Details
#aggregation_capture ⇒ Object
66
67
68
|
# File 'lib/kuniri/state_machine/OO_structured_fsm/class_state.rb', line 66
def aggregation_capture
@language.set_state(@language.aggregationState)
end
|
#attribute_capture ⇒ Object
47
48
49
|
# File 'lib/kuniri/state_machine/OO_structured_fsm/class_state.rb', line 47
def attribute_capture
@language.set_state(@language.attributeState)
end
|
62
63
64
|
# File 'lib/kuniri/state_machine/OO_structured_fsm/class_state.rb', line 62
def
@language.set_state(@language.)
end
|
#constructor_capture ⇒ Object
42
43
44
|
# File 'lib/kuniri/state_machine/OO_structured_fsm/class_state.rb', line 42
def constructor_capture
@language.set_state(@language.constructorState)
end
|
#execute(pElementFile, pLine) ⇒ Object
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
# File 'lib/kuniri/state_machine/OO_structured_fsm/class_state.rb', line 71
def execute(pElementFile, pLine)
classElement = @language.classHandler.get_class(pLine)
if classElement
classElement. = @language.
@language. = ""
pElementFile.add_class(classElement)
@language.metadata.allClasses.push(classElement)
end
if @language.endBlockHandler.has_end_of_block?(pLine)
previous = @language.previousState.last
if (previous.is_a? (StateMachine::OOStructuredFSM::IdleState))
idle_capture
elsif (previous.is_a? (StateMachine::OOStructuredFSM::ModuleState))
module_capture
else
return pElementFile
end
end
return pElementFile
end
|
#handle_line(pLine) ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/kuniri/state_machine/OO_structured_fsm/class_state.rb', line 17
def handle_line(pLine)
if @language.aggregationHandler.get_aggregation(pLine)
aggregation_capture
elsif @language.attributeHandler.get_attribute(pLine)
attribute_capture
elsif @language.constructorHandler.get_constructor(pLine)
constructor_capture
elsif @language.methodHandler.get_function(pLine)
method_capture
elsif @language.moduleHandler.get_module(pLine)
module_capture
elsif @language.aggregationHandler.get_aggregation(pLine)
aggregation_capture
elsif @language.commentHandler.(pLine) ||
@language.commentHandler.(pLine)
end
end
|
#idle_capture ⇒ Object
57
58
59
|
# File 'lib/kuniri/state_machine/OO_structured_fsm/class_state.rb', line 57
def idle_capture
@language.rewind_state
end
|
#method_capture ⇒ Object
37
38
39
|
# File 'lib/kuniri/state_machine/OO_structured_fsm/class_state.rb', line 37
def method_capture
@language.set_state(@language.methodState)
end
|
#module_capture ⇒ Object
52
53
54
|
# File 'lib/kuniri/state_machine/OO_structured_fsm/class_state.rb', line 52
def module_capture
@language.rewind_state
end
|