tasks/scan.rake in radius-ts-1.0.0 vs tasks/scan.rake in radius-ts-1.1.0

- old
+ new

@@ -1,27 +1,56 @@ namespace :scan do - desc 'Generate the parser' - task 'build' => ['lib/radius/parser/scan.rb'] + desc 'Generate the parsers' + task 'build' => [ + 'lib/radius/parser/scanner.rb', + 'lib/radius/parser/squiggle_scanner.rb' + ] - desc 'Generate a PDF state graph from the parser' - task 'graph' => ['doc/scan.pdf'] + desc 'Generate a PDF state graph from the parsers' + task 'graph' => ['doc/scanner.pdf', 'doc/squiggle_scanner.rb'] - desc 'turn the scan.rl file into a ruby file' - file 'lib/radius/parser/scan.rb' => ['lib/radius/parser/scan.rl'] do |t| + desc 'turn the scanner.rl file into a ruby file' + file 'lib/radius/parser/scanner.rb' => 'lib/radius/parser/scanner.rl' do |t| cd 'lib/radius/parser' do - sh "ragel -R -F1 scan.rl" + sh "ragel -R -F1 scanner.rl" end end + + desc 'turn the squiggle_scanner.rl file into a ruby file' + file 'lib/radius/parser/squiggle_scanner.rb' => + ['lib/radius/parser/squiggle_scanner.rl'] \ + do |t| + cd 'lib/radius/parser' do + sh "ragel -R -F1 squiggle_scanner.rl" + end + end desc 'pdf of the ragel scanner' - file 'doc/scan.pdf' => 'lib/radius/parser/scan.dot' do |t| + file 'doc/scanner.pdf' => 'lib/radius/parser/scanner.dot' do |t| cd 'lib/radius/parser' do - sh "dot -Tpdf -o ../../../doc/scan.pdf scan.dot" + sh "dot -Tpdf -o ../../../doc/scanner.pdf scanner.dot" end end - file 'lib/radius/parser/scan.dot' => ['lib/radius/parser/scan.rl'] do |t| + desc 'pdf of the ragel squiggle scanner' + file 'doc/squiggle_scanner.pdf' => + ['lib/radius/parser/squiggle_scanner.dot'] \ + do |t| cd 'lib/radius/parser' do - sh "ragel -Vp scan.rl > scan.dot" + sh "dot -Tpdf -o ../../../doc/squiggle_scanner.pdf squiggle_scanner.dot" end end -end \ No newline at end of file + + file 'lib/radius/parser/scanner.dot' => 'lib/radius/parser/scanner.rl' do |t| + cd 'lib/radius/parser' do + sh "ragel -Vp scanner.rl > scanner.dot" + end + end + + file 'lib/radius/parser/squiggle_scanner.dot' => + ['lib/radius/parser/squiggle_scanner.rl'] \ + do |t| + cd 'lib/radius/parser' do + sh "ragel -Vp squiggle_scanner.rl > squiggle_scanner.dot" + end + end +end