Add GrammarParser class to parse input file
This commit is contained in:
parent
75a1049040
commit
0cc4516c0e
@ -1,2 +1,15 @@
|
|||||||
require_relative "imbecile/cli"
|
require_relative "imbecile/cli"
|
||||||
|
require_relative "imbecile/grammar_parser"
|
||||||
require_relative "imbecile/version"
|
require_relative "imbecile/version"
|
||||||
|
|
||||||
|
module Imbecile
|
||||||
|
|
||||||
|
class << self
|
||||||
|
|
||||||
|
def run(input_file)
|
||||||
|
gp = GrammarParser.new(input_file)
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
@ -36,6 +36,11 @@ EOF
|
|||||||
$stderr.puts "Error: must specify input file"
|
$stderr.puts "Error: must specify input file"
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
unless File.readable?(input_file)
|
||||||
|
$stderr.puts "Error: cannot read #{input_file}"
|
||||||
|
return 2
|
||||||
|
end
|
||||||
|
Imbecile.run(input_file)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
8
lib/imbecile/grammar_parser.rb
Normal file
8
lib/imbecile/grammar_parser.rb
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
module Imbecile
|
||||||
|
class GrammarParser
|
||||||
|
|
||||||
|
def initialize(input_file)
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
Loading…
x
Reference in New Issue
Block a user