Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 7e211c1075
Fetching contributors…

Cannot retrieve contributors at this time

60 lines (44 sloc) 1.326 kB
require 'buildr/scala'
JAVA_HOME = ENV['JAVA_HOME']
GLL = task "../target/scala-#{Scala.version}/classes" do
Dir.chdir '..' do
sh 'sbt compile' do |ok, res|
ok or fail 'Failed to compile gll-combinators.'
end
end
end
layout = Layout.new
layout[:source, :main, :scala] = 'src'
layout[:target, :main, :classes] = 'target'
layout[:target, :classes] = 'target'
define 'examples', :layout => layout do
compile.with GLL
run_eg = proc do |name|
classname = "#{name.downcase}.#{name}Parser"
puts "Running #{name} example"
puts
cp = compile.dependencies.map(&:to_s).join(File::PATH_SEPARATOR) + File::PATH_SEPARATOR + _(:target)
trace cp
start = Time.now
sh JAVA_HOME + '/bin/java', '-cp', cp, classname, *Dir.glob("input/#{name.downcase}/*")
puts "Total run time: #{Time.now - start} seconds"
puts '---------------------------------------'
puts
end
task :arithmetic => :compile do
run_eg.call 'Arithmetic'
end
task :miniml => :compile do
run_eg.call 'MiniML'
end
task :lambdacalc => :compile do
run_eg.call 'LambdaCalc'
end
task :paren => :compile do
run_eg.call 'Paren'
end
task :conf => :compile do
run_eg.call 'Config'
end
task :run => [:arithmetic, :miniml, :lambdacalc, :paren]
end
Jump to Line
Something went wrong with that request. Please try again.