summaryrefslogtreecommitdiff
path: root/lib/racc/pre-setup
diff options
context:
space:
mode:
Diffstat (limited to 'lib/racc/pre-setup')
-rw-r--r--lib/racc/pre-setup13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/racc/pre-setup b/lib/racc/pre-setup
new file mode 100644
index 0000000000..5027d865b7
--- /dev/null
+++ b/lib/racc/pre-setup
@@ -0,0 +1,13 @@
+def generate_parser_text_rb(target)
+ return if File.exist?(srcfile(target))
+ $stderr.puts "generating #{target}..."
+ File.open(target, 'w') {|f|
+ f.puts "module Racc"
+ f.puts " PARSER_TEXT = <<'__end_of_file__'"
+ f.puts File.read(srcfile('parser.rb'))
+ f.puts "__end_of_file__"
+ f.puts "end"
+ }
+end
+
+generate_parser_text_rb 'parser-text.rb'