Class: MRuby::Command::Yacc

Inherits:
MRuby::Command show all
Defined in:
ext/enterprise_script_service/mruby/lib/mruby/build/command.rb

Constant Summary

Constants inherited from MRuby::Command

NotFoundCommands

Instance Attribute Summary collapse

Attributes inherited from MRuby::Command

#build, #command

Instance Method Summary collapse

Methods inherited from MRuby::Command

#clone

Constructor Details

#initialize(build) ⇒ Yacc

Returns a new instance of Yacc.



215
216
217
218
219
# File 'ext/enterprise_script_service/mruby/lib/mruby/build/command.rb', line 215

def initialize(build)
  super
  @command = 'bison'
  @compile_options = '-o %{outfile} %{infile}'
end

Instance Attribute Details

#compile_optionsObject

Returns the value of attribute compile_options.



213
214
215
# File 'ext/enterprise_script_service/mruby/lib/mruby/build/command.rb', line 213

def compile_options
  @compile_options
end

Instance Method Details

#run(outfile, infile) ⇒ Object



221
222
223
224
225
# File 'ext/enterprise_script_service/mruby/lib/mruby/build/command.rb', line 221

def run(outfile, infile)
  FileUtils.mkdir_p File.dirname(outfile)
  _pp "YACC", infile.relative_path, outfile.relative_path
  _run compile_options, { :outfile => filename(outfile) , :infile => filename(infile) }
end