adlint 2.6.14 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (401) hide show
  1. data/AUTHORS +1 -3
  2. data/ChangeLog +511 -0
  3. data/INSTALL +1 -1
  4. data/MANIFEST +57 -37
  5. data/NEWS +36 -7
  6. data/README +2 -2
  7. data/Rakefile +6 -6
  8. data/TODO +1 -1
  9. data/bin/adlint +25 -16
  10. data/bin/adlint_chk +22 -12
  11. data/bin/adlint_cma +17 -12
  12. data/bin/adlint_sma +22 -12
  13. data/bin/adlintize +98 -17
  14. data/etc/conf.d/fallback/cinit.erb +1 -1
  15. data/etc/conf.d/fallback/traits.erb +37 -37
  16. data/etc/conf.d/i686-cygwin/cinit-gcc_4.3.4.erb +1 -1
  17. data/etc/conf.d/i686-cygwin/traits-gcc_4.3.4.erb +41 -41
  18. data/etc/conf.d/i686-devkit/cinit-gcc_4.5.2.erb +1 -1
  19. data/etc/conf.d/i686-devkit/traits-gcc_4.5.2.erb +40 -40
  20. data/etc/conf.d/i686-linux/cinit-gcc_4.5.1.erb +1 -1
  21. data/etc/conf.d/i686-linux/traits-gcc_4.5.1.erb +40 -40
  22. data/etc/conf.d/i686-mingw/cinit-gcc_4.6.1.erb +1 -1
  23. data/etc/conf.d/i686-mingw/traits-gcc_4.6.1.erb +40 -40
  24. data/etc/conf.d/noarch/GNUmakefile.erb +1 -1
  25. data/etc/conf.d/noarch/adlint_all_bat.erb +1 -1
  26. data/etc/conf.d/noarch/adlint_all_sh.erb +1 -1
  27. data/etc/conf.d/noarch/pinit.erb +1 -1
  28. data/etc/conf.d/x86_64-ubuntu_12.04/cinit-gcc_4.6.3.erb +1 -1
  29. data/etc/conf.d/x86_64-ubuntu_12.04/traits-gcc_4.6.3.erb +42 -42
  30. data/etc/mesg.d/c_builtin/en_US/messages.yml +33 -33
  31. data/etc/mesg.d/c_builtin/ja_JP/messages.yml +5 -5
  32. data/etc/mesg.d/core/en_US/messages.yml +2 -2
  33. data/etc/mesg.d/core/ja_JP/messages.yml +2 -2
  34. data/features/code_check/W0018.feature +197 -0
  35. data/features/code_check/W0019.feature +79 -0
  36. data/features/code_check/W0021.feature +81 -0
  37. data/features/code_check/W0023.feature +203 -0
  38. data/features/code_check/W0024.feature +226 -0
  39. data/features/code_check/W0025.feature +5 -0
  40. data/features/code_check/W0088.feature +2 -2
  41. data/features/code_check/W0109.feature +2 -2
  42. data/features/code_check/W0477.feature +0 -3
  43. data/features/code_check/W0478.feature +0 -1
  44. data/features/code_check/W0582.feature +3 -3
  45. data/features/code_check/W0583.feature +4 -7
  46. data/features/code_check/W0646.feature +0 -1
  47. data/features/code_check/W0695.feature +0 -1
  48. data/features/code_check/W0705.feature +8 -0
  49. data/features/code_check/W0723.feature +0 -1
  50. data/features/code_check/W0745.feature +1 -0
  51. data/features/code_check/W0781.feature +1 -0
  52. data/features/code_check/W1057.feature +141 -0
  53. data/features/code_check/W1058.feature +93 -0
  54. data/features/code_check/W1059.feature +86 -0
  55. data/features/code_check/W1060.feature +77 -0
  56. data/features/code_check/W1061.feature +143 -0
  57. data/features/code_check/W1062.feature +162 -0
  58. data/features/code_check/W1063.feature +123 -0
  59. data/features/code_check/W1064.feature +83 -0
  60. data/features/code_check/W1065.feature +82 -0
  61. data/features/code_check/W9003.feature +2 -0
  62. data/features/step_definitions/code_check_steps.rb +1 -0
  63. data/features/support/env.rb +16 -13
  64. data/lib/adlint.rb +7 -4
  65. data/lib/adlint/analyzer.rb +131 -157
  66. data/lib/adlint/annot.rb +149 -0
  67. data/lib/adlint/cc1.rb +57 -0
  68. data/lib/adlint/{c → cc1}/branch.rb +74 -62
  69. data/lib/adlint/{c → cc1}/builtin.rb +21 -21
  70. data/lib/adlint/{c → cc1}/const.rb +119 -117
  71. data/lib/adlint/{c → cc1}/conv.rb +76 -78
  72. data/lib/adlint/{c → cc1}/ctrlexpr.rb +69 -86
  73. data/lib/adlint/cc1/domain.rb +8103 -0
  74. data/lib/adlint/{c → cc1}/enum.rb +3 -3
  75. data/lib/adlint/{c → cc1}/environ.rb +21 -21
  76. data/lib/adlint/{c → cc1}/expr.rb +232 -218
  77. data/lib/adlint/{c → cc1}/format.rb +305 -342
  78. data/lib/adlint/{c → cc1}/interp.rb +269 -220
  79. data/lib/adlint/cc1/lexer.rb +246 -0
  80. data/lib/adlint/{c → cc1}/mediator.rb +78 -84
  81. data/lib/adlint/{c → cc1}/object.rb +261 -264
  82. data/lib/adlint/{c → cc1}/operator.rb +7 -7
  83. data/lib/adlint/{c → cc1}/option.rb +4 -3
  84. data/lib/adlint/{c → cc1}/parser.rb +274 -506
  85. data/lib/adlint/{c → cc1}/parser.y +69 -301
  86. data/lib/adlint/cc1/phase.rb +138 -0
  87. data/lib/adlint/{c → cc1}/resolver.rb +66 -78
  88. data/lib/adlint/{c → cc1}/scanner.rb +57 -49
  89. data/lib/adlint/{c → cc1}/scope.rb +3 -3
  90. data/lib/adlint/{c → cc1}/seqp.rb +13 -5
  91. data/lib/adlint/{c → cc1}/syntax.rb +819 -1122
  92. data/lib/adlint/{c → cc1}/type.rb +1498 -1479
  93. data/lib/adlint/{c → cc1}/util.rb +20 -12
  94. data/lib/adlint/{c → cc1}/value.rb +699 -642
  95. data/lib/adlint/code.rb +163 -164
  96. data/lib/adlint/cpp.rb +2 -2
  97. data/lib/adlint/cpp/asm.rb +13 -14
  98. data/lib/adlint/cpp/constexpr.rb +42 -38
  99. data/lib/adlint/cpp/constexpr.y +44 -40
  100. data/lib/adlint/cpp/eval.rb +435 -435
  101. data/lib/adlint/cpp/lexer.rb +343 -340
  102. data/lib/adlint/cpp/macro.rb +188 -190
  103. data/lib/adlint/cpp/phase.rb +66 -45
  104. data/lib/adlint/cpp/scanner.rb +14 -17
  105. data/lib/adlint/cpp/source.rb +49 -55
  106. data/lib/adlint/cpp/subst.rb +65 -65
  107. data/lib/adlint/cpp/syntax.rb +155 -275
  108. data/lib/adlint/cpp/util.rb +22 -19
  109. data/lib/adlint/driver.rb +86 -93
  110. data/lib/adlint/error.rb +33 -52
  111. data/lib/adlint/exam.rb +158 -24
  112. data/lib/adlint/exam/c_builtin.rb +7 -7
  113. data/lib/adlint/exam/c_builtin/cc1_check.rb +20522 -0
  114. data/lib/adlint/exam/c_builtin/cc1_check_shima.rb +957 -0
  115. data/lib/adlint/exam/c_builtin/cc1_code.rb +459 -0
  116. data/lib/adlint/exam/c_builtin/cc1_metric.rb +794 -0
  117. data/lib/adlint/exam/c_builtin/cpp_check.rb +486 -441
  118. data/lib/adlint/exam/c_builtin/cpp_check_shima.rb +36 -39
  119. data/lib/adlint/exam/c_builtin/cpp_code.rb +63 -65
  120. data/lib/adlint/exam/c_builtin/ld_check.rb +136 -129
  121. data/lib/adlint/exam/c_builtin/ld_metric.rb +11 -11
  122. data/lib/adlint/lang.rb +25 -25
  123. data/lib/adlint/ld.rb +2 -2
  124. data/lib/adlint/ld/object.rb +220 -188
  125. data/lib/adlint/ld/phase.rb +94 -63
  126. data/lib/adlint/ld/typedef.rb +22 -11
  127. data/lib/adlint/ld/util.rb +43 -35
  128. data/lib/adlint/lexer.rb +59 -56
  129. data/lib/adlint/location.rb +140 -0
  130. data/lib/adlint/memo.rb +157 -0
  131. data/lib/adlint/message.rb +207 -156
  132. data/lib/adlint/metric.rb +139 -217
  133. data/lib/adlint/monitor.rb +45 -43
  134. data/lib/adlint/phase.rb +56 -29
  135. data/lib/adlint/prelude.rb +66 -54
  136. data/lib/adlint/report.rb +253 -332
  137. data/lib/adlint/source.rb +26 -27
  138. data/lib/adlint/supp.rb +131 -0
  139. data/lib/adlint/symbol.rb +14 -16
  140. data/lib/adlint/token.rb +19 -91
  141. data/lib/adlint/traits.rb +242 -226
  142. data/lib/adlint/util.rb +116 -205
  143. data/lib/adlint/version.rb +8 -8
  144. data/share/HEADER +2 -2
  145. data/share/doc/developers_guide_ja.html +148 -19
  146. data/share/doc/developers_guide_ja.texi +141 -11
  147. data/share/doc/samples/GNUmakefile +1 -1
  148. data/share/doc/samples/adlint_traits.yml +45 -36
  149. data/share/doc/users_guide_en.html +1321 -1252
  150. data/share/doc/users_guide_en.texi +475 -408
  151. data/share/doc/users_guide_ja.html +1932 -1878
  152. data/share/doc/users_guide_ja.texi +324 -273
  153. data/share/sample/bison-2.5/adlint/GNUmakefile +5 -1
  154. data/share/sample/bison-2.5/adlint/adlint_traits.yml +38 -38
  155. data/share/sample/bison-2.5/adlint/lib/GNUmakefile +1 -1
  156. data/share/sample/bison-2.5/adlint/lib/adlint_cinit.h +1 -1
  157. data/share/sample/bison-2.5/adlint/lib/adlint_pinit.h +1 -1
  158. data/share/sample/bison-2.5/adlint/lib/adlint_traits.yml +50 -42
  159. data/share/sample/bison-2.5/adlint/src/GNUmakefile +1 -1
  160. data/share/sample/bison-2.5/adlint/src/adlint_cinit.h +1 -1
  161. data/share/sample/bison-2.5/adlint/src/adlint_pinit.h +1 -1
  162. data/share/sample/bison-2.5/adlint/src/adlint_traits.yml +50 -42
  163. data/share/sample/ctags-5.8/adlint/GNUmakefile +1 -1
  164. data/share/sample/ctags-5.8/adlint/adlint_cinit.h +1 -1
  165. data/share/sample/ctags-5.8/adlint/adlint_pinit.h +1 -1
  166. data/share/sample/ctags-5.8/adlint/adlint_traits.yml +50 -42
  167. data/share/sample/flex-2.5.35/adlint/GNUmakefile +1 -1
  168. data/share/sample/flex-2.5.35/adlint/adlint_cinit.h +1 -1
  169. data/share/sample/flex-2.5.35/adlint/adlint_pinit.h +1 -1
  170. data/share/sample/flex-2.5.35/adlint/adlint_traits.yml +50 -42
  171. data/share/sample/ruby-1.9.3-p0/adlint/GNUmakefile +1 -1
  172. data/share/sample/ruby-1.9.3-p0/adlint/adlint_traits.yml +46 -38
  173. data/share/sample/ruby-1.9.3-p0/adlint/core/GNUmakefile +1 -1
  174. data/share/sample/ruby-1.9.3-p0/adlint/core/adlint_cinit.h +1 -1
  175. data/share/sample/ruby-1.9.3-p0/adlint/core/adlint_pinit.h +1 -1
  176. data/share/sample/ruby-1.9.3-p0/adlint/core/adlint_traits.yml +50 -42
  177. data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/GNUmakefile +1 -1
  178. data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/adlint_cinit.h +1 -1
  179. data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/adlint_pinit.h +1 -1
  180. data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/adlint_traits.yml +50 -42
  181. data/share/sample/ruby-1.9.3-p0/adlint/enc/GNUmakefile +1 -1
  182. data/share/sample/ruby-1.9.3-p0/adlint/enc/adlint_cinit.h +1 -1
  183. data/share/sample/ruby-1.9.3-p0/adlint/enc/adlint_pinit.h +1 -1
  184. data/share/sample/ruby-1.9.3-p0/adlint/enc/adlint_traits.yml +50 -42
  185. data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/GNUmakefile +1 -1
  186. data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/adlint_cinit.h +1 -1
  187. data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/adlint_pinit.h +1 -1
  188. data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/adlint_traits.yml +50 -42
  189. data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/GNUmakefile +1 -1
  190. data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/adlint_cinit.h +1 -1
  191. data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/adlint_pinit.h +1 -1
  192. data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/adlint_traits.yml +50 -42
  193. data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/GNUmakefile +1 -1
  194. data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/adlint_cinit.h +1 -1
  195. data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/adlint_pinit.h +1 -1
  196. data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/adlint_traits.yml +50 -42
  197. data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/GNUmakefile +1 -1
  198. data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/adlint_cinit.h +1 -1
  199. data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/adlint_pinit.h +1 -1
  200. data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/adlint_traits.yml +50 -42
  201. data/share/sample/ruby-1.9.3-p0/adlint/ext-date/GNUmakefile +1 -1
  202. data/share/sample/ruby-1.9.3-p0/adlint/ext-date/adlint_cinit.h +1 -1
  203. data/share/sample/ruby-1.9.3-p0/adlint/ext-date/adlint_pinit.h +1 -1
  204. data/share/sample/ruby-1.9.3-p0/adlint/ext-date/adlint_traits.yml +50 -42
  205. data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/GNUmakefile +1 -1
  206. data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/adlint_cinit.h +1 -1
  207. data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/adlint_pinit.h +1 -1
  208. data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/adlint_traits.yml +50 -42
  209. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/GNUmakefile +1 -1
  210. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/adlint_cinit.h +1 -1
  211. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/adlint_pinit.h +1 -1
  212. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/adlint_traits.yml +50 -42
  213. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/GNUmakefile +1 -1
  214. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/adlint_cinit.h +1 -1
  215. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/adlint_pinit.h +1 -1
  216. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/adlint_traits.yml +50 -42
  217. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/GNUmakefile +1 -1
  218. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/adlint_cinit.h +1 -1
  219. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/adlint_pinit.h +1 -1
  220. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/adlint_traits.yml +50 -42
  221. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/GNUmakefile +1 -1
  222. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/adlint_cinit.h +1 -1
  223. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/adlint_pinit.h +1 -1
  224. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/adlint_traits.yml +50 -42
  225. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/GNUmakefile +1 -1
  226. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/adlint_cinit.h +1 -1
  227. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/adlint_pinit.h +1 -1
  228. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/adlint_traits.yml +50 -42
  229. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/GNUmakefile +1 -1
  230. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/adlint_cinit.h +1 -1
  231. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/adlint_pinit.h +1 -1
  232. data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/adlint_traits.yml +50 -42
  233. data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/GNUmakefile +1 -1
  234. data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/adlint_cinit.h +1 -1
  235. data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/adlint_pinit.h +1 -1
  236. data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/adlint_traits.yml +50 -42
  237. data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/GNUmakefile +1 -1
  238. data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/adlint_cinit.h +1 -1
  239. data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/adlint_pinit.h +1 -1
  240. data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/adlint_traits.yml +50 -42
  241. data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/GNUmakefile +1 -1
  242. data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/adlint_cinit.h +1 -1
  243. data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/adlint_pinit.h +1 -1
  244. data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/adlint_traits.yml +50 -42
  245. data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/GNUmakefile +1 -1
  246. data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/adlint_cinit.h +1 -1
  247. data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/adlint_pinit.h +1 -1
  248. data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/adlint_traits.yml +50 -42
  249. data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/GNUmakefile +1 -1
  250. data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/adlint_cinit.h +1 -1
  251. data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/adlint_pinit.h +1 -1
  252. data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/adlint_traits.yml +50 -42
  253. data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/GNUmakefile +1 -1
  254. data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/adlint_cinit.h +1 -1
  255. data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/adlint_pinit.h +1 -1
  256. data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/adlint_traits.yml +50 -42
  257. data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/GNUmakefile +1 -1
  258. data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/adlint_cinit.h +1 -1
  259. data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/adlint_pinit.h +1 -1
  260. data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/adlint_traits.yml +50 -42
  261. data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/GNUmakefile +1 -1
  262. data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/adlint_cinit.h +1 -1
  263. data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/adlint_pinit.h +1 -1
  264. data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/adlint_traits.yml +50 -42
  265. data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/GNUmakefile +1 -1
  266. data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/adlint_cinit.h +1 -1
  267. data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/adlint_pinit.h +1 -1
  268. data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/adlint_traits.yml +50 -42
  269. data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/GNUmakefile +1 -1
  270. data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/adlint_cinit.h +1 -1
  271. data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/adlint_pinit.h +1 -1
  272. data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/adlint_traits.yml +50 -42
  273. data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/GNUmakefile +1 -1
  274. data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/adlint_cinit.h +1 -1
  275. data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/adlint_pinit.h +1 -1
  276. data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/adlint_traits.yml +50 -42
  277. data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/GNUmakefile +1 -1
  278. data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/adlint_cinit.h +1 -1
  279. data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/adlint_pinit.h +1 -1
  280. data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/adlint_traits.yml +50 -42
  281. data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/GNUmakefile +1 -1
  282. data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/adlint_cinit.h +1 -1
  283. data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/adlint_pinit.h +1 -1
  284. data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/adlint_traits.yml +50 -42
  285. data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/GNUmakefile +1 -1
  286. data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/adlint_cinit.h +1 -1
  287. data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/adlint_pinit.h +1 -1
  288. data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/adlint_traits.yml +50 -42
  289. data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/GNUmakefile +1 -1
  290. data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/adlint_cinit.h +1 -1
  291. data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/adlint_pinit.h +1 -1
  292. data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/adlint_traits.yml +50 -42
  293. data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/GNUmakefile +1 -1
  294. data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/adlint_cinit.h +1 -1
  295. data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/adlint_pinit.h +1 -1
  296. data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/adlint_traits.yml +50 -42
  297. data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/GNUmakefile +1 -1
  298. data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/adlint_cinit.h +1 -1
  299. data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/adlint_pinit.h +1 -1
  300. data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/adlint_traits.yml +50 -42
  301. data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/GNUmakefile +1 -1
  302. data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/adlint_cinit.h +1 -1
  303. data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/adlint_pinit.h +1 -1
  304. data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/adlint_traits.yml +50 -42
  305. data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/GNUmakefile +1 -1
  306. data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/adlint_cinit.h +1 -1
  307. data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/adlint_pinit.h +1 -1
  308. data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/adlint_traits.yml +50 -42
  309. data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/GNUmakefile +1 -1
  310. data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/adlint_cinit.h +1 -1
  311. data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/adlint_pinit.h +1 -1
  312. data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/adlint_traits.yml +50 -42
  313. data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/GNUmakefile +1 -1
  314. data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/adlint_cinit.h +1 -1
  315. data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/adlint_pinit.h +1 -1
  316. data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/adlint_traits.yml +50 -42
  317. data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/GNUmakefile +1 -1
  318. data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/adlint_cinit.h +1 -1
  319. data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/adlint_pinit.h +1 -1
  320. data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/adlint_traits.yml +50 -42
  321. data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/GNUmakefile +1 -1
  322. data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/adlint_cinit.h +1 -1
  323. data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/adlint_pinit.h +1 -1
  324. data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/adlint_traits.yml +50 -42
  325. data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/GNUmakefile +1 -1
  326. data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/adlint_cinit.h +1 -1
  327. data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/adlint_pinit.h +1 -1
  328. data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/adlint_traits.yml +50 -42
  329. data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/GNUmakefile +1 -1
  330. data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/adlint_cinit.h +1 -1
  331. data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/adlint_pinit.h +1 -1
  332. data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/adlint_traits.yml +50 -42
  333. data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/GNUmakefile +1 -1
  334. data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/adlint_cinit.h +1 -1
  335. data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/adlint_pinit.h +1 -1
  336. data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/adlint_traits.yml +50 -42
  337. data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/GNUmakefile +1 -1
  338. data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/adlint_cinit.h +1 -1
  339. data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/adlint_pinit.h +1 -1
  340. data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/adlint_traits.yml +50 -42
  341. data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/GNUmakefile +1 -1
  342. data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/adlint_cinit.h +1 -1
  343. data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/adlint_pinit.h +1 -1
  344. data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/adlint_traits.yml +50 -42
  345. data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/GNUmakefile +1 -1
  346. data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/adlint_cinit.h +1 -1
  347. data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/adlint_pinit.h +1 -1
  348. data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/adlint_traits.yml +50 -42
  349. data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/GNUmakefile +1 -1
  350. data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/adlint_cinit.h +1 -1
  351. data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/adlint_pinit.h +1 -1
  352. data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/adlint_traits.yml +50 -42
  353. data/share/sample/screen-4.0.3/adlint/GNUmakefile +1 -1
  354. data/share/sample/screen-4.0.3/adlint/adlint_cinit.h +1 -1
  355. data/share/sample/screen-4.0.3/adlint/adlint_pinit.h +1 -1
  356. data/share/sample/screen-4.0.3/adlint/adlint_traits.yml +50 -42
  357. data/share/sample/vim-7.3/adlint/vim/GNUmakefile +1 -1
  358. data/share/sample/vim-7.3/adlint/vim/adlint_cinit.h +1 -1
  359. data/share/sample/vim-7.3/adlint/vim/adlint_pinit.h +1 -1
  360. data/share/sample/vim-7.3/adlint/vim/adlint_traits.yml +50 -42
  361. data/share/sample/vim-7.3/adlint/xxd/GNUmakefile +1 -1
  362. data/share/sample/vim-7.3/adlint/xxd/adlint_cinit.h +1 -1
  363. data/share/sample/vim-7.3/adlint/xxd/adlint_pinit.h +1 -1
  364. data/share/sample/vim-7.3/adlint/xxd/adlint_traits.yml +49 -41
  365. data/share/sample/zsh-4.3.15/adlint/GNUmakefile +1 -1
  366. data/share/sample/zsh-4.3.15/adlint/adlint_traits.yml +46 -38
  367. data/share/sample/zsh-4.3.15/adlint/builtins/GNUmakefile +1 -1
  368. data/share/sample/zsh-4.3.15/adlint/builtins/adlint_cinit.h +1 -1
  369. data/share/sample/zsh-4.3.15/adlint/builtins/adlint_pinit.h +1 -1
  370. data/share/sample/zsh-4.3.15/adlint/builtins/adlint_traits.yml +50 -42
  371. data/share/sample/zsh-4.3.15/adlint/core/GNUmakefile +1 -1
  372. data/share/sample/zsh-4.3.15/adlint/core/adlint_cinit.h +1 -1
  373. data/share/sample/zsh-4.3.15/adlint/core/adlint_pinit.h +1 -1
  374. data/share/sample/zsh-4.3.15/adlint/core/adlint_traits.yml +50 -42
  375. data/share/sample/zsh-4.3.15/adlint/modules/GNUmakefile +1 -1
  376. data/share/sample/zsh-4.3.15/adlint/modules/adlint_cinit.h +1 -1
  377. data/share/sample/zsh-4.3.15/adlint/modules/adlint_pinit.h +1 -1
  378. data/share/sample/zsh-4.3.15/adlint/modules/adlint_traits.yml +50 -42
  379. data/share/sample/zsh-4.3.15/adlint/zle/GNUmakefile +1 -1
  380. data/share/sample/zsh-4.3.15/adlint/zle/adlint_cinit.h +1 -1
  381. data/share/sample/zsh-4.3.15/adlint/zle/adlint_pinit.h +1 -1
  382. data/share/sample/zsh-4.3.15/adlint/zle/adlint_traits.yml +50 -42
  383. data/spec/adlint/{c → cc1}/ctrlexpr_spec.rb +51 -49
  384. data/spec/adlint/{c → cc1}/domain_spec.rb +210 -179
  385. data/spec/adlint/{c → cc1}/operator_spec.rb +3 -3
  386. data/spec/adlint/{c → cc1}/syntax_spec.rb +10 -12
  387. data/spec/adlint/{c → cc1}/type_spec.rb +61 -68
  388. data/{lib/adlint/c.rb → spec/adlint/location_spec.rb} +24 -29
  389. data/spec/conf.d/default_traits.yml +38 -37
  390. data/spec/conf.d/empty_cinit.h +1 -1
  391. data/spec/conf.d/empty_pinit.h +1 -1
  392. data/spec/conf.d/project/foo.c +0 -0
  393. data/spec/spec_helper.rb +2 -2
  394. metadata +60 -40
  395. data/lib/adlint/c/domain.rb +0 -7931
  396. data/lib/adlint/c/lexer.rb +0 -252
  397. data/lib/adlint/c/phase.rb +0 -135
  398. data/lib/adlint/exam/c_builtin/c_check.rb +0 -20745
  399. data/lib/adlint/exam/c_builtin/c_check_shima.rb +0 -983
  400. data/lib/adlint/exam/c_builtin/c_code.rb +0 -477
  401. data/lib/adlint/exam/c_builtin/c_metric.rb +0 -818
data/lib/adlint/report.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # Analysis report and its manipulation utility.
2
2
  #
3
3
  # Author:: Yutaka Yanoh <mailto:yanoh@users.sourceforge.net>
4
- # Copyright:: Copyright (C) 2010-2012, OGIS-RI Co.,Ltd.
4
+ # Copyright:: Copyright (C) 2010-2013, OGIS-RI Co.,Ltd.
5
5
  # License:: GPLv3+: GNU General Public License version 3 or later
6
6
  #
7
7
  # Owner:: Yutaka Yanoh <mailto:yanoh@users.sourceforge.net>
@@ -11,7 +11,7 @@
11
11
  # / | / _ |/ / / / | / /__ __/ Source Code Static Analyzer
12
12
  # / /| | / / / / / / / |/ / / / AdLint - Advanced Lint
13
13
  # / __ |/ /_/ / /___/ / /| / / /
14
- # /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-2012, OGIS-RI Co.,Ltd.
14
+ # /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-2013, OGIS-RI Co.,Ltd.
15
15
  #
16
16
  # This file is part of AdLint.
17
17
  #
@@ -29,7 +29,6 @@
29
29
  #
30
30
  #++
31
31
 
32
- require "adlint/exam"
33
32
  require "adlint/message"
34
33
  require "adlint/code"
35
34
  require "adlint/metric"
@@ -37,19 +36,16 @@ require "adlint/util"
37
36
 
38
37
  module AdLint #:nodoc:
39
38
 
40
- # == DESCRIPTION
41
- # Report information collector.
42
39
  class Report
43
- # === DESCRIPTION
44
- # Constructs an empty report.
45
- def initialize(msg_fpath, met_fpath, &block)
46
- @msg_fpath = msg_fpath
47
- @msg_file = open_message_file(msg_fpath)
48
-
49
- @met_fpath = met_fpath
50
- @met_file = open_metric_file(met_fpath)
51
-
52
- @unique_messages = Set.new
40
+ def initialize(msg_fpath, met_fpath, log_fpath, verbose, &block)
41
+ @msg_fpath = msg_fpath
42
+ @msg_file = open_msg_file(msg_fpath)
43
+ @met_fpath = met_fpath
44
+ @met_file = open_met_file(met_fpath)
45
+ @log_fpath = log_fpath
46
+ @verbose = verbose
47
+ @unique_msgs = Set.new
48
+ @deferred_msgs = []
53
49
 
54
50
  yield(self)
55
51
  ensure
@@ -59,55 +55,77 @@ module AdLint #:nodoc:
59
55
 
60
56
  attr_reader :msg_fpath
61
57
  attr_reader :met_fpath
58
+ attr_reader :log_fpath
62
59
 
63
60
  # === DESCRIPTION
64
- # Adds a message to this report.
61
+ # Writes a message on this report.
65
62
  #
66
63
  # === PARAMETER
67
- # _message_:: Message -- Message to be added.
64
+ # _message_:: Message -- Message to be written.
68
65
  #
69
66
  # === RETURN VALUE
70
67
  # Report -- Self.
71
- def add_message(message)
72
- @msg_file.puts(message.to_csv)
73
- $stderr.puts(message.to_s) unless verbose?
68
+ def write_message(msg, suppressors = nil)
69
+ if suppressors.nil? || !suppressors.suppress?(msg)
70
+ unless msg.must_be_unique? && !@unique_msgs.add?(msg)
71
+ if msg.must_be_deferred?
72
+ @deferred_msgs.push(msg)
73
+ else
74
+ rawrite_message(msg)
75
+ end
76
+ end
77
+ end
74
78
  self
75
79
  end
76
80
 
77
- def add_unique_message(message)
78
- if @unique_messages.add?(message)
79
- add_message(message)
81
+ def flush_deferred_messages(suppressors)
82
+ @deferred_msgs.each do |msg|
83
+ rawrite_message(msg) unless suppressors.suppress?(msg)
80
84
  end
85
+ @deferred_msgs.clear
81
86
  self
82
87
  end
83
88
 
84
89
  # === DESCRIPTION
85
- # Adds code structure information to this report.
90
+ # Writes a code structure information on this report.
86
91
  #
87
92
  # === PARAMETER
88
- # _code_struct_:: CodeStructure -- Code structure information to be added.
93
+ # _code_struct_:: CodeStructure -- Code structure info to be written.
89
94
  #
90
95
  # === RETURN VALUE
91
96
  # Report -- Self.
92
- def add_code_struct(code_struct)
93
- @met_file.puts(code_struct.to_csv)
97
+ def write_code_struct(code_struct)
98
+ code_struct.print_as_csv(@met_file)
94
99
  self
95
100
  end
96
101
 
97
- def add_code_metric(code_metric)
98
- @met_file.puts(code_metric.to_csv)
102
+ # === DESCRIPTION
103
+ # Writes a code quality metric on this report.
104
+ #
105
+ # === PARAMETER
106
+ # _code_metric_:: CodeMetric -- Code metric information to be written.
107
+ #
108
+ # === RETURN VALUE
109
+ # Report -- Self.
110
+ def write_code_metric(code_metric)
111
+ code_metric.print_as_csv(@met_file)
99
112
  self
100
113
  end
101
114
 
102
115
  private
103
- def open_message_file(fpath)
116
+ def rawrite_message(msg)
117
+ msg.print_as_csv(@msg_file)
118
+ msg.print_as_str($stderr) unless @verbose
119
+ end
120
+
121
+ def open_msg_file(fpath)
104
122
  File.open(fpath, "w").tap do |io|
105
123
  io.set_encoding(Encoding.default_external)
106
124
  io.puts(["V", SHORT_VERSION, Time.now.to_s, Dir.getwd].to_csv)
107
125
  end
108
126
  end
109
127
 
110
- def open_metric_file(fpath)
128
+ def open_met_file(fpath)
111
129
  File.open(fpath, "w").tap do |io|
112
130
  io.set_encoding(Encoding.default_external)
113
131
  io.puts(["VER", SHORT_VERSION, Time.now.to_s, Dir.getwd].to_csv)
@@ -115,513 +133,416 @@ module AdLint #:nodoc:
115
133
  end
116
134
  end
117
135
 
118
- module MessageUniqueness
119
- @@messages_to_be_unique = Set.new
120
-
121
- def ensure_uniqueness_of(message_id)
122
- @@messages_to_be_unique.add(message_id)
123
- nil
124
- end
125
-
126
- def must_be_unique?(message_id)
127
- @@messages_to_be_unique.include?(message_id)
128
- end
129
- module_function :must_be_unique?
130
- end
131
-
132
- # == DESCRIPTION
133
- # Report manipulation utility.
134
136
  module ReportUtil
137
+ # NOTE: Host class must respond to #report.
138
+ # NOTE: Host class must respond to #message_catalog.
139
+ # NOTE: Host class which needs #write_warning_message must respond to
140
+ # #suppressors.
141
+
135
142
  # === DESCRIPTION
136
- # Adds an error message to the report.
143
+ # Writes an error message on the report.
137
144
  #
138
145
  # Abbreviation below is available.
139
- # add_error_message(id, location, ...) => E(id, location, ...)
146
+ # write_error_message(msg_name, loc, ...) => E(msg_name, loc, ...)
140
147
  #
141
148
  # === PARAMETER
142
- # _id_:: String -- Message id string.
143
- # _location_:: Location -- Location where the message detected.
149
+ # _msg_name_:: Symbol -- Message name.
150
+ # _loc_:: Location -- Location where the message points to.
144
151
  # _parts_:: Array< Object > -- Message formatting parts.
145
152
  #
146
153
  # === RETURN VALUE
147
154
  # None.
148
- def add_error_message(id, location, *parts)
149
- add_message(ErrorMessage.new(id, location, *parts))
155
+ def write_error_message(msg_name, loc, *parts)
156
+ report.write_message(
157
+ ErrorMessage.new(message_catalog, msg_name, loc, *parts))
150
158
  end
151
- alias :E :add_error_message
152
- module_function :add_error_message, :E
159
+ alias :E :write_error_message
153
160
 
154
161
  # === DESCRIPTION
155
- # Adds a warning message to the report.
162
+ # Writes a warning message on the report.
156
163
  #
157
164
  # Abbreviation below is available.
158
- # add_warning_message(id, location, ...) => W(id, location, ...)
165
+ # write_warning_message(loc, ...) => W(loc, ...)
159
166
  #
160
167
  # === PARAMETER
161
- # _id_:: String -- Message id string.
162
- # _location_:: Location -- Location where the message detected.
163
- # _parts_:: Array< Object > -- Message formatting parts.
168
+ # _loc_:: Location -- Location where the message points to.
164
169
  #
165
170
  # === RETURN VALUE
166
171
  # None.
167
- def add_warning_message(package, id, location, *parts)
168
- add_message(WarningMessage.new(package, id, location, *parts))
169
- end
170
- module_function :add_warning_message
172
+ def write_warning_message(*args)
173
+ check_class = self.class
174
+ check_class = check_class.outer_module until check_class < CodeCheck
175
+
176
+ head_msg = nil
177
+ args.chunk { |arg| arg.kind_of?(Message) }.each do |*, chunk|
178
+ case chunk.first
179
+ when Message
180
+ if head_msg
181
+ chunk.each { |ctxt_msg| head_msg.complement_with(ctxt_msg) }
182
+ end
183
+ else
184
+ head_msg = WarningMessage.new(message_catalog, check_class, *chunk)
185
+ end
186
+ end
171
187
 
172
- def W(id, location, *parts)
173
- add_warning_message(PackageResolver.package_name_of(self.class),
174
- id, location, *parts)
188
+ report.write_message(head_msg, suppressors) if head_msg
175
189
  end
176
- module_function :W
190
+ alias :W :write_warning_message
177
191
 
178
192
  # === DESCRIPTION
179
- # Adds a context message to the report.
193
+ # Creates a context message.
180
194
  #
181
195
  # Abbreviation below is available.
182
- # add_context_message(id, location, ...) => C(id, location, ...)
196
+ # create_context_message(msg_name, loc, ...) => C(msg_name, loc, ...)
183
197
  #
184
198
  # === PARAMETER
185
- # _id_:: String -- Message id string.
186
- # _location_:: Location -- Location where the message detected.
199
+ # _msg_name_:: Symbol -- Message name.
200
+ # _loc_:: Location -- Location where the message points to.
187
201
  # _parts_:: Array< Object > -- Message formatting parts.
188
202
  #
189
203
  # === RETURN VALUE
190
- # None.
191
- def add_context_message(package, id, location, *parts)
192
- add_message(ContextMessage.new(package, id, location, *parts))
193
- end
194
- module_function :add_context_message
195
-
196
- def C(id, location, *parts)
197
- add_context_message(PackageResolver.package_name_of(self.class),
198
- id, location, *parts)
204
+ # ContextMessage -- New context message.
205
+ def create_context_message(msg_name, loc, *parts)
206
+ ContextMessage.new(message_catalog, msg_name, self.class, loc, *parts)
199
207
  end
200
- module_function :C
208
+ alias :C :create_context_message
201
209
 
202
210
  # === DESCRIPTION
203
- # Adds a message to the report.
204
- #
205
- # === PARAMETER
206
- # _message_:: Message -- Message to be added.
207
- #
208
- # === RETURN VALUE
209
- # None.
210
- def add_message(message)
211
- if MessageUniqueness.must_be_unique?(message.id)
212
- report.add_unique_message(message)
213
- else
214
- report.add_message(message)
215
- end
216
- nil
217
- end
218
- module_function :add_message
219
-
220
- # === DESCRIPTION
221
- # Adds type declaration information to the report.
211
+ # Writes a type declaration information on the report.
222
212
  #
223
213
  # Abbreviation below is available.
224
- # add_typedcl(...) => TYPEDCL(...)
214
+ # write_typedcl(...) => TYPEDCL(...)
225
215
  #
226
216
  # === PARAMETER
227
- # _location_:: Location -- Location where the declaration appears.
228
- # _typedcl_type_:: String -- Type declaration type.
217
+ # _loc_:: Location -- Location where the declaration appears.
218
+ # _dcl_type_:: String -- Type declaration type.
229
219
  # _type_name_:: String -- Type name.
230
220
  # _type_rep_:: String -- Type representation string.
231
221
  #
232
222
  # === RETURN VALUE
233
223
  # None.
234
- def add_typedcl(location, typedcl_type, type_name, type_rep)
235
- add_code_struct(TypeDcl.new(location, typedcl_type, type_name, type_rep))
224
+ def write_typedcl(loc, dcl_type, type_name, type_rep)
225
+ write_code_struct(TypeDcl.new(loc, dcl_type, type_name, type_rep))
236
226
  end
237
- alias :TYPEDCL :add_typedcl
238
- module_function :add_typedcl, :TYPEDCL
227
+ alias :TYPEDCL :write_typedcl
239
228
 
240
229
  # === DESCRIPTION
241
- # Adds global variable decaration information to the report.
230
+ # Writes a global variable decaration information on the report.
242
231
  #
243
232
  # Abbreviation below is available.
244
- # add_gvardcl(...) => GVARDCL(...)
233
+ # write_gvardcl(...) => GVARDCL(...)
245
234
  #
246
235
  # === PARAMETER
247
- # _location_:: Location -- Location where the declaration appears.
248
- # _variable_name_:: String -- Global variable name.
236
+ # _loc_:: Location -- Location where the declaration appears.
237
+ # _var_name_:: String -- Global variable name.
249
238
  # _type_rep_:: String -- Type representation string.
250
239
  #
251
240
  # === RETURN VALUE
252
241
  # None.
253
- def add_gvardcl(location, variable_name, type_rep)
254
- add_code_struct(GVarDcl.new(location, variable_name, type_rep))
242
+ def write_gvardcl(loc, var_name, type_rep)
243
+ write_code_struct(GVarDcl.new(loc, var_name, type_rep))
255
244
  end
256
- alias :GVARDCL :add_gvardcl
257
- module_function :add_gvardcl, :GVARDCL
245
+ alias :GVARDCL :write_gvardcl
258
246
 
259
247
  # === DESCRIPTION
260
- # Adds function declaration information to the report.
248
+ # Writes a function declaration information on the report.
261
249
  #
262
250
  # Abbreviation below is available.
263
- # add_funcdcl(...) => FUNCDCL(...)
251
+ # write_funcdcl(...) => FUNCDCL(...)
264
252
  #
265
253
  # === PARAMETER
266
- # _location_:: Location -- Location where the declaration appears.
267
- # _function_linkage_type_:: String -- Function linkage type string.
268
- # _function_scope_type_:: String -- Declaration scope type string.
269
- # _function_identifier_:: String -- Function identifier.
254
+ # _loc_:: Location -- Location where the declaration appears.
255
+ # _linkage_:: String -- Function linkage type string.
256
+ # _scope_type_:: String -- Declaration scope type string.
257
+ # _dcl_type_:: String -- Declaration type string.
258
+ # _fun_id_:: FunctionId -- Identifier of the function.
270
259
  #
271
260
  # === RETURN VALUE
272
261
  # None.
273
- def add_funcdcl(location, function_linkage_type, function_scope_type,
274
- function_identifier)
275
- add_code_struct(FuncDcl.new(location, function_linkage_type,
276
- function_scope_type, function_identifier))
262
+ def write_funcdcl(loc, linkage, scope_type, dcl_type, fun_id)
263
+ write_code_struct(FuncDcl.new(loc, linkage, scope_type, dcl_type,
264
+ fun_id))
277
265
  end
278
- alias :FUNCDCL :add_funcdcl
279
- module_function :add_funcdcl, :FUNCDCL
266
+ alias :FUNCDCL :write_funcdcl
280
267
 
281
268
  # === DESCRIPTION
282
- # Adds variable definition information to the report.
269
+ # Writes a variable definition information on the report.
283
270
  #
284
271
  # Abbreviation below is available.
285
- # add_vardef(...) => VARDEF(...)
272
+ # write_vardef(...) => VARDEF(...)
286
273
  #
287
274
  # === PARAMETER
288
- # _location_:: Location -- Location where the definition appears.
289
- # _var_linkage_type_:: String -- Variable linkage type string.
290
- # _var_scope_type_:: String -- Variable scope type string.
291
- # _storage_class_type_:: String -- Variable storage class type.
292
- # _variable_name_:: String -- Variable name.
275
+ # _loc_:: Location -- Location where the definition appears.
276
+ # _linkage_type_:: String -- Variable linkage type string.
277
+ # _scope_type_:: String -- Variable scope type string.
278
+ # _sc_type_:: String -- Variable storage class type.
279
+ # _var_name_:: String -- Variable name.
293
280
  # _type_rep_:: String -- Variable type representation string.
294
281
  #
295
282
  # === RETURN VALUE
296
283
  # None.
297
- def add_vardef(location, var_linkage_type, var_scope_type,
298
- storage_class_type, variable_name, type_rep)
299
- add_code_struct(VarDef.new(location, var_linkage_type, var_scope_type,
300
- storage_class_type, variable_name, type_rep))
284
+ def write_vardef(loc, linkage, scope_type, sc_type, var_name, type_rep)
285
+ write_code_struct(VarDef.new(loc, linkage, scope_type, sc_type, var_name,
286
+ type_rep))
301
287
  end
302
- alias :VARDEF :add_vardef
303
- module_function :add_vardef, :VARDEF
288
+ alias :VARDEF :write_vardef
304
289
 
305
290
  # === DESCRIPTION
306
- # Adds function definition information to the report.
291
+ # Writes a function definition information on the report.
307
292
  #
308
293
  # Abbreviation below is available.
309
- # add_funcdef(...) => FUNCDEF(...)
294
+ # write_funcdef(...) => FUNCDEF(...)
310
295
  #
311
296
  # === PARAMETER
312
- # _location_:: Location -- Location where the definition appears.
313
- # _function_linkage_type_:: String -- Function linkage type string.
314
- # _function_scope_type_:: String -- Definition scope type string.
315
- # _function_identifier_:: String -- Function identifier.
297
+ # _loc_:: Location -- Location where the definition appears.
298
+ # _linkage_:: String -- Function linkage type string.
299
+ # _scope_type_:: String -- Definition scope type string.
300
+ # _fun_id_:: FunctionId -- Identifier of the function.
316
301
  # _lines_:: Integer -- Physical lines.
317
302
  #
318
303
  # === RETURN VALUE
319
304
  # None.
320
- def add_funcdef(location, function_linkage_type, function_scope_type,
321
- function_identifier, lines)
322
- add_code_struct(FuncDef.new(location, function_linkage_type,
323
- function_scope_type, function_identifier,
324
- lines))
305
+ def write_funcdef(loc, linkage, scope_type, fun_id, lines)
306
+ write_code_struct(FuncDef.new(loc, linkage, scope_type, fun_id, lines))
325
307
  end
326
- alias :FUNCDEF :add_funcdef
327
- module_function :add_funcdef, :FUNCDEF
308
+ alias :FUNCDEF :write_funcdef
328
309
 
329
310
  # === DESCRIPTION
330
- # Adds macro definition information to the report.
311
+ # Writes a macro definition information on the report.
331
312
  #
332
313
  # Abbreviation below is available.
333
- # add_macrodef(...) => MACRODEF(...)
314
+ # write_macrodef(...) => MACRODEF(...)
334
315
  #
335
316
  # === PARAMETER
336
- # _location_:: Location -- Location where the definition appears.
317
+ # _loc_:: Location -- Location where the definition appears.
337
318
  # _macro_name_:: String -- Macro name.
338
319
  # _macro_type_:: String -- Macro type string.
339
320
  #
340
321
  # === RETURN VALUE
341
322
  # None.
342
- def add_macrodef(location, macro_name, macro_type)
343
- add_code_struct(MacroDef.new(location, macro_name, macro_type))
323
+ def write_macrodef(loc, macro_name, macro_type)
324
+ write_code_struct(MacroDef.new(loc, macro_name, macro_type))
344
325
  end
345
- alias :MACRODEF :add_macrodef
346
- module_function :add_macrodef, :MACRODEF
326
+ alias :MACRODEF :write_macrodef
347
327
 
348
328
  # === DESCRIPTION
349
- # Adds label definition information to the report.
329
+ # Writes a label definition information on the report.
350
330
  #
351
331
  # Abbreviation below is available.
352
- # add_labeldef(...) => LABELDEF(...)
332
+ # write_labeldef(...) => LABELDEF(...)
353
333
  #
354
334
  # === PARAMETER
355
- # _location_:: Location -- Location where the definition appears.
335
+ # _loc_:: Location -- Location where the definition appears.
356
336
  # _label_name_:: String -- Label name.
357
337
  #
358
338
  # === RETURN VALUE
359
339
  # None.
360
- def add_labeldef(location, label_name)
361
- add_code_struct(LabelDef.new(location, label_name))
340
+ def write_labeldef(loc, label_name)
341
+ write_code_struct(LabelDef.new(loc, label_name))
362
342
  end
363
- alias :LABELDEF :add_labeldef
364
- module_function :add_labeldef, :LABELDEF
343
+ alias :LABELDEF :write_labeldef
365
344
 
366
345
  # === DESCRIPTION
367
- # Adds initialization information to the report.
346
+ # Writes an initialization information on the report.
368
347
  #
369
348
  # Abbreviation below is available.
370
- # add_initialization(...) => INITIALIZATION(...)
349
+ # write_initialization(...) => INITIALIZATION(...)
371
350
  #
372
351
  # === PARAMETER
373
- # _location_:: Location -- Location where the variable appears.
374
- # _variable_name_:: String -- Initialized variable name.
375
- # _initializer_rep_:: String -- Initializer representation.
352
+ # _loc_:: Location -- Location where the variable appears.
353
+ # _var_name_:: String -- Initialized variable name.
354
+ # _init_rep_:: String -- String representation of the initializer.
376
355
  #
377
356
  # === RETURN VALUE
378
357
  # None.
379
- def add_initialization(location, variable_name, initializer_rep)
380
- add_code_struct(Initialization.new(location, variable_name,
381
- initializer_rep))
358
+ def write_initialization(loc, var_name, init_rep)
359
+ write_code_struct(Initialization.new(loc, var_name, init_rep))
382
360
  end
383
- alias :INITIALIZATION :add_initialization
384
- module_function :add_initialization, :INITIALIZATION
361
+ alias :INITIALIZATION :write_initialization
385
362
 
386
363
  # === DESCRIPTION
387
- # Adds assignment information to the report.
364
+ # Writes an assignment information on the report.
388
365
  #
389
366
  # Abbreviation below is available.
390
- # add_assignment(...) => ASSIGNMENT(...)
367
+ # write_assignment(...) => ASSIGNMENT(...)
391
368
  #
392
369
  # === PARAMETER
393
- # _location_:: Location -- Location where the variable appears.
394
- # _variable_name_:: String -- Assigned variable name.
395
- # _assignment_rep_:: String -- Assignment expression representation.
370
+ # _loc_:: Location -- Location where the variable appears.
371
+ # _var_name_:: String -- Assigned variable name.
372
+ # _assign_rep_:: String -- String representation of the assignment.
396
373
  #
397
374
  # === RETURN VALUE
398
375
  # None.
399
- def add_assignment(location, variable_name, assignment_rep)
400
- add_code_struct(Assignment.new(location, variable_name,
401
- assignment_rep))
376
+ def write_assignment(loc, var_name, assign_rep)
377
+ write_code_struct(Assignment.new(loc, var_name, assign_rep))
402
378
  end
403
- alias :ASSIGNMENT :add_assignment
404
- module_function :add_assignment, :ASSIGNMENT
379
+ alias :ASSIGNMENT :write_assignment
405
380
 
406
381
  # === DESCRIPTION
407
- # Adds header include information to the report.
382
+ # Writes a header include information on the report.
408
383
  #
409
384
  # Abbreviation below is available.
410
- # add_include(...) => INCLUDE(...)
385
+ # write_include(...) => INCLUDE(...)
411
386
  #
412
387
  # === PARAMETER
413
- # _location_:: Location -- Location where the directive appears.
414
- # _included_fpath_:: Pathname -- Path name of the included file.
388
+ # _loc_:: Location -- Location where the directive appears.
389
+ # _fpath_:: Pathname -- Path name of the included file.
415
390
  #
416
391
  # === RETURN VALUE
417
392
  # None.
418
- def add_include(location, included_fpath)
419
- add_code_struct(Include.new(location, included_fpath))
393
+ def write_include(loc, fpath)
394
+ write_code_struct(Include.new(loc, fpath))
420
395
  end
421
- alias :INCLUDE :add_include
422
- module_function :add_include, :INCLUDE
396
+ alias :INCLUDE :write_include
423
397
 
424
398
  # === DESCRIPTION
425
- # Adds function call information to the report.
399
+ # Writes a function call information on the report.
426
400
  #
427
401
  # Abbreviation below is available.
428
- # add_call(...) => CALL(...)
402
+ # write_call(...) => CALL(...)
429
403
  #
430
404
  # === PARAMETER
431
- # _location_:: Location -- Location where the function call appears.
432
- # _caller_function_:: FunctionIdentifier -- Calling function identifier.
433
- # _callee_function_:: FunctionIdentifier -- Called function identifier.
434
- def add_call(location, caller_function, callee_function)
435
- add_code_struct(Call.new(location, caller_function, callee_function))
405
+ # _loc_:: Location -- Location where the function call appears.
406
+ # _caller_fun_:: FunctionId -- Calling function identifier.
407
+ # _callee_fun_:: FunctionId -- Called function identifier.
408
+ def write_call(loc, caller_fun, callee_fun)
409
+ write_code_struct(Call.new(loc, caller_fun, callee_fun))
436
410
  end
437
- alias :CALL :add_call
438
- module_function :add_call, :CALL
411
+ alias :CALL :write_call
439
412
 
440
413
  # === DESCRIPTION
441
- # Adds variable cross reference information to the report.
414
+ # Writes a variable cross reference information on the report.
442
415
  #
443
416
  # Abbreviation below is available.
444
- # add_xref_variable(...) => XREF_VAR(...)
417
+ # write_xref_variable(...) => XREF_VAR(...)
445
418
  #
446
419
  # === PARAMETER
447
- # _location_:: Location -- Location where the cross-ref appears.
448
- # _accessor_function_:: FunctionIdentifier -- Accessing function
449
- # identifier.
450
- # _access_type_:: String -- Access type string.
451
- # _accessee_variable_:: String -- Accessed variable name.
420
+ # _loc_:: Location -- Location where the cross-ref appears.
421
+ # _referrer_:: FunctionId -- Accessing function identifier.
422
+ # _ref_type_:: String -- Access type string.
423
+ # _var_name_:: String -- Accessed variable name.
452
424
  #
453
425
  # === RETURN VALUE
454
426
  # None.
455
- def add_xref_variable(location, accessor_function, access_type,
456
- accessee_variable)
457
- add_code_struct(XRefVar.new(location, accessor_function, access_type,
458
- accessee_variable))
427
+ def write_xref_variable(loc, referrer, ref_type, var_name)
428
+ write_code_struct(XRefVar.new(loc, referrer, ref_type, var_name))
459
429
  end
460
- alias :XREF_VAR :add_xref_variable
461
- module_function :add_xref_variable, :XREF_VAR
430
+ alias :XREF_VAR :write_xref_variable
462
431
 
463
432
  # === DESCRIPTION
464
- # Adds function cross reference information to the report.
433
+ # Writes a function cross reference information on the report.
465
434
  #
466
435
  # Abbreviation below is available.
467
- # add_xref_function(...) => XREF_FUNC(...)
436
+ # write_xref_function(...) => XREF_FUNC(...)
468
437
  #
469
438
  # === PARAMETER
470
- # _location_:: Location -- Location where the cross-ref appears.
471
- # _accessor_function_:: FunctionIdentifier -- Accessing function
472
- # identifier.
473
- # _access_type_:: String -- Access type string.
474
- # _accessee_function_:: FunctionIdentifier -- Accessed function identifier.
439
+ # _loc_:: Location -- Location where the cross-ref appears.
440
+ # _referrer_:: FunctionId -- Accessing function identifier.
441
+ # _ref_type_:: String -- Access type string.
442
+ # _fun_:: FunctionId -- Accessed function identifier.
475
443
  #
476
444
  # === RETURN VALUE
477
445
  # None.
478
- def add_xref_function(location, accessor_function, access_type,
479
- accessee_function)
480
- add_code_struct(XRefFunc.new(location, accessor_function, access_type,
481
- accessee_function))
446
+ def write_xref_function(loc, referrer, ref_type, fun)
447
+ write_code_struct(XRefFunc.new(loc, referrer, ref_type, fun))
482
448
  end
483
- alias :XREF_FUNC :add_xref_function
484
- module_function :add_xref_function, :XREF_FUNC
449
+ alias :XREF_FUNC :write_xref_function
485
450
 
486
- def add_literal(location, literal_type, literal_prefix, literal_suffix,
487
- literal_value)
488
- add_code_struct(Literal.new(location, literal_type, literal_prefix,
489
- literal_suffix, literal_value))
451
+ def write_literal(loc, lit_type, prefix, suffix, value)
452
+ write_code_struct(Literal.new(loc, lit_type, prefix, suffix, value))
490
453
  end
491
- alias :LIT :add_literal
492
- module_function :add_literal, :LIT
454
+ alias :LIT :write_literal
493
455
 
494
- def add_pp_directive(location, pp_directive, pp_tokens)
495
- add_code_struct(PPDirective.new(location, pp_directive, pp_tokens))
456
+ def write_pp_directive(loc, pp_dire, pp_tokens)
457
+ write_code_struct(PPDirective.new(loc, pp_dire, pp_tokens))
496
458
  end
497
- alias :PP_DIRECTIVE :add_pp_directive
498
- module_function :add_pp_directive, :PP_DIRECTIVE
459
+ alias :PP_DIRECTIVE :write_pp_directive
499
460
 
500
- # === DESCRIPTION
501
- # Adds code structure information to the report.
502
- #
503
- # === PARAMETER
504
- # _code_struct_:: CodeStructure -- Code structure information to be added.
505
- #
506
- # === RETURN VALUE
507
- # None.
508
- def add_code_struct(code_struct)
509
- report.add_code_struct(code_struct)
510
- nil
461
+ def write_FL_STMT(fpath, stmt_cnt)
462
+ write_code_metric(FL_STMT_Metric.new(fpath, stmt_cnt))
511
463
  end
512
- module_function :add_code_struct
464
+ alias :FL_STMT :write_FL_STMT
513
465
 
514
- def add_FL_STMT(fpath, statement_count)
515
- add_code_metric(FL_STMT_Metric.new(fpath, statement_count))
466
+ def write_FL_FUNC(fpath, fun_cnt)
467
+ write_code_metric(FL_FUNC_Metric.new(fpath, fun_cnt))
516
468
  end
517
- alias :FL_STMT :add_FL_STMT
518
- module_function :add_FL_STMT, :FL_STMT
469
+ alias :FL_FUNC :write_FL_FUNC
519
470
 
520
- def add_FL_FUNC(fpath, function_count)
521
- add_code_metric(FL_FUNC_Metric.new(fpath, function_count))
471
+ def write_FN_STMT(fun_id, loc, stmt_cnt)
472
+ write_code_metric(FN_STMT_Metric.new(fun_id, loc, stmt_cnt))
522
473
  end
523
- alias :FL_FUNC :add_FL_FUNC
524
- module_function :add_FL_FUNC, :FL_FUNC
474
+ alias :FN_STMT :write_FN_STMT
525
475
 
526
- def add_FN_STMT(function_identifier, location, statement_count)
527
- add_code_metric(FN_STMT_Metric.new(function_identifier, location,
528
- statement_count))
476
+ def write_FN_UNRC(fun_id, loc, unreached_stmt_cnt)
477
+ write_code_metric(FN_UNRC_Metric.new(fun_id, loc, unreached_stmt_cnt))
529
478
  end
530
- alias :FN_STMT :add_FN_STMT
531
- module_function :add_FN_STMT, :FN_STMT
479
+ alias :FN_UNRC :write_FN_UNRC
532
480
 
533
- def add_FN_UNRC(function_identifier, location, unreached_statement_count)
534
- add_code_metric(FN_UNRC_Metric.new(function_identifier, location,
535
- unreached_statement_count))
481
+ def write_FN_LINE(fun_id, loc, fun_lines)
482
+ write_code_metric(FN_LINE_Metric.new(fun_id, loc, fun_lines))
536
483
  end
537
- alias :FN_UNRC :add_FN_UNRC
538
- module_function :add_FN_UNRC, :FN_UNRC
484
+ alias :FN_LINE :write_FN_LINE
539
485
 
540
- def add_FN_LINE(function_identifier, location, total_lines)
541
- add_code_metric(FN_LINE_Metric.new(function_identifier, location,
542
- total_lines))
486
+ def write_FN_PARA(fun_id, loc, param_cnt)
487
+ write_code_metric(FN_PARA_Metric.new(fun_id, loc, param_cnt))
543
488
  end
544
- alias :FN_LINE :add_FN_LINE
545
- module_function :add_FN_LINE, :FN_LINE
489
+ alias :FN_PARA :write_FN_PARA
546
490
 
547
- def add_FN_PARA(function_identifier, location, parameter_count)
548
- add_code_metric(FN_PARA_Metric.new(function_identifier, location,
549
- parameter_count))
491
+ def write_FN_UNUV(fun_id, loc, useless_var_cnt)
492
+ write_code_metric(FN_UNUV_Metric.new(fun_id, loc, useless_var_cnt))
550
493
  end
551
- alias :FN_PARA :add_FN_PARA
552
- module_function :add_FN_PARA, :FN_PARA
494
+ alias :FN_UNUV :write_FN_UNUV
553
495
 
554
- def add_FN_UNUV(function_identifier, location, useless_variable_count)
555
- add_code_metric(FN_UNUV_Metric.new(function_identifier, location,
556
- useless_variable_count))
496
+ def write_FN_CSUB(fun_id, loc, funcall_cnt)
497
+ write_code_metric(FN_CSUB_Metric.new(fun_id, loc, funcall_cnt))
557
498
  end
558
- alias :FN_UNUV :add_FN_UNUV
559
- module_function :add_FN_UNUV, :FN_UNUV
499
+ alias :FN_CSUB :write_FN_CSUB
560
500
 
561
- def add_FN_CSUB(function_identifier, location, function_call_count)
562
- add_code_metric(FN_CSUB_Metric.new(function_identifier, location,
563
- function_call_count))
501
+ def write_FN_GOTO(fun_id, loc, goto_cnt)
502
+ write_code_metric(FN_GOTO_Metric.new(fun_id, loc, goto_cnt))
564
503
  end
565
- alias :FN_CSUB :add_FN_CSUB
566
- module_function :add_FN_CSUB, :FN_CSUB
504
+ alias :FN_GOTO :write_FN_GOTO
567
505
 
568
- def add_FN_GOTO(function_identifier, location, goto_count)
569
- add_code_metric(FN_GOTO_Metric.new(function_identifier, location,
570
- goto_count))
506
+ def write_FN_RETN(fun_id, loc, retn_cnt)
507
+ write_code_metric(FN_RETN_Metric.new(fun_id, loc, retn_cnt))
571
508
  end
572
- alias :FN_GOTO :add_FN_GOTO
573
- module_function :add_FN_GOTO, :FN_GOTO
509
+ alias :FN_RETN :write_FN_RETN
574
510
 
575
- def add_FN_RETN(function_identifier, location, return_count)
576
- add_code_metric(FN_RETN_Metric.new(function_identifier, location,
577
- return_count))
511
+ def write_FN_UELS(fun_id, loc, if_stmt_cnt)
512
+ write_code_metric(FN_UELS_Metric.new(fun_id, loc, if_stmt_cnt))
578
513
  end
579
- alias :FN_RETN :add_FN_RETN
580
- module_function :add_FN_RETN, :FN_RETN
514
+ alias :FN_UELS :write_FN_UELS
581
515
 
582
- def add_FN_UELS(function_identifier, location, if_statement_count)
583
- add_code_metric(FN_UELS_Metric.new(function_identifier, location,
584
- if_statement_count))
516
+ def write_FN_NEST(fun_id, loc, max_nest)
517
+ write_code_metric(FN_NEST_Metric.new(fun_id, loc, max_nest))
585
518
  end
586
- alias :FN_UELS :add_FN_UELS
587
- module_function :add_FN_UELS, :FN_UELS
519
+ alias :FN_NEST :write_FN_NEST
588
520
 
589
- def add_FN_NEST(function_identifier, location, max_nest_level)
590
- add_code_metric(FN_NEST_Metric.new(function_identifier, location,
591
- max_nest_level))
521
+ def write_FN_PATH(fun_id, loc, path_cnt)
522
+ write_code_metric(FN_PATH_Metric.new(fun_id, loc, path_cnt))
592
523
  end
593
- alias :FN_NEST :add_FN_NEST
594
- module_function :add_FN_NEST, :FN_NEST
524
+ alias :FN_PATH :write_FN_PATH
595
525
 
596
- def add_FN_PATH(function_identifier, location, path_count)
597
- add_code_metric(FN_PATH_Metric.new(function_identifier, location,
598
- path_count))
526
+ def write_FN_CYCM(fun_id, loc, cycl_compl)
527
+ write_code_metric(FN_CYCM_Metric.new(fun_id, loc, cycl_compl))
599
528
  end
600
- alias :FN_PATH :add_FN_PATH
601
- module_function :add_FN_PATH, :FN_PATH
529
+ alias :FN_CYCM :write_FN_CYCM
602
530
 
603
- def add_FN_CYCM(function_identifier, location, cyclomatic_complexity)
604
- add_code_metric(FN_CYCM_Metric.new(function_identifier, location,
605
- cyclomatic_complexity))
531
+ def write_FN_CALL(fun_sig, loc, caller_cnt)
532
+ write_code_metric(FN_CALL_Metric.new(fun_sig, loc, caller_cnt))
606
533
  end
607
- alias :FN_CYCM :add_FN_CYCM
608
- module_function :add_FN_CYCM, :FN_CYCM
534
+ alias :FN_CALL :write_FN_CALL
609
535
 
610
- def add_FN_CALL(function_signature, location, caller_count)
611
- add_code_metric(FN_CALL_Metric.new(function_signature, location,
612
- caller_count))
536
+ private
537
+ def write_code_struct(code_struct)
538
+ report.write_code_struct(code_struct)
539
+ nil
613
540
  end
614
- alias :FN_CALL :add_FN_CALL
615
- module_function :add_FN_CALL, :FN_CALL
616
541
 
617
- def add_code_metric(code_metric)
618
- report.add_code_metric(code_metric)
542
+ def write_code_metric(code_metric)
543
+ report.write_code_metric(code_metric)
619
544
  nil
620
545
  end
621
- module_function :add_code_metric
622
546
  end
623
547
 
624
- Examination.class_eval { include ReportUtil }
625
- CodeCheck.class_eval { extend MessageUniqueness }
626
-
627
548
  end