Class: MRuby::Command::Yacc

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

Instance Attribute Summary collapse

Attributes inherited from MRuby::Command

#build, #command

Instance Method Summary collapse

Methods inherited from MRuby::Command

#clone, #shellquote

Constructor Details

#initialize(build) ⇒ Yacc

Returns a new instance of Yacc.



244
245
246
247
248
# File 'ext/enterprise_script_service/mruby/lib/mruby/build/command.rb', line 244

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

Instance Attribute Details

#compile_optionsObject

Returns the value of attribute compile_options.



242
243
244
# File 'ext/enterprise_script_service/mruby/lib/mruby/build/command.rb', line 242

def compile_options
  @compile_options
end

Instance Method Details

#run(outfile, infile) ⇒ Object



250
251
252
253
254
# File 'ext/enterprise_script_service/mruby/lib/mruby/build/command.rb', line 250

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