34 lines
705 B
Ruby
Executable file
34 lines
705 B
Ruby
Executable file
#!/usr/bin/env ruby
|
|
|
|
$:.insert(0, 'lib')
|
|
|
|
require 'thor'
|
|
require 'rly'
|
|
require 'pry'
|
|
require 'parser.rb'
|
|
require 'lexer.rb'
|
|
require 'lexer2.rb'
|
|
require 'parser2.rb'
|
|
|
|
module Mm2ep
|
|
module Depend
|
|
|
|
class ParseCli < Thor
|
|
desc 'parse INFILE', 'Parse INFILE into tokens'
|
|
def parse(infile)
|
|
File.open(infile).each_line do |line|
|
|
parser = Parser.new(Lexer.new)
|
|
puts line.inspect
|
|
token = parser.parse(line.chomp, true)
|
|
puts token
|
|
# binding.pry
|
|
# parser = Parser2.new
|
|
# lexer = TestLexer.new(parser.parse(line))
|
|
# puts lexer.testlexe
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
Mm2ep::Depend::ParseCli.start(ARGV)
|