Class: TracePreprocessor::Preprocessor

Inherits:
Object
  • Object
show all
Defined in:
lib/trace_preprocessor/preprocessor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(language, preprocessor_file_name) ⇒ Preprocessor

Returns a new instance of Preprocessor.



6
7
8
9
# File 'lib/trace_preprocessor/preprocessor.rb', line 6

def initialize language, preprocessor_file_name
  @language = language
  @preprocessor_file_name = preprocessor_file_name
end

Instance Attribute Details

#languageObject

Returns the value of attribute language.



3
4
5
# File 'lib/trace_preprocessor/preprocessor.rb', line 3

def language
  @language
end

#preprocessor_file_nameObject

Returns the value of attribute preprocessor_file_name.



4
5
6
# File 'lib/trace_preprocessor/preprocessor.rb', line 4

def preprocessor_file_name
  @preprocessor_file_name
end

Instance Method Details

#run(input_file_name, output_file_name) ⇒ Object



11
12
13
14
15
# File 'lib/trace_preprocessor/preprocessor.rb', line 11

def run input_file_name, output_file_name
  if @language == :c
    `#{preprocessor_file_name} < #{input_file_name} > #{output_file_name}`
  end
end