Class: Crokus::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/crokus/runner.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.run(*arguments) ⇒ Object



9
10
11
# File 'lib/crokus/runner.rb', line 9

def self.run *arguments
  new.run(arguments)
end

Instance Method Details

#headerObject



25
26
27
# File 'lib/crokus/runner.rb', line 25

def header
  puts "Crokus (#{VERSION})- (c) JC Le Lann 2016-20"
end

#run(arguments) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/crokus/runner.rb', line 13

def run arguments
  compiler=Compiler.new
  compiler.options = args = parse_options(arguments)
  if filename=args[:cfile]
    compiler.compile filename
  elsif script=args[:random]
    compiler.execute script
  else
    puts "need a C file : crokus [options] <file.c>"
  end
end