generate head from lua_register.txt