breakout_parser 0.0.0 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/ext/breakout_parser/depend +4 -0
- data/ext/breakout_parser/extconf.rb +13 -3
- data/ext/breakout_parser/parser.tab.c +2164 -0
- metadata +3 -14
- data/.gitignore +0 -16
- data/Rakefile +0 -99
- data/VERSION +0 -1
- data/ext/breakout_parser/_make.sh +0 -7
- data/ext/breakout_parser/lex.yy.o +0 -0
- data/ext/breakout_parser/main.o +0 -0
- data/ext/breakout_parser/parser +0 -0
- data/ext/breakout_parser/parser.tab.o +0 -0
- data/ext/breakout_parser/ruby_ext.o +0 -0
- data/ext/breakout_parser/test.rb +0 -3
- data/ext/breakout_parser/yywrap.o +0 -0
- data/spec/parser_examples_spec.rb +0 -101
@@ -1,10 +1,12 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
+
windows = RUBY_PLATFORM =~ /(mswin|mingw)/i
|
4
|
+
|
3
5
|
require 'mkmf'
|
4
6
|
extension_name = 'breakout_parser'
|
5
7
|
|
6
8
|
$defs << %[-DRUBY_VERSION=\\"#{RUBY_VERSION}\\"]
|
7
|
-
$
|
9
|
+
$objs = %w'lex.yy.o parser.tab.o ruby_ext.o yywrap.o'
|
8
10
|
|
9
11
|
dir_config(extension_name)
|
10
12
|
if RUBY_PLATFORM['mswin32']
|
@@ -12,5 +14,13 @@ if RUBY_PLATFORM['mswin32']
|
|
12
14
|
end
|
13
15
|
create_makefile(([extension_name]*2).join('/'))
|
14
16
|
|
15
|
-
|
16
|
-
|
17
|
+
if !windows && File.exist?('Makefile') && find_executable('bison') && find_executable('lex')
|
18
|
+
File.open('Makefile','a') do |f|
|
19
|
+
f.puts
|
20
|
+
f.puts "parser.tab.c parser.tab.h: parser.y"
|
21
|
+
f.puts "\tbison -d parser.y"
|
22
|
+
f.puts
|
23
|
+
f.puts "lex.yy.c: parser.l"
|
24
|
+
f.puts "\tlex parser.l"
|
25
|
+
end
|
26
|
+
end
|