Class: Parser::OutputFormat

Inherits:
Object
  • Object
show all
Defined in:
lib/kuniri/parser/output_format.rb

Direct Known Subclasses

XMLOutputFormat

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#extensionObject

Returns the value of attribute extension.



13
14
15
# File 'lib/kuniri/parser/output_format.rb', line 13

def extension
  @extension
end

#outputEngineObject

Returns the value of attribute outputEngine.



11
12
13
# File 'lib/kuniri/parser/output_format.rb', line 11

def outputEngine
  @outputEngine
end

#parserPathObject

Returns the value of attribute parserPath.



12
13
14
# File 'lib/kuniri/parser/output_format.rb', line 12

def parserPath
  @parserPath
end

Instance Method Details

#aggregation_generate(pAggregation) ⇒ Object

Raises:

  • (NotImplementedError)


105
106
107
# File 'lib/kuniri/parser/output_format.rb', line 105

def aggregation_generate(pAggregation)
  raise NotImplementedError
end

#attribute_generate(pAttribute) ⇒ Object

Raises:

  • (NotImplementedError)


77
78
79
# File 'lib/kuniri/parser/output_format.rb', line 77

def attribute_generate(pAttribute)
  raise NotImplementedError
end

#basic_structure_generate(pManager) ⇒ Object

Raises:

  • (NotImplementedError)


93
94
95
# File 'lib/kuniri/parser/output_format.rb', line 93

def basic_structure_generate(pManager)
  raise NotImplementedError
end

#class_generate(pClass) ⇒ Object

Raises:

  • (NotImplementedError)


65
66
67
# File 'lib/kuniri/parser/output_format.rb', line 65

def class_generate(pClass)
  raise NotImplementedError
end

#comment_generate(pComment) ⇒ Object

Raises:

  • (NotImplementedError)


101
102
103
# File 'lib/kuniri/parser/output_format.rb', line 101

def comment_generate(pComment)
  raise NotImplementedError
end

#create_all_data(pParser) ⇒ Object

Go through all the data, and generate the output

Parameters:

  • pParser

Returns:



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/kuniri/parser/output_format.rb', line 24

def create_all_data(pParser)
  return nil unless pParser

  saveElementTo = "./"
  wrapper = self

  # Go through each file
  pParser.fileLanguage.each do |listOfFile|
    # Inspect each element
    listOfFile.fileElements.each do |singleElement|
      @outputEngine.kuniri do
        if (singleElement.extern_requirements.length() > 0)
          wrapper.extern_requirement_generate(
                  singleElement.extern_requirements)
        end
        if (singleElement.modules.length() > 0)
          wrapper.module_generate(singleElement.modules)
        end
        #if (singleElement.global_variables.length() > 0)
        #  wrapper.global_variable_generate(
        #          singleElement.global_variables)
        #end
        if (singleElement.global_functions.length() > 0)
          singleElement.global_functions.each do |globalFunction|
            wrapper.function_behaviour_generate("functionData",
                                                globalFunction)
          end
        end
        if (singleElement.classes.length() > 0)
          wrapper.class_generate(singleElement.classes)
        end
      end
      saveElementTo = singleElement.name
    end

    write_file(saveElementTo, listOfFile.name)
    @outputEngine.reset_engine
  end

end

#extern_requirement_generate(pRequire) ⇒ Object

Raises:

  • (NotImplementedError)


89
90
91
# File 'lib/kuniri/parser/output_format.rb', line 89

def extern_requirement_generate(pRequire)
  raise NotImplementedError
end

#function_behaviour_generate(pElementName, pFunction) ⇒ Object

Raises:

  • (NotImplementedError)


81
82
83
# File 'lib/kuniri/parser/output_format.rb', line 81

def function_behaviour_generate(pElementName, pFunction)
  raise NotImplementedError
end

#global_variable_generate(pGlobalVariable) ⇒ Object

Raises:

  • (NotImplementedError)


85
86
87
# File 'lib/kuniri/parser/output_format.rb', line 85

def global_variable_generate(pGlobalVariable)
  raise NotImplementedError
end

#inheritance_generate(pInheritance) ⇒ Object

Raises:

  • (NotImplementedError)


69
70
71
# File 'lib/kuniri/parser/output_format.rb', line 69

def inheritance_generate(pInheritance)
  raise NotImplementedError
end

#module_generate(pModule) ⇒ Object

Raises:

  • (NotImplementedError)


97
98
99
# File 'lib/kuniri/parser/output_format.rb', line 97

def module_generate(pModule)
  raise NotImplementedError
end

#parameters_generate(pParameters) ⇒ Object

Raises:

  • (NotImplementedError)


73
74
75
# File 'lib/kuniri/parser/output_format.rb', line 73

def parameters_generate(pParameters)
  raise NotImplementedError
end

#set_path(pPath) ⇒ Object

Set path to save the output.

Parameters:

  • pPath

    Output path.



17
18
19
# File 'lib/kuniri/parser/output_format.rb', line 17

def set_path(pPath)
  @parserPath = pPath
end