-
Notifications
You must be signed in to change notification settings - Fork 2
/
Rakefile
39 lines (32 loc) · 909 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
require 'bundler/gem_tasks'
require 'rake/extensiontask'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
Rake::ExtensionTask.new('lexerc') do |config|
config.lib_dir = 'lib/hotcell'
end
task :default => :spec
desc 'Builds all the project'
task :project do
%w(project:lexerr project:lexerc project:parser clobber compile).each do |task|
Rake::Task[task].invoke
end
end
namespace :project do
desc 'Build lexer'
task :lexerr do
`ragel -R -F1 -I lib/hotcell lib/hotcell/lexerr.rl`
end
desc 'Build lexer'
task :lexerc do
`ragel -C -G2 -I lib/hotcell ext/lexerc/lexerc.rl`
end
task :dot do
`ragel -Vp -I lib/hotcell lib/hotcell/lexerr.rl > lexerr.dot`
`ragel -Vp -I lib/hotcell ext/lexerc/lexerc.rl > lexerc.dot`
end
desc 'Build parser'
task :parser do
`racc -o lib/hotcell/parser.rb -O lib/hotcell/parser.out lib/hotcell/parser.y`
end
end