117 File.open("node_types.c", "w") do |f|
119 /* This file is generated by node_types.rb. Do not edit. */
121 #include "node_types.h"
123 static const char node_types[] = {
126 node_types.each do |type|
127 f.puts(" \"#{type}\\0\"")
133 f.puts("static const unsigned short node_types_offsets[] = {")
136 node_types.each_with_index do |type, index|
137 f.puts(",") if index > 0
138 f.write(" #{offset}")
139 offset += node_types[index].length + 1
146 const char *get_node_type_string(enum node_type nt) {
147 return node_types + node_types_offsets[nt];
152 File.open("node_types.h", "w") do |f|
154 /* This file is generated by node_types.rb. Do not edit. */
159 node_types.each_with_index do |type, index|
160 f.puts(",") if index > 0
161 f.write(" NODE_#{type.upcase}")
168 const char *get_node_type_string(enum node_type nt);