2020-01-23 09:05:32 +01:00
|
|
|
require 'rspec/core/rake_task'
|
|
|
|
|
|
|
|
|
|
RSpec::Core::RakeTask.new do |c|
|
|
|
|
|
options = ['--color']
|
2020-01-23 19:16:16 +01:00
|
|
|
options += %w[--format documentation]
|
2020-01-23 09:05:32 +01:00
|
|
|
c.rspec_opts = options
|
|
|
|
|
end
|
|
|
|
|
|
2020-01-23 19:16:16 +01:00
|
|
|
desc 'Generate Lexer'
|
2020-01-23 09:05:32 +01:00
|
|
|
task :lexer do
|
|
|
|
|
`rex specification.rex -o lexer.rb`
|
2020-01-23 19:16:16 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
desc 'Generate Parser'
|
|
|
|
|
task :parser do
|
|
|
|
|
`racc grammar.y -o parser.rb`
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
desc 'Generate Lexer and Parser'
|
|
|
|
|
task generate: %i[lexer parser]
|