Sha256: 1d94ac3002d96928cdd0e57c2a3071320077c03c7fb8c054acf878b832638e14
Contents?: true
Size: 700 Bytes
Versions: 61
Compression:
Stored size: 700 Bytes
Contents
#!/usr/bin/env ruby require 'rubygems' gem 'treetop' $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + "/../lib")) require 'treetop' if ARGV.empty? puts "Usage:\n\ntt foo.treetop bar.treetop ...\n or\ntt foo.treetop -o alternate_name.rb\n\n" exit end compiler = Treetop::Compiler::GrammarCompiler.new while !ARGV.empty? treetop_file = ARGV.shift if !File.exist?(treetop_file) puts "Error: file '#{treetop_file}' doesn't exist\n\n" exit(2) end if ARGV.size >= 2 && ARGV[1] == '-o' ARGV.shift # explicit output file name option compiler.compile(treetop_file, ARGV.shift) else # list of input files option compiler.compile(treetop_file) end end
Version data entries
61 entries across 61 versions & 7 rubygems