text_ux 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +25 -0
  3. data/.rspec +2 -0
  4. data/Gemfile +4 -0
  5. data/LICENSE.txt +22 -0
  6. data/README.md +51 -0
  7. data/Rakefile +18 -0
  8. data/ext/text_ux/extconf.rb +5 -0
  9. data/ext/text_ux/text_ux.cpp +252 -0
  10. data/lib/text_ux.rb +5 -0
  11. data/lib/text_ux/version.rb +3 -0
  12. data/spec/fixtures/test.ux +0 -0
  13. data/spec/spec_helper.rb +19 -0
  14. data/spec/text_ux_spec.rb +137 -0
  15. data/text_ux.gemspec +26 -0
  16. data/vendor/ux-trie/ux-0.1.9/.lock-waf_darwin_build +8 -0
  17. data/vendor/ux-trie/ux-0.1.9/.unittest-gtest/gtest-1.6.0/fused-src/gtest/gtest-all.cc +9118 -0
  18. data/vendor/ux-trie/ux-0.1.9/.unittest-gtest/gtest-1.6.0/fused-src/gtest/gtest.h +19537 -0
  19. data/vendor/ux-trie/ux-0.1.9/.unittest-gtest/gtest-1.6.0/fused-src/gtest/gtest_main.cc +39 -0
  20. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Build.py +733 -0
  21. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Build.pyc +0 -0
  22. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/ConfigSet.py +147 -0
  23. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/ConfigSet.pyc +0 -0
  24. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Configure.py +314 -0
  25. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Configure.pyc +0 -0
  26. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Context.py +298 -0
  27. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Context.pyc +0 -0
  28. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Errors.py +37 -0
  29. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Errors.pyc +0 -0
  30. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Logs.py +149 -0
  31. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Logs.pyc +0 -0
  32. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Node.py +500 -0
  33. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Node.pyc +0 -0
  34. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Options.py +130 -0
  35. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Options.pyc +0 -0
  36. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Runner.py +191 -0
  37. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Runner.pyc +0 -0
  38. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Scripting.py +358 -0
  39. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Scripting.pyc +0 -0
  40. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Task.py +669 -0
  41. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Task.pyc +0 -0
  42. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/TaskGen.py +341 -0
  43. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/TaskGen.pyc +0 -0
  44. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/__init__.py +4 -0
  45. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/__init__.pyc +0 -0
  46. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/ar.py +12 -0
  47. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/ar.pyc +0 -0
  48. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/asm.py +25 -0
  49. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/bison.py +29 -0
  50. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c.py +27 -0
  51. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_aliases.py +56 -0
  52. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_aliases.pyc +0 -0
  53. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_config.py +708 -0
  54. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_config.pyc +0 -0
  55. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_osx.py +121 -0
  56. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_osx.pyc +0 -0
  57. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_preproc.py +606 -0
  58. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_preproc.pyc +0 -0
  59. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_tests.py +110 -0
  60. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/c_tests.pyc +0 -0
  61. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/ccroot.py +372 -0
  62. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/ccroot.pyc +0 -0
  63. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/compiler_c.py +39 -0
  64. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/compiler_cxx.py +39 -0
  65. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/compiler_cxx.pyc +0 -0
  66. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/compiler_d.py +30 -0
  67. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/compiler_fc.py +45 -0
  68. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/cs.py +98 -0
  69. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/cxx.py +27 -0
  70. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/cxx.pyc +0 -0
  71. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/d.py +51 -0
  72. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/d_config.py +47 -0
  73. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/d_scan.py +133 -0
  74. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/dbus.py +30 -0
  75. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/dmd.py +43 -0
  76. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/errcheck.py +153 -0
  77. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/fc.py +123 -0
  78. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/fc_config.py +271 -0
  79. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/fc_scan.py +68 -0
  80. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/flex.py +27 -0
  81. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/g95.py +55 -0
  82. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/gas.py +10 -0
  83. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/gcc.py +98 -0
  84. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/gdc.py +34 -0
  85. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/gfortran.py +69 -0
  86. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/glib2.py +174 -0
  87. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/gnu_dirs.py +65 -0
  88. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/gxx.py +98 -0
  89. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/gxx.pyc +0 -0
  90. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/icc.py +31 -0
  91. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/icpc.py +30 -0
  92. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/ifort.py +42 -0
  93. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/intltool.py +78 -0
  94. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/irixcc.py +49 -0
  95. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/javaw.py +272 -0
  96. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/kde4.py +49 -0
  97. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/lua.py +19 -0
  98. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/msvc.py +650 -0
  99. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/nasm.py +13 -0
  100. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/perl.py +78 -0
  101. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/python.py +303 -0
  102. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/qt4.py +424 -0
  103. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/ruby.py +104 -0
  104. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/suncc.py +54 -0
  105. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/suncxx.py +55 -0
  106. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/tex.py +222 -0
  107. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/vala.py +215 -0
  108. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/waf_unit_test.py +79 -0
  109. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/winres.py +34 -0
  110. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/xlc.py +46 -0
  111. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Tools/xlcxx.py +46 -0
  112. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Utils.py +334 -0
  113. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/Utils.pyc +0 -0
  114. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/__init__.py +4 -0
  115. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/__init__.pyc +0 -0
  116. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/ansiterm.py +173 -0
  117. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/ansiterm.pyc +0 -0
  118. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/extras/__init__.py +4 -0
  119. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/extras/__init__.pyc +0 -0
  120. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/extras/compat15.py +223 -0
  121. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/extras/compat15.pyc +0 -0
  122. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/fixpy2.py +50 -0
  123. data/vendor/ux-trie/ux-0.1.9/.waf-1.6.8-3e3391c5f23fbabad81e6d17c63a1b1e/waflib/fixpy2.pyc +0 -0
  124. data/vendor/ux-trie/ux-0.1.9/src/bitVec.cpp +119 -0
  125. data/vendor/ux-trie/ux-0.1.9/src/bitVec.hpp +64 -0
  126. data/vendor/ux-trie/ux-0.1.9/src/bitVecTest.cpp +143 -0
  127. data/vendor/ux-trie/ux-0.1.9/src/cmdline.h +809 -0
  128. data/vendor/ux-trie/ux-0.1.9/src/rsDic.cpp +121 -0
  129. data/vendor/ux-trie/ux-0.1.9/src/rsDic.hpp +57 -0
  130. data/vendor/ux-trie/ux-0.1.9/src/ux.hpp +26 -0
  131. data/vendor/ux-trie/ux-0.1.9/src/uxMain.cpp +206 -0
  132. data/vendor/ux-trie/ux-0.1.9/src/uxMap.cpp +0 -0
  133. data/vendor/ux-trie/ux-0.1.9/src/uxMap.hpp +248 -0
  134. data/vendor/ux-trie/ux-0.1.9/src/uxMapTest.cpp +139 -0
  135. data/vendor/ux-trie/ux-0.1.9/src/uxTest.cpp +229 -0
  136. data/vendor/ux-trie/ux-0.1.9/src/uxTrie.cpp +529 -0
  137. data/vendor/ux-trie/ux-0.1.9/src/uxTrie.hpp +220 -0
  138. data/vendor/ux-trie/ux-0.1.9/src/uxUtil.cpp +92 -0
  139. data/vendor/ux-trie/ux-0.1.9/src/uxUtil.hpp +35 -0
  140. data/vendor/ux-trie/ux-0.1.9/src/wscript +43 -0
  141. data/vendor/ux-trie/ux-0.1.9/unittest_gtest.py +0 -0
  142. data/vendor/ux-trie/ux-0.1.9/unittest_gtest.pyc +0 -0
  143. data/vendor/ux-trie/ux-0.1.9/unittestt.py +166 -0
  144. data/vendor/ux-trie/ux-0.1.9/ux.pc.in +10 -0
  145. data/vendor/ux-trie/ux-0.1.9/waf +0 -0
  146. data/vendor/ux-trie/ux-0.1.9/wscript +32 -0
  147. metadata +249 -0
@@ -0,0 +1,341 @@
1
+ #! /usr/bin/env python
2
+ # encoding: utf-8
3
+ # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
4
+
5
+ import sys
6
+ if sys.hexversion < 0x020400f0: from sets import Set as set
7
+ import copy,re
8
+ from waflib import Task,Utils,Logs,Errors,ConfigSet
9
+ feats=Utils.defaultdict(set)
10
+ class task_gen(object):
11
+ mappings={}
12
+ prec=Utils.defaultdict(list)
13
+ def __init__(self,*k,**kw):
14
+ self.source=''
15
+ self.target=''
16
+ self.meths=[]
17
+ self.prec=Utils.defaultdict(list)
18
+ self.mappings={}
19
+ self.features=[]
20
+ self.tasks=[]
21
+ if not'bld'in kw:
22
+ self.env=ConfigSet.ConfigSet()
23
+ self.idx=0
24
+ self.path=None
25
+ else:
26
+ self.bld=kw['bld']
27
+ self.env=self.bld.env.derive()
28
+ self.path=self.bld.path
29
+ try:
30
+ self.idx=self.bld.idx[id(self.path)]=self.bld.idx.get(id(self.path),0)+1
31
+ except AttributeError:
32
+ self.bld.idx={}
33
+ self.idx=self.bld.idx[id(self.path)]=1
34
+ for key,val in kw.items():
35
+ setattr(self,key,val)
36
+ def __str__(self):
37
+ return"<task_gen %r declared in %s>"%(self.name,self.path.abspath())
38
+ def __repr__(self):
39
+ lst=[]
40
+ for x in self.__dict__.keys():
41
+ if x not in['env','bld','compiled_tasks','tasks']:
42
+ lst.append("%s=%s"%(x,repr(getattr(self,x))))
43
+ return"bld(%s) in %s"%(", ".join(lst),self.path.abspath())
44
+ def get_name(self):
45
+ try:
46
+ return self._name
47
+ except AttributeError:
48
+ if isinstance(self.target,list):
49
+ lst=[str(x)for x in self.target]
50
+ name=self._name=','.join(lst)
51
+ else:
52
+ name=self._name=str(self.target)
53
+ return name
54
+ def set_name(self,name):
55
+ self._name=name
56
+ name=property(get_name,set_name)
57
+ def to_list(self,val):
58
+ if isinstance(val,str):return val.split()
59
+ else:return val
60
+ def post(self):
61
+ if getattr(self,'posted',None):
62
+ return False
63
+ self.posted=True
64
+ keys=set(self.meths)
65
+ self.features=Utils.to_list(self.features)
66
+ for x in self.features+['*']:
67
+ st=feats[x]
68
+ if not st:
69
+ if not x in Task.classes:
70
+ Logs.warn('feature %r does not exist - bind at least one method to it'%x)
71
+ keys.update(list(st))
72
+ prec={}
73
+ prec_tbl=self.prec or task_gen.prec
74
+ for x in prec_tbl:
75
+ if x in keys:
76
+ prec[x]=prec_tbl[x]
77
+ tmp=[]
78
+ for a in keys:
79
+ for x in prec.values():
80
+ if a in x:break
81
+ else:
82
+ tmp.append(a)
83
+ out=[]
84
+ while tmp:
85
+ e=tmp.pop()
86
+ if e in keys:out.append(e)
87
+ try:
88
+ nlst=prec[e]
89
+ except KeyError:
90
+ pass
91
+ else:
92
+ del prec[e]
93
+ for x in nlst:
94
+ for y in prec:
95
+ if x in prec[y]:
96
+ break
97
+ else:
98
+ tmp.append(x)
99
+ if prec:
100
+ raise Errors.WafError('Cycle detected in the method execution %r'%prec)
101
+ out.reverse()
102
+ self.meths=out
103
+ Logs.debug('task_gen: posting %s %d'%(self,id(self)))
104
+ for x in out:
105
+ try:
106
+ v=getattr(self,x)
107
+ except AttributeError:
108
+ raise Errors.WafError('%r is not a valid task generator method'%x)
109
+ Logs.debug('task_gen: -> %s (%d)'%(x,id(self)))
110
+ v()
111
+ Logs.debug('task_gen: posted %s'%self.name)
112
+ return True
113
+ def get_hook(self,node):
114
+ name=node.name
115
+ for k in self.mappings:
116
+ if name.endswith(k):
117
+ return self.mappings[k]
118
+ for k in task_gen.mappings:
119
+ if name.endswith(k):
120
+ return task_gen.mappings[k]
121
+ raise Errors.WafError("File %r has no mapping in %r (did you forget to load a waf tool?)"%(node,task_gen.mappings.keys()))
122
+ def create_task(self,name,src=None,tgt=None):
123
+ task=Task.classes[name](env=self.env.derive(),generator=self)
124
+ if src:
125
+ task.set_inputs(src)
126
+ if tgt:
127
+ task.set_outputs(tgt)
128
+ self.tasks.append(task)
129
+ return task
130
+ def clone(self,env):
131
+ newobj=self.bld()
132
+ for x in self.__dict__:
133
+ if x in['env','bld']:
134
+ continue
135
+ elif x in['path','features']:
136
+ setattr(newobj,x,getattr(self,x))
137
+ else:
138
+ setattr(newobj,x,copy.copy(getattr(self,x)))
139
+ newobj.posted=False
140
+ if isinstance(env,str):
141
+ newobj.env=self.bld.all_envs[env].derive()
142
+ else:
143
+ newobj.env=env.derive()
144
+ return newobj
145
+ def declare_chain(name='',rule=None,reentrant=True,color='BLUE',ext_in=[],ext_out=[],before=[],after=[],decider=None,scan=None,install_path=None,shell=False):
146
+ ext_in=Utils.to_list(ext_in)
147
+ ext_out=Utils.to_list(ext_out)
148
+ if not name:
149
+ name=rule
150
+ cls=Task.task_factory(name,rule,color=color,ext_in=ext_in,ext_out=ext_out,before=before,after=after,scan=scan,shell=shell)
151
+ def x_file(self,node):
152
+ ext=decider and decider(self,node)or cls.ext_out
153
+ if ext_in:
154
+ _ext_in=ext_in[0]
155
+ out_source=[node.change_ext(x,ext_in=_ext_in)for x in ext]
156
+ if reentrant:
157
+ for i in range(reentrant):
158
+ self.source.append(out_source[i])
159
+ tsk=self.create_task(name,node,out_source)
160
+ if install_path:
161
+ self.bld.install_files(install_path,out_source)
162
+ return tsk
163
+ for x in cls.ext_in:
164
+ task_gen.mappings[x]=x_file
165
+ return x_file
166
+ def taskgen_method(func):
167
+ setattr(task_gen,func.__name__,func)
168
+ return func
169
+ def feature(*k):
170
+ def deco(func):
171
+ setattr(task_gen,func.__name__,func)
172
+ for name in k:
173
+ feats[name].update([func.__name__])
174
+ return func
175
+ return deco
176
+ def before_method(*k):
177
+ def deco(func):
178
+ setattr(task_gen,func.__name__,func)
179
+ for fun_name in k:
180
+ if not func.__name__ in task_gen.prec[fun_name]:
181
+ task_gen.prec[fun_name].append(func.__name__)
182
+ return func
183
+ return deco
184
+ before=before_method
185
+ def after_method(*k):
186
+ def deco(func):
187
+ setattr(task_gen,func.__name__,func)
188
+ for fun_name in k:
189
+ if not fun_name in task_gen.prec[func.__name__]:
190
+ task_gen.prec[func.__name__].append(fun_name)
191
+ return func
192
+ return deco
193
+ after=after_method
194
+ def extension(*k):
195
+ def deco(func):
196
+ setattr(task_gen,func.__name__,func)
197
+ for x in k:
198
+ task_gen.mappings[x]=func
199
+ return func
200
+ return deco
201
+ def to_nodes(self,lst,path=None):
202
+ tmp=[]
203
+ path=path or self.path
204
+ find=path.find_resource
205
+ if isinstance(lst,self.path.__class__):
206
+ lst=[lst]
207
+ for x in Utils.to_list(lst):
208
+ if isinstance(x,str):
209
+ node=find(x)
210
+ if not node:
211
+ raise Errors.WafError("source not found: %r in %r"%(x,self))
212
+ else:
213
+ node=x
214
+ tmp.append(node)
215
+ return tmp
216
+ def process_source(self):
217
+ self.source=self.to_nodes(getattr(self,'source',[]))
218
+ for node in self.source:
219
+ self.get_hook(node)(self,node)
220
+ def process_rule(self):
221
+ if not getattr(self,'rule',None):
222
+ return
223
+ name=str(getattr(self,'name',None)or self.target or self.rule)
224
+ cls=Task.task_factory(name,self.rule,getattr(self,'vars',[]),shell=getattr(self,'shell',True),color=getattr(self,'color','BLUE'))
225
+ tsk=self.create_task(name)
226
+ if getattr(self,'target',None):
227
+ if isinstance(self.target,str):
228
+ self.target=self.target.split()
229
+ if not isinstance(self.target,list):
230
+ self.target=[self.target]
231
+ for x in self.target:
232
+ if isinstance(x,str):
233
+ tsk.outputs.append(self.path.find_or_declare(x))
234
+ else:
235
+ x.parent.mkdir()
236
+ tsk.outputs.append(x)
237
+ if getattr(self,'install_path',None):
238
+ self.bld.install_files(self.install_path,tsk.outputs)
239
+ if getattr(self,'source',None):
240
+ tsk.inputs=self.to_nodes(self.source)
241
+ self.source=[]
242
+ if getattr(self,'scan',None):
243
+ cls.scan=self.scan
244
+ elif getattr(self,'deps',None):
245
+ def scan(self):
246
+ nodes=[]
247
+ for x in self.generator.to_list(self.generator.deps):
248
+ node=self.generator.path.find_resource(x)
249
+ if not node:
250
+ self.generator.bld.fatal('Could not find %r (was it declared?)'%x)
251
+ nodes.append(node)
252
+ return[nodes,[]]
253
+ cls.scan=scan
254
+ if getattr(self,'cwd',None):
255
+ tsk.cwd=self.cwd
256
+ if getattr(self,'update_outputs',None)or getattr(self,'on_results',None):
257
+ Task.update_outputs(cls)
258
+ if getattr(self,'always',None):
259
+ Task.always_run(cls)
260
+ for x in['after','before','ext_in','ext_out']:
261
+ setattr(cls,x,getattr(self,x,[]))
262
+ def sequence_order(self):
263
+ if self.meths and self.meths[-1]!='sequence_order':
264
+ self.meths.append('sequence_order')
265
+ return
266
+ if getattr(self,'seq_start',None):
267
+ return
268
+ if getattr(self.bld,'prev',None):
269
+ self.bld.prev.post()
270
+ for x in self.bld.prev.tasks:
271
+ for y in self.tasks:
272
+ y.set_run_after(x)
273
+ self.bld.prev=self
274
+ re_m4=re.compile('@(\w+)@',re.M)
275
+ class subst_pc(Task.Task):
276
+ def run(self):
277
+ code=self.inputs[0].read()
278
+ code=code.replace('%','%%')
279
+ lst=[]
280
+ def repl(match):
281
+ g=match.group
282
+ if g(1):
283
+ lst.append(g(1))
284
+ return"%%(%s)s"%g(1)
285
+ return''
286
+ code=re_m4.sub(repl,code)
287
+ try:
288
+ d=self.generator.dct
289
+ except AttributeError:
290
+ d={}
291
+ for x in lst:
292
+ tmp=getattr(self.generator,x,'')or self.env.get_flat(x)or self.env.get_flat(x.upper())
293
+ d[x]=str(tmp)
294
+ self.outputs[0].write(code%d)
295
+ self.generator.bld.raw_deps[self.uid()]=self.dep_vars=lst
296
+ try:delattr(self,'cache_sig')
297
+ except AttributeError:pass
298
+ def sig_vars(self):
299
+ bld=self.generator.bld
300
+ env=self.env
301
+ upd=self.m.update
302
+ vars=self.generator.bld.raw_deps.get(self.uid(),[])
303
+ act_sig=bld.hash_env_vars(env,vars)
304
+ upd(act_sig)
305
+ lst=[getattr(self.generator,x,'')for x in vars]
306
+ upd(Utils.h_list(lst))
307
+ return self.m.digest()
308
+ def add_pcfile(self,node):
309
+ tsk=self.create_task('subst_pc',node,node.change_ext('.pc','.pc.in'))
310
+ self.bld.install_files(getattr(self,'install_path','${LIBDIR}/pkgconfig/'),tsk.outputs)
311
+ class subst(subst_pc):
312
+ pass
313
+ def process_subst(self):
314
+ src=self.to_nodes(getattr(self,'source',[]))
315
+ tgt=getattr(self,'target',[])
316
+ if isinstance(tgt,self.path.__class__):
317
+ tgt=[tgt]
318
+ tgt=[isinstance(x,self.path.__class__)and x or self.path.find_or_declare(x)for x in Utils.to_list(tgt)]
319
+ if len(src)!=len(tgt):
320
+ raise Errors.WafError('invalid source or target for %r'%self)
321
+ for x,y in zip(src,tgt):
322
+ if not(x and y):
323
+ raise Errors.WafError('invalid source or target for %r'%self)
324
+ tsk=self.create_task('subst',x,y)
325
+ for a in('after','before','ext_in','ext_out'):
326
+ val=getattr(self,a,None)
327
+ if val:
328
+ setattr(tsk,a,val)
329
+ inst_to=getattr(self,'install_path',None)
330
+ if inst_to:
331
+ self.bld.install_files(inst_to,tgt,chmod=getattr(self,'chmod',Utils.O644))
332
+ self.source=[]
333
+
334
+ taskgen_method(to_nodes)
335
+ feature('*')(process_source)
336
+ feature('*')(process_rule)
337
+ before_method('process_source')(process_rule)
338
+ feature('seq')(sequence_order)
339
+ extension('.pc.in')(add_pcfile)
340
+ feature('subst')(process_subst)
341
+ before_method('process_source','process_rule')(process_subst)
@@ -0,0 +1,4 @@
1
+ #! /usr/bin/env python
2
+ # encoding: utf-8
3
+ # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
4
+
@@ -0,0 +1,12 @@
1
+ #! /usr/bin/env python
2
+ # encoding: utf-8
3
+ # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
4
+
5
+ from waflib.Configure import conf
6
+ def find_ar(conf):
7
+ conf.load('ar')
8
+ def configure(conf):
9
+ conf.find_program('ar',var='AR')
10
+ conf.env.ARFLAGS='rcs'
11
+
12
+ conf(find_ar)
@@ -0,0 +1,25 @@
1
+ #! /usr/bin/env python
2
+ # encoding: utf-8
3
+ # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
4
+
5
+ import os,sys
6
+ from waflib import Task,Utils
7
+ import waflib.Task
8
+ from waflib.Tools.ccroot import link_task,stlink_task
9
+ from waflib.TaskGen import extension,feature
10
+ class asm(Task.Task):
11
+ color='BLUE'
12
+ run_str='${AS} ${ASFLAGS} ${CPPPATH_ST:INCPATHS} ${AS_SRC_F}${SRC} ${AS_TGT_F}${TGT}'
13
+ def asm_hook(self,node):
14
+ return self.create_compiled_task('asm',node)
15
+ class asmprogram(link_task):
16
+ run_str='${ASLINK} ${AS_TGT_F}${TGT} ${SRC}'
17
+ ext_out=['.bin']
18
+ inst_to='${BINDIR}'
19
+ chmod=Utils.O755
20
+ class asmshlib(asmprogram):
21
+ inst_to='${LIBDIR}'
22
+ class asmstlib(stlink_task):
23
+ pass
24
+
25
+ extension('.s','.S','.asm','.ASM','.spp','.SPP')(asm_hook)
@@ -0,0 +1,29 @@
1
+ #! /usr/bin/env python
2
+ # encoding: utf-8
3
+ # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
4
+
5
+ from waflib import Task
6
+ from waflib.TaskGen import extension
7
+ class bison(Task.Task):
8
+ color='BLUE'
9
+ run_str='${BISON} ${BISONFLAGS} ${SRC[0].abspath()} -o ${TGT[0].name}'
10
+ ext_out=['.h']
11
+ def big_bison(self,node):
12
+ has_h='-d'in self.env['BISONFLAGS']
13
+ outs=[]
14
+ if node.name.endswith('.yc'):
15
+ outs.append(node.change_ext('.tab.cc'))
16
+ if has_h:
17
+ outs.append(node.change_ext('.tab.hh'))
18
+ else:
19
+ outs.append(node.change_ext('.tab.c'))
20
+ if has_h:
21
+ outs.append(node.change_ext('.tab.h'))
22
+ tsk=self.create_task('bison',node,outs)
23
+ tsk.cwd=node.parent.get_bld().abspath()
24
+ self.source.append(outs[0])
25
+ def configure(conf):
26
+ conf.find_program('bison',var='BISON')
27
+ conf.env.BISONFLAGS=['-d']
28
+
29
+ extension('.y','.yc','.yy')(big_bison)
@@ -0,0 +1,27 @@
1
+ #! /usr/bin/env python
2
+ # encoding: utf-8
3
+ # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
4
+
5
+ from waflib import TaskGen,Task,Utils
6
+ from waflib.Tools import c_preproc
7
+ from waflib.Tools.ccroot import link_task,stlink_task
8
+ def c_hook(self,node):
9
+ return self.create_compiled_task('c',node)
10
+ class c(Task.Task):
11
+ run_str='${CC} ${ARCH_ST:ARCH} ${CFLAGS} ${CPPFLAGS} ${FRAMEWORKPATH_ST:FRAMEWORKPATH} ${CPPPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${CC_SRC_F}${SRC} ${CC_TGT_F}${TGT}'
12
+ vars=['CCDEPS']
13
+ ext_in=['.h']
14
+ scan=c_preproc.scan
15
+ Task.classes['cc']=cc=c
16
+ class cprogram(link_task):
17
+ run_str='${LINK_CC} ${LINKFLAGS} ${CCLNK_SRC_F}${SRC} ${CCLNK_TGT_F}${TGT[0].abspath()} ${RPATH_ST:RPATH} ${FRAMEWORKPATH_ST:FRAMEWORKPATH} ${FRAMEWORK_ST:FRAMEWORK} ${ARCH_ST:ARCH} ${STLIB_MARKER} ${STLIBPATH_ST:STLIBPATH} ${STLIB_ST:STLIB} ${SHLIB_MARKER} ${LIBPATH_ST:LIBPATH} ${LIB_ST:LIB}'
18
+ ext_out=['.bin']
19
+ vars=['LINKDEPS']
20
+ inst_to='${BINDIR}'
21
+ chmod=Utils.O755
22
+ class cshlib(cprogram):
23
+ inst_to='${LIBDIR}'
24
+ class cstlib(stlink_task):
25
+ pass
26
+
27
+ TaskGen.extension('.c')(c_hook)