forked from evanphx/kpeg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
45 lines (34 loc) · 852 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
40
41
42
43
44
45
# -*- ruby -*-
require 'rubygems'
require 'hoe'
Hoe.plugin :gemspec
Hoe.plugin :git
Hoe.plugin :minitest
Hoe.plugin :travis
Hoe.spec 'kpeg' do
self.readme_file = "README.rdoc"
developer 'Evan Phoenix', '[email protected]'
end
task :test => :parser
task :grammar do
require 'kpeg'
require 'kpeg/format'
require 'kpeg/grammar_renderer'
gr = KPeg::GrammarRenderer.new(KPeg::FORMAT)
gr.render(STDOUT)
end
rule ".rb" => ".kpeg" do |t|
ruby "-Ilib bin/kpeg -s -o #{t.name} -f #{t.source}"
end
PARSER_FILES = %w[
lib/kpeg/string_escape.rb
lib/kpeg/format_parser.rb
]
PARSER_FILES.map do |parser_file|
file parser_file => 'lib/kpeg/compiled_parser.rb'
file parser_file => 'lib/kpeg/code_generator.rb'
file parser_file => 'lib/kpeg/position.rb'
end
desc "build the parser"
task :parser => PARSER_FILES
# vim: syntax=ruby