Class: Oryx::Runner

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Runner

Returns a new instance of Runner.



8
9
10
11
12
13
# File 'lib/oryx/runner.rb', line 8

def initialize argv
  @options = Options.new argv
  @input_filename  = @options.input
  @output_filename = @options.output
  @verbose = @options.verbose
end

Instance Attribute Details

#input_filenameObject (readonly)

Returns the value of attribute input_filename.



6
7
8
# File 'lib/oryx/runner.rb', line 6

def input_filename
  @input_filename
end

#output_filenameObject (readonly)

Returns the value of attribute output_filename.



6
7
8
# File 'lib/oryx/runner.rb', line 6

def output_filename
  @output_filename
end

Instance Method Details

#runObject



15
16
17
18
19
20
21
22
# File 'lib/oryx/runner.rb', line 15

def run
  puts "input:  #{input_filename}"
  puts "output: #{output_filename}"

  tokens = lex input_filename
  ast    = parse tokens
  generate ast
end