35 lines
755 B
Ruby
Executable file
35 lines
755 B
Ruby
Executable file
#!/usr/bin/env ruby
|
|
|
|
$:.insert(0, 'lib')
|
|
|
|
require 'thor'
|
|
require 'rly'
|
|
require 'pry'
|
|
require 'mm2ep_depend'
|
|
require 'pp'
|
|
|
|
module Mm2ep
|
|
module Depend
|
|
|
|
class ParseCli < Thor
|
|
desc 'parse INFILE', 'Parse INFILE into tokens'
|
|
def parse(infile)
|
|
line = File.read(infile).gsub(/\n/,'')
|
|
parser = Parser.new(Lexer.new)
|
|
puts line.inspect
|
|
token = parser.parse(line.chomp, true)
|
|
pp token
|
|
puts "RAW : #{line}"
|
|
puts "EVAL: #{token.to_s}"
|
|
# puts false && true
|
|
# puts false || false
|
|
# binding.pry
|
|
# parser = Parser2.new
|
|
# lexer = TestLexer.new(parser.parse(line))
|
|
# puts lexer.testlexe
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
Mm2ep::Depend::ParseCli.start(ARGV)
|