adlint 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +27 -0
- data/COPYING +674 -0
- data/ChangeLog +820 -0
- data/INSTALL +78 -0
- data/MANIFEST +464 -0
- data/NEWS +38 -0
- data/README +74 -0
- data/Rakefile +167 -0
- data/TODO +29 -0
- data/bin/adlint +141 -0
- data/bin/adlint_chk +129 -0
- data/bin/adlint_cma +122 -0
- data/bin/adlint_sma +129 -0
- data/bin/adlintize +286 -0
- data/etc/conf.d/fallback/cinit.erb +11 -0
- data/etc/conf.d/fallback/traits.erb +216 -0
- data/etc/conf.d/i686-cygwin/cinit-gcc_4.3.4.erb +149 -0
- data/etc/conf.d/i686-cygwin/traits-gcc_4.3.4.erb +227 -0
- data/etc/conf.d/i686-devkit/cinit-gcc_4.5.2.erb +224 -0
- data/etc/conf.d/i686-devkit/traits-gcc_4.5.2.erb +226 -0
- data/etc/conf.d/i686-linux/cinit-gcc_4.5.1.erb +219 -0
- data/etc/conf.d/i686-linux/traits-gcc_4.5.1.erb +224 -0
- data/etc/conf.d/i686-mingw/cinit-gcc_4.6.1.erb +234 -0
- data/etc/conf.d/i686-mingw/traits-gcc_4.6.1.erb +226 -0
- data/etc/conf.d/noarch/GNUmakefile.erb +119 -0
- data/etc/conf.d/noarch/adlint_all_bat.erb +9 -0
- data/etc/conf.d/noarch/adlint_all_sh.erb +10 -0
- data/etc/conf.d/noarch/pinit.erb +11 -0
- data/etc/mesg.d/en_US/messages.yml +784 -0
- data/etc/mesg.d/ja_JP/messages.yml +784 -0
- data/lib/adlint/analyzer.rb +294 -0
- data/lib/adlint/c/branch.rb +251 -0
- data/lib/adlint/c/builtin.rb +92 -0
- data/lib/adlint/c/code.rb +490 -0
- data/lib/adlint/c/const.rb +465 -0
- data/lib/adlint/c/conv.rb +212 -0
- data/lib/adlint/c/ctrlexpr.rb +949 -0
- data/lib/adlint/c/domain.rb +7499 -0
- data/lib/adlint/c/environ.rb +133 -0
- data/lib/adlint/c/expr.rb +1725 -0
- data/lib/adlint/c/format.rb +3209 -0
- data/lib/adlint/c/interp.rb +1740 -0
- data/lib/adlint/c/lexer.rb +241 -0
- data/lib/adlint/c/mediator.rb +313 -0
- data/lib/adlint/c/message.rb +13597 -0
- data/lib/adlint/c/metric.rb +765 -0
- data/lib/adlint/c/object.rb +1018 -0
- data/lib/adlint/c/parser.rb +3800 -0
- data/lib/adlint/c/parser.y +2054 -0
- data/lib/adlint/c/phase.rb +712 -0
- data/lib/adlint/c/resolver.rb +270 -0
- data/lib/adlint/c/scanner.rb +248 -0
- data/lib/adlint/c/scope.rb +74 -0
- data/lib/adlint/c/syntax.rb +4279 -0
- data/lib/adlint/c/type.rb +7506 -0
- data/lib/adlint/c/util.rb +91 -0
- data/lib/adlint/c/value.rb +2310 -0
- data/lib/adlint/c.rb +56 -0
- data/lib/adlint/code.rb +500 -0
- data/lib/adlint/cpp/code.rb +189 -0
- data/lib/adlint/cpp/constexpr.rb +721 -0
- data/lib/adlint/cpp/constexpr.y +389 -0
- data/lib/adlint/cpp/eval.rb +1012 -0
- data/lib/adlint/cpp/lexer.rb +860 -0
- data/lib/adlint/cpp/macro.rb +637 -0
- data/lib/adlint/cpp/message.rb +992 -0
- data/lib/adlint/cpp/phase.rb +176 -0
- data/lib/adlint/cpp/scanner.rb +93 -0
- data/lib/adlint/cpp/source.rb +169 -0
- data/lib/adlint/cpp/subst.rb +300 -0
- data/lib/adlint/cpp/syntax.rb +1412 -0
- data/lib/adlint/cpp/util.rb +97 -0
- data/lib/adlint/cpp.rb +43 -0
- data/lib/adlint/driver.rb +147 -0
- data/lib/adlint/error.rb +179 -0
- data/lib/adlint/lang.rb +97 -0
- data/lib/adlint/ld/message.rb +259 -0
- data/lib/adlint/ld/metric.rb +57 -0
- data/lib/adlint/ld/object.rb +542 -0
- data/lib/adlint/ld/phase.rb +193 -0
- data/lib/adlint/ld/typedef.rb +109 -0
- data/lib/adlint/ld/util.rb +88 -0
- data/lib/adlint/ld.rb +37 -0
- data/lib/adlint/lexer.rb +293 -0
- data/lib/adlint/message.rb +368 -0
- data/lib/adlint/metric.rb +805 -0
- data/lib/adlint/monitor.rb +144 -0
- data/lib/adlint/phase.rb +90 -0
- data/lib/adlint/prelude.rb +314 -0
- data/lib/adlint/report.rb +617 -0
- data/lib/adlint/source.rb +155 -0
- data/lib/adlint/symbol.rb +127 -0
- data/lib/adlint/token.rb +215 -0
- data/lib/adlint/traits.rb +643 -0
- data/lib/adlint/util.rb +524 -0
- data/lib/adlint/version.rb +71 -0
- data/lib/adlint.rb +66 -0
- data/share/HEADER +45 -0
- data/share/demo/Makefile +110 -0
- data/share/demo/ambig_operator/ambig_operator.c +289 -0
- data/share/demo/arg_points_unset/arg_points_unset.c +37 -0
- data/share/demo/array_range/array_range.c +62 -0
- data/share/demo/bad_bitfields/bad_bitfields.c +74 -0
- data/share/demo/bad_brace/bad_brace.c +19 -0
- data/share/demo/bad_charset/abcde$.h +0 -0
- data/share/demo/bad_charset/bad_charset.c +22 -0
- data/share/demo/bad_comment/bad_comment.c +3 -0
- data/share/demo/bad_const/bad_const.c +19 -0
- data/share/demo/bad_conv/bad_conv.c +48 -0
- data/share/demo/bad_indent/bad_indent.c +50 -0
- data/share/demo/bad_init/bad_init.c +49 -0
- data/share/demo/bad_macro/bad_macro.c +97 -0
- data/share/demo/bitwise_expr/bitwise_expr.c +19 -0
- data/share/demo/call_by_value/call_by_value.c +26 -0
- data/share/demo/cross_ref/cross_ref.c +21 -0
- data/share/demo/dangling_else/dangling_else.c +20 -0
- data/share/demo/dead_code/dead_code.c +237 -0
- data/share/demo/deep_nest/deep_nest.c +57 -0
- data/share/demo/dense_switch/dense_switch.c +62 -0
- data/share/demo/direct_recur/direct_recur.c +15 -0
- data/share/demo/div_by_zero/div_by_zero.c +35 -0
- data/share/demo/dos_source/dos_source.c +7 -0
- data/share/demo/funptr_cast/funptr_cast.c +26 -0
- data/share/demo/goto_stmt/goto_stmt.c +19 -0
- data/share/demo/id_hiding/id_hiding.c +19 -0
- data/share/demo/ill_defined/ill_defined.c +13 -0
- data/share/demo/implicit_conv/implicit_conv.c +60 -0
- data/share/demo/implicit_int/implicit_int.c +14 -0
- data/share/demo/incomplete_type/incomplete_type.c +49 -0
- data/share/demo/indirect_recur/indirect_recur_1.c +14 -0
- data/share/demo/indirect_recur/indirect_recur_1.h +7 -0
- data/share/demo/indirect_recur/indirect_recur_2.c +12 -0
- data/share/demo/indirect_recur/indirect_recur_2.h +6 -0
- data/share/demo/indirect_recur/indirect_recur_3.c +6 -0
- data/share/demo/indirect_recur/indirect_recur_3.h +6 -0
- data/share/demo/indirect_recur/indirect_recur_4.c +25 -0
- data/share/demo/intro_demo/intro_demo.c +76 -0
- data/share/demo/intro_demo/intro_demo.h +12 -0
- data/share/demo/intro_demo/useless_header.h +5 -0
- data/share/demo/invalid_call/invalid_call.c +32 -0
- data/share/demo/kandr_fundef/kandr_fundef.c +10 -0
- data/share/demo/line_comment/line_comment.c +12 -0
- data/share/demo/local_decl/local_decl.c +9 -0
- data/share/demo/logical_trick/logical_trick.c +36 -0
- data/share/demo/long_sym/long_sym.c +5 -0
- data/share/demo/loop_var/loop_var.c +92 -0
- data/share/demo/malloc_or_die/malloc_or_die.c +43 -0
- data/share/demo/may_be_null/may_be_null.c +52 -0
- data/share/demo/may_be_null_arith/may_be_null_arith.c +15 -0
- data/share/demo/may_be_unset/may_be_unset.c +34 -0
- data/share/demo/mmapped_io/mmapped_io.c +23 -0
- data/share/demo/multi_break/multi_break.c +33 -0
- data/share/demo/multi_decl/multi_decl_1.c +17 -0
- data/share/demo/multi_decl/multi_decl_1.h +6 -0
- data/share/demo/multi_decl/multi_decl_2.c +13 -0
- data/share/demo/multi_decl/multi_decl_2.h +6 -0
- data/share/demo/multi_decl/multi_decl_3.c +22 -0
- data/share/demo/multi_def/multi_def_1.c +36 -0
- data/share/demo/multi_def/multi_def_1.h +6 -0
- data/share/demo/multi_def/multi_def_2.c +22 -0
- data/share/demo/multi_def/multi_def_2.h +6 -0
- data/share/demo/multi_def/multi_def_3.c +6 -0
- data/share/demo/multi_typedef/multi_typedef.c +11 -0
- data/share/demo/multi_typedef/multi_typedef_1.h +1 -0
- data/share/demo/multi_typedef/multi_typedef_2.h +1 -0
- data/share/demo/must_be_false/must_be_false.c +53 -0
- data/share/demo/must_be_null/must_be_null.c +13 -0
- data/share/demo/must_be_null_arith/must_be_null_arith.c +14 -0
- data/share/demo/must_be_true/must_be_true.c +21 -0
- data/share/demo/no_eof_nl/no_eof_nl.c +4 -0
- data/share/demo/no_void_arg/no_void_arg.c +14 -0
- data/share/demo/null_stmt/null_stmt.c +19 -0
- data/share/demo/octal_const/octal_const.c +20 -0
- data/share/demo/output_by_param/output_by_param.c +17 -0
- data/share/demo/overflow/overflow.c +74 -0
- data/share/demo/press_release/press_release.c +40 -0
- data/share/demo/retn_lvar_addr/retn_lvar_addr.c +47 -0
- data/share/demo/shift_expr/shift_expr.c +14 -0
- data/share/demo/should_be_typedef/should_be_typedef.c +51 -0
- data/share/demo/static_paths/static_paths.c +153 -0
- data/share/demo/static_vars/static_vars.c +39 -0
- data/share/demo/tag_hiding/tag_hiding.c +18 -0
- data/share/demo/tricky_incdec/tricky_incdec.c +12 -0
- data/share/demo/undefined_macro/undefined_macro.c +17 -0
- data/share/demo/uninit_vars/uninit_vars.c +28 -0
- data/share/demo/union_type/union_type.c +23 -0
- data/share/demo/unmatch_decl/unmatch_decl_1.c +12 -0
- data/share/demo/unmatch_decl/unmatch_decl_1.h +8 -0
- data/share/demo/unmatch_decl/unmatch_decl_2.c +10 -0
- data/share/demo/unmatch_decl/unmatch_decl_2.h +8 -0
- data/share/demo/unmatch_decl/unmatch_decl_3.c +7 -0
- data/share/demo/unmatch_paren_macro/unmatch_paren_macro.c +15 -0
- data/share/demo/unreachable/unreachable.c +34 -0
- data/share/demo/useless_exp_funs/useless_exp_funs_1.c +14 -0
- data/share/demo/useless_exp_funs/useless_exp_funs_1.h +1 -0
- data/share/demo/useless_exp_funs/useless_exp_funs_2.c +6 -0
- data/share/demo/useless_exp_vars/useless_export_1.c +8 -0
- data/share/demo/useless_exp_vars/useless_export_1.h +1 -0
- data/share/demo/useless_exp_vars/useless_export_2.c +7 -0
- data/share/demo/useless_expr/useless_expr.c +17 -0
- data/share/demo/useless_funs/useless_funs_1.c +21 -0
- data/share/demo/useless_funs/useless_funs_1.h +8 -0
- data/share/demo/useless_funs/useless_funs_2.c +6 -0
- data/share/demo/useless_header/useless_header.c +9 -0
- data/share/demo/useless_header/useless_header_1.h +12 -0
- data/share/demo/useless_header/useless_header_2.h +6 -0
- data/share/demo/useless_header/useless_header_3.h +9 -0
- data/share/demo/useless_header/useless_header_4.h +3 -0
- data/share/demo/useless_vars/useless_vars.c +17 -0
- data/share/demo/va_funcall/va_funcall.c +25 -0
- data/share/demo/various_fundef/various_fundef.c +36 -0
- data/share/demo/wchar_wstring/wchar_wstring.c +7 -0
- data/share/demo/wrap_around/wrap_around.c +38 -0
- data/share/doc/Makefile +16 -0
- data/share/doc/adlint_on_adqua.png +0 -0
- data/share/doc/adlint_on_eclipse_en.png +0 -0
- data/share/doc/adlint_on_eclipse_ja.png +0 -0
- data/share/doc/adlint_on_vim_en.png +0 -0
- data/share/doc/adlint_on_vim_ja.png +0 -0
- data/share/doc/developers_guide_ja.html +171 -0
- data/share/doc/developers_guide_ja.texi +87 -0
- data/share/doc/gen_mesg_sections.rb +39 -0
- data/share/doc/samples/GNUmakefile +162 -0
- data/share/doc/samples/adlint_traits.yml +238 -0
- data/share/doc/texinfo.css +22 -0
- data/share/doc/users_guide_en.html +39975 -0
- data/share/doc/users_guide_en.texi +32640 -0
- data/share/doc/users_guide_ja.html +40505 -0
- data/share/doc/users_guide_ja.texi +33189 -0
- data/share/logo/adlint-110.png +0 -0
- data/share/logo/adlint-524.png +0 -0
- data/share/logo/adlint.svg +4637 -0
- data/share/sample/README +6 -0
- data/share/sample/bison-2.5/adlint/GNUmakefile +170 -0
- data/share/sample/bison-2.5/adlint/adlint_traits.yml +225 -0
- data/share/sample/bison-2.5/adlint/lib/GNUmakefile +198 -0
- data/share/sample/bison-2.5/adlint/lib/adlint_cinit.h +228 -0
- data/share/sample/bison-2.5/adlint/lib/adlint_pinit.h +21 -0
- data/share/sample/bison-2.5/adlint/lib/adlint_traits.yml +238 -0
- data/share/sample/bison-2.5/adlint/src/GNUmakefile +166 -0
- data/share/sample/bison-2.5/adlint/src/adlint_cinit.h +228 -0
- data/share/sample/bison-2.5/adlint/src/adlint_pinit.h +21 -0
- data/share/sample/bison-2.5/adlint/src/adlint_traits.yml +239 -0
- data/share/sample/ctags-5.8/adlint/GNUmakefile +169 -0
- data/share/sample/ctags-5.8/adlint/adlint_cinit.h +219 -0
- data/share/sample/ctags-5.8/adlint/adlint_pinit.h +13 -0
- data/share/sample/ctags-5.8/adlint/adlint_traits.yml +225 -0
- data/share/sample/flex-2.5.35/adlint/GNUmakefile +140 -0
- data/share/sample/flex-2.5.35/adlint/adlint_cinit.h +219 -0
- data/share/sample/flex-2.5.35/adlint/adlint_pinit.h +14 -0
- data/share/sample/flex-2.5.35/adlint/adlint_traits.yml +225 -0
- data/share/sample/ruby-1.9.3-p0/adlint/GNUmakefile +314 -0
- data/share/sample/ruby-1.9.3-p0/adlint/adlint_traits.yml +225 -0
- data/share/sample/ruby-1.9.3-p0/adlint/core/GNUmakefile +204 -0
- data/share/sample/ruby-1.9.3-p0/adlint/core/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/core/adlint_pinit.h +28 -0
- data/share/sample/ruby-1.9.3-p0/adlint/core/adlint_traits.yml +240 -0
- data/share/sample/ruby-1.9.3-p0/adlint/enc/GNUmakefile +163 -0
- data/share/sample/ruby-1.9.3-p0/adlint/enc/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/enc/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/enc/adlint_traits.yml +240 -0
- data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/GNUmakefile +149 -0
- data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/adlint_traits.yml +240 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-date/GNUmakefile +134 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-date/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-date/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-date/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/adlint_traits.yml +242 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/GNUmakefile +132 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/adlint_traits.yml +242 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/GNUmakefile +132 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/adlint_traits.yml +242 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/GNUmakefile +132 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/adlint_traits.yml +242 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/GNUmakefile +132 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/adlint_traits.yml +242 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/GNUmakefile +134 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/GNUmakefile +140 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/adlint_traits.yml +242 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/GNUmakefile +134 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/adlint_traits.yml +242 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/GNUmakefile +162 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/GNUmakefile +135 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/GNUmakefile +132 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/GNUmakefile +144 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/GNUmakefile +140 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/adlint_traits.yml +241 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/GNUmakefile +131 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/adlint_cinit.h +228 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/adlint_pinit.h +24 -0
- data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/adlint_traits.yml +241 -0
- data/share/sample/screen-4.0.3/adlint/GNUmakefile +162 -0
- data/share/sample/screen-4.0.3/adlint/adlint_cinit.h +228 -0
- data/share/sample/screen-4.0.3/adlint/adlint_pinit.h +21 -0
- data/share/sample/screen-4.0.3/adlint/adlint_traits.yml +238 -0
- data/share/sample/vim-7.3/adlint/vim/GNUmakefile +185 -0
- data/share/sample/vim-7.3/adlint/vim/adlint_cinit.h +228 -0
- data/share/sample/vim-7.3/adlint/vim/adlint_pinit.h +25 -0
- data/share/sample/vim-7.3/adlint/vim/adlint_traits.yml +250 -0
- data/share/sample/vim-7.3/adlint/xxd/GNUmakefile +131 -0
- data/share/sample/vim-7.3/adlint/xxd/adlint_cinit.h +228 -0
- data/share/sample/vim-7.3/adlint/xxd/adlint_pinit.h +24 -0
- data/share/sample/vim-7.3/adlint/xxd/adlint_traits.yml +237 -0
- data/share/sample/zsh-4.3.15/adlint/GNUmakefile +146 -0
- data/share/sample/zsh-4.3.15/adlint/adlint_traits.yml +225 -0
- data/share/sample/zsh-4.3.15/adlint/builtins/GNUmakefile +132 -0
- data/share/sample/zsh-4.3.15/adlint/builtins/adlint_cinit.h +228 -0
- data/share/sample/zsh-4.3.15/adlint/builtins/adlint_pinit.h +24 -0
- data/share/sample/zsh-4.3.15/adlint/builtins/adlint_traits.yml +240 -0
- data/share/sample/zsh-4.3.15/adlint/core/GNUmakefile +153 -0
- data/share/sample/zsh-4.3.15/adlint/core/adlint_cinit.h +228 -0
- data/share/sample/zsh-4.3.15/adlint/core/adlint_pinit.h +23 -0
- data/share/sample/zsh-4.3.15/adlint/core/adlint_traits.yml +239 -0
- data/share/sample/zsh-4.3.15/adlint/modules/GNUmakefile +147 -0
- data/share/sample/zsh-4.3.15/adlint/modules/adlint_cinit.h +228 -0
- data/share/sample/zsh-4.3.15/adlint/modules/adlint_pinit.h +24 -0
- data/share/sample/zsh-4.3.15/adlint/modules/adlint_traits.yml +240 -0
- data/share/sample/zsh-4.3.15/adlint/zle/GNUmakefile +144 -0
- data/share/sample/zsh-4.3.15/adlint/zle/adlint_cinit.h +228 -0
- data/share/sample/zsh-4.3.15/adlint/zle/adlint_pinit.h +24 -0
- data/share/sample/zsh-4.3.15/adlint/zle/adlint_traits.yml +239 -0
- data/spec/MUST_WRITE_SPECS_WITH_RSPEC +0 -0
- metadata +532 -0
data/lib/adlint/c.rb
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
# AdLint::C package loader.
|
2
|
+
#
|
3
|
+
# Author:: Yutaka Yanoh <mailto:yanoh@users.sourceforge.net>
|
4
|
+
# Copyright:: Copyright (C) 2010-2012, OGIS-RI Co.,Ltd.
|
5
|
+
# License:: GPLv3+: GNU General Public License version 3 or later
|
6
|
+
#
|
7
|
+
# Owner:: Yutaka Yanoh <mailto:yanoh@users.sourceforge.net>
|
8
|
+
|
9
|
+
#--
|
10
|
+
# ___ ____ __ ___ _________
|
11
|
+
# / | / _ |/ / / / | / /__ __/ Source Code Static Analyzer
|
12
|
+
# / /| | / / / / / / / |/ / / / AdLint - Advanced Lint
|
13
|
+
# / __ |/ /_/ / /___/ / /| / / /
|
14
|
+
# /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-2012, OGIS-RI Co.,Ltd.
|
15
|
+
#
|
16
|
+
# This file is part of AdLint.
|
17
|
+
#
|
18
|
+
# AdLint is free software: you can redistribute it and/or modify it under the
|
19
|
+
# terms of the GNU General Public License as published by the Free Software
|
20
|
+
# Foundation, either version 3 of the License, or (at your option) any later
|
21
|
+
# version.
|
22
|
+
#
|
23
|
+
# AdLint is distributed in the hope that it will be useful, but WITHOUT ANY
|
24
|
+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
25
|
+
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
26
|
+
#
|
27
|
+
# You should have received a copy of the GNU General Public License along with
|
28
|
+
# AdLint. If not, see <http://www.gnu.org/licenses/>.
|
29
|
+
#
|
30
|
+
#++
|
31
|
+
|
32
|
+
require "adlint/c/branch"
|
33
|
+
require "adlint/c/builtin"
|
34
|
+
require "adlint/c/code"
|
35
|
+
require "adlint/c/ctrlexpr"
|
36
|
+
require "adlint/c/const"
|
37
|
+
require "adlint/c/conv"
|
38
|
+
require "adlint/c/domain"
|
39
|
+
require "adlint/c/environ"
|
40
|
+
require "adlint/c/expr"
|
41
|
+
require "adlint/c/format"
|
42
|
+
require "adlint/c/interp"
|
43
|
+
require "adlint/c/lexer"
|
44
|
+
require "adlint/c/mediator"
|
45
|
+
require "adlint/c/message"
|
46
|
+
require "adlint/c/metric"
|
47
|
+
require "adlint/c/object"
|
48
|
+
require "adlint/c/parser"
|
49
|
+
require "adlint/c/phase"
|
50
|
+
require "adlint/c/resolver"
|
51
|
+
require "adlint/c/scanner"
|
52
|
+
require "adlint/c/scope"
|
53
|
+
require "adlint/c/syntax"
|
54
|
+
require "adlint/c/type"
|
55
|
+
require "adlint/c/util"
|
56
|
+
require "adlint/c/value"
|
data/lib/adlint/code.rb
ADDED
@@ -0,0 +1,500 @@
|
|
1
|
+
# Code structure information.
|
2
|
+
#
|
3
|
+
# Author:: Yutaka Yanoh <mailto:yanoh@users.sourceforge.net>
|
4
|
+
# Copyright:: Copyright (C) 2010-2012, OGIS-RI Co.,Ltd.
|
5
|
+
# License:: GPLv3+: GNU General Public License version 3 or later
|
6
|
+
#
|
7
|
+
# Owner:: Yutaka Yanoh <mailto:yanoh@users.sourceforge.net>
|
8
|
+
|
9
|
+
#--
|
10
|
+
# ___ ____ __ ___ _________
|
11
|
+
# / | / _ |/ / / / | / /__ __/ Source Code Static Analyzer
|
12
|
+
# / /| | / / / / / / / |/ / / / AdLint - Advanced Lint
|
13
|
+
# / __ |/ /_/ / /___/ / /| / / /
|
14
|
+
# /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-2012, OGIS-RI Co.,Ltd.
|
15
|
+
#
|
16
|
+
# This file is part of AdLint.
|
17
|
+
#
|
18
|
+
# AdLint is free software: you can redistribute it and/or modify it under the
|
19
|
+
# terms of the GNU General Public License as published by the Free Software
|
20
|
+
# Foundation, either version 3 of the License, or (at your option) any later
|
21
|
+
# version.
|
22
|
+
#
|
23
|
+
# AdLint is distributed in the hope that it will be useful, but WITHOUT ANY
|
24
|
+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
25
|
+
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
26
|
+
#
|
27
|
+
# You should have received a copy of the GNU General Public License along with
|
28
|
+
# AdLint. If not, see <http://www.gnu.org/licenses/>.
|
29
|
+
#
|
30
|
+
#++
|
31
|
+
|
32
|
+
module AdLint #:nodoc:
|
33
|
+
|
34
|
+
# == DESCRIPTION
|
35
|
+
# Base class of code structure information.
|
36
|
+
class CodeStructure
|
37
|
+
# === DESCRIPTION
|
38
|
+
# Converts this code structure information into array representation.
|
39
|
+
#
|
40
|
+
# Subclasses must implement this method.
|
41
|
+
#
|
42
|
+
# === RETURN VALUE
|
43
|
+
# Array< Object > -- Array representation.
|
44
|
+
def to_a
|
45
|
+
subclass_responsibility
|
46
|
+
end
|
47
|
+
|
48
|
+
# === DESCRIPTION
|
49
|
+
# Converts this code structure information into string representation.
|
50
|
+
#
|
51
|
+
# === RETURN VALUE
|
52
|
+
# String -- String representation.
|
53
|
+
def to_s
|
54
|
+
delim = ",".to_default_external
|
55
|
+
to_a.map { |obj| obj.to_s.to_default_external }.join(delim)
|
56
|
+
end
|
57
|
+
|
58
|
+
def to_csv
|
59
|
+
to_a.map { |obj| obj ? obj.to_s.to_default_external : nil }.to_csv
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
# == DESCRIPTION
|
64
|
+
# Type declaration information.
|
65
|
+
class TypeDcl < CodeStructure
|
66
|
+
# === DESCRIPTION
|
67
|
+
# Constructs the type declaration information.
|
68
|
+
#
|
69
|
+
# === PARAMETER
|
70
|
+
# _location_:: Location -- Location where the declaration appears.
|
71
|
+
# _typedcl_type_:: String -- Type string of the type declaration.
|
72
|
+
# _type_name_:: String -- Type name.
|
73
|
+
# _type_rep_:: String -- Type representation.
|
74
|
+
def initialize(location, typedcl_type, type_name, type_rep)
|
75
|
+
@location = location
|
76
|
+
@typedcl_type = typedcl_type
|
77
|
+
@type_name = type_name
|
78
|
+
@type_rep = type_rep
|
79
|
+
end
|
80
|
+
|
81
|
+
# === DESCRIPTION
|
82
|
+
# Converts this code structure information into array representation.
|
83
|
+
#
|
84
|
+
# === RETURN VALUE
|
85
|
+
# Array< Object > -- Array representation.
|
86
|
+
def to_a
|
87
|
+
["DCL", @location.fpath, @location.line_no, @location.column_no, "T",
|
88
|
+
@typedcl_type, @type_name, @type_rep]
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
# == DESCRIPTION
|
93
|
+
# Global variable declaration information.
|
94
|
+
class GVarDcl < CodeStructure
|
95
|
+
# === DESCRIPTION
|
96
|
+
# Constructs the global variable declaration information.
|
97
|
+
#
|
98
|
+
# === PARAMETER
|
99
|
+
# _location_:: Location -- Location where the declaration appears.
|
100
|
+
# _variable_name_:: String -- Global variable name.
|
101
|
+
# _type_rep_:: String -- Type of the global variable.
|
102
|
+
def initialize(location, variable_name, type_rep)
|
103
|
+
@location = location
|
104
|
+
@variable_name = variable_name
|
105
|
+
@type_rep = type_rep
|
106
|
+
end
|
107
|
+
|
108
|
+
# === DESCRIPTION
|
109
|
+
# Converts this code structure information into array representation.
|
110
|
+
#
|
111
|
+
# === RETURN VALUE
|
112
|
+
# Array< Object > -- Array representation.
|
113
|
+
def to_a
|
114
|
+
["DCL", @location.fpath, @location.line_no, @location.column_no, "V",
|
115
|
+
@variable_name, @type_rep]
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
# == DESCRIPTION
|
120
|
+
# Function declaration information.
|
121
|
+
class FuncDcl < CodeStructure
|
122
|
+
# === DESCRIPTION
|
123
|
+
# Constructs the function declaration information.
|
124
|
+
#
|
125
|
+
# === PARAMETER
|
126
|
+
# _location_:: Location -- Location where the declaration appears.
|
127
|
+
# _function_linkage_type_:: String -- Functionn linkage type string.
|
128
|
+
# _function_scope_type_:: String -- Declaration scope type string.
|
129
|
+
# _function_identifier_:: String -- Function identifier.
|
130
|
+
def initialize(location, function_linkage_type, function_scope_type,
|
131
|
+
function_identifier)
|
132
|
+
@location = location
|
133
|
+
@function_linkage_type = function_linkage_type
|
134
|
+
@function_scope_type = function_scope_type
|
135
|
+
@function_identifier = function_identifier
|
136
|
+
end
|
137
|
+
|
138
|
+
# === DESCRIPTION
|
139
|
+
# Converts this code structure information into array representation.
|
140
|
+
#
|
141
|
+
# === RETURN VALUE
|
142
|
+
# Array< Object > -- Array representation.
|
143
|
+
def to_a
|
144
|
+
["DCL", @location.fpath, @location.line_no, @location.column_no, "F",
|
145
|
+
@function_linkage_type, @function_scope_type,
|
146
|
+
@function_identifier.name, @function_identifier.signature]
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
# == DESCRIPTION
|
151
|
+
# Variable definition information.
|
152
|
+
class VarDef < CodeStructure
|
153
|
+
# === DESCRIPTION
|
154
|
+
# Constructs the variable definition information.
|
155
|
+
#
|
156
|
+
# === PARAMETER
|
157
|
+
# _location_:: Location -- Location where the definition appears.
|
158
|
+
# _var_linkage_type_:: String -- Variable linkage type string.
|
159
|
+
# _var_scope_type_:: String -- Variable scope type string.
|
160
|
+
# _storage_class_type_:: String -- Variable storage class type.
|
161
|
+
# _variable_name_:: String -- Variable name.
|
162
|
+
# _type_rep_:: String -- Variable type representation string.
|
163
|
+
def initialize(location, var_linkage_type, var_scope_type,
|
164
|
+
storage_class_type, variable_name, type_rep)
|
165
|
+
@location = location
|
166
|
+
@var_linkage_type = var_linkage_type
|
167
|
+
@var_scope_type = var_scope_type
|
168
|
+
@storage_class_type = storage_class_type
|
169
|
+
@variable_name = variable_name
|
170
|
+
@type_rep = type_rep
|
171
|
+
end
|
172
|
+
|
173
|
+
# === DESCRIPTION
|
174
|
+
# Converts this code structure information into array representation.
|
175
|
+
#
|
176
|
+
# === RETURN VALUE
|
177
|
+
# Array< Object > -- Array representation.
|
178
|
+
def to_a
|
179
|
+
["DEF", @location.fpath, @location.line_no, @location.column_no, "V",
|
180
|
+
@var_linkage_type, @var_scope_type, @storage_class_type,
|
181
|
+
@variable_name, @type_rep]
|
182
|
+
end
|
183
|
+
end
|
184
|
+
|
185
|
+
# == DESCRIPTION
|
186
|
+
# Function definition information.
|
187
|
+
class FuncDef < CodeStructure
|
188
|
+
# === DESCRIPTION
|
189
|
+
# Constructs the function definition information.
|
190
|
+
#
|
191
|
+
# === PARAMETER
|
192
|
+
# _location_:: Location -- Location where the definition appears.
|
193
|
+
# _function_linkage_type_:: String -- Function linkage type string.
|
194
|
+
# _function_scope_type_:: String -- Definition scope type string.
|
195
|
+
# _function_identifier_:: String -- Function identifier.
|
196
|
+
# _lines_:: Integer -- Physical lines.
|
197
|
+
def initialize(location, function_linkage_type, function_scope_type,
|
198
|
+
function_identifier, lines)
|
199
|
+
@location = location
|
200
|
+
@function_linkage_type = function_linkage_type
|
201
|
+
@function_scope_type = function_scope_type
|
202
|
+
@function_identifier = function_identifier
|
203
|
+
@lines = lines
|
204
|
+
end
|
205
|
+
|
206
|
+
# === DESCRIPTION
|
207
|
+
# Converts this code structure information into array representation.
|
208
|
+
#
|
209
|
+
# === RETURN VALUE
|
210
|
+
# Array< Object > -- Array representation.
|
211
|
+
def to_a
|
212
|
+
["DEF", @location.fpath, @location.line_no, @location.column_no, "F",
|
213
|
+
@function_linkage_type, @function_scope_type,
|
214
|
+
@function_identifier.name, @function_identifier.signature, @lines]
|
215
|
+
end
|
216
|
+
end
|
217
|
+
|
218
|
+
# == DESCRIPTION
|
219
|
+
# Macro definition information.
|
220
|
+
class MacroDef < CodeStructure
|
221
|
+
# === DESCRIPTION
|
222
|
+
# Constructs the macro definition information.
|
223
|
+
#
|
224
|
+
# === PARAMETER
|
225
|
+
# _location_:: Location -- Location where the definition appears.
|
226
|
+
# _macro_name_:: String -- Macro name.
|
227
|
+
# _macro_type_:: String -- Macro type string.
|
228
|
+
def initialize(location, macro_name, macro_type)
|
229
|
+
@location = location
|
230
|
+
@macro_name = macro_name
|
231
|
+
@macro_type = macro_type
|
232
|
+
end
|
233
|
+
|
234
|
+
# === DESCRIPTION
|
235
|
+
# Converts this code structure information into array representation.
|
236
|
+
#
|
237
|
+
# === RETURN VALUE
|
238
|
+
# Array< Object > -- Array representation.
|
239
|
+
def to_a
|
240
|
+
["DEF", @location.fpath, @location.line_no, @location.column_no, "M",
|
241
|
+
@macro_name, @macro_type]
|
242
|
+
end
|
243
|
+
end
|
244
|
+
|
245
|
+
# == DESCRIPTION
|
246
|
+
# Label definition information.
|
247
|
+
class LabelDef < CodeStructure
|
248
|
+
# === DESCRIPTION
|
249
|
+
# Constructs the label definition information.
|
250
|
+
#
|
251
|
+
# === PARAMETER
|
252
|
+
# _location_:: Location -- Location where the definition appears.
|
253
|
+
# _label_name_:: String -- Label name.
|
254
|
+
def initialize(location, label_name)
|
255
|
+
@location = location
|
256
|
+
@label_name = label_name
|
257
|
+
end
|
258
|
+
|
259
|
+
# === DESCRIPTION
|
260
|
+
# Converts this code structure information into array representation.
|
261
|
+
#
|
262
|
+
# === RETURN VALUE
|
263
|
+
# Array< Object > -- Array representation.
|
264
|
+
def to_a
|
265
|
+
["DEF", @location.fpath, @location.line_no, @location.column_no, "L",
|
266
|
+
@label_name]
|
267
|
+
end
|
268
|
+
end
|
269
|
+
|
270
|
+
# == DESCRIPTION
|
271
|
+
# Initialization information.
|
272
|
+
class Initialization < CodeStructure
|
273
|
+
# === DESCRIPTION
|
274
|
+
# Constructs the initialization information.
|
275
|
+
#
|
276
|
+
# === PARAMETER
|
277
|
+
# _location_:: Location -- Location where the variable appears.
|
278
|
+
# _variable_name_:: String -- Initialized variable name.
|
279
|
+
# _initializer_rep_:: String -- Initializer representation.
|
280
|
+
def initialize(location, variable_name, initializer_rep)
|
281
|
+
@location = location
|
282
|
+
@variable_name = variable_name
|
283
|
+
@initializer_rep = initializer_rep
|
284
|
+
end
|
285
|
+
|
286
|
+
# === DESCRIPTION
|
287
|
+
# Converts this code structure information into array representation.
|
288
|
+
#
|
289
|
+
# === RETURN VALUE
|
290
|
+
# Array< Object > -- Array representation.
|
291
|
+
def to_a
|
292
|
+
["INI", @location.fpath, @location.line_no, @location.column_no,
|
293
|
+
@variable_name, @initializer_rep]
|
294
|
+
end
|
295
|
+
end
|
296
|
+
|
297
|
+
# == DESCRIPTION
|
298
|
+
# Assignment information.
|
299
|
+
class Assignment < CodeStructure
|
300
|
+
# === DESCRIPTION
|
301
|
+
# Constructs the assignment information.
|
302
|
+
#
|
303
|
+
# === PARAMETER
|
304
|
+
# _location_:: Location -- Location where the variable appears.
|
305
|
+
# _variable_name_:: String -- Assigned variable name.
|
306
|
+
# _assignment_rep_:: String -- Assignment expression representation.
|
307
|
+
def initialize(location, variable_name, assignment_rep)
|
308
|
+
@location = location
|
309
|
+
@variable_name = variable_name
|
310
|
+
@assignment_rep = assignment_rep
|
311
|
+
end
|
312
|
+
|
313
|
+
# === DESCRIPTION
|
314
|
+
# Converts this code structure information into array representation.
|
315
|
+
#
|
316
|
+
# === RETURN VALUE
|
317
|
+
# Array< Object > -- Array representation.
|
318
|
+
def to_a
|
319
|
+
["ASN", @location.fpath, @location.line_no, @location.column_no,
|
320
|
+
@variable_name, @assignment_rep]
|
321
|
+
end
|
322
|
+
end
|
323
|
+
|
324
|
+
# == DESCRIPTION
|
325
|
+
# Header include information.
|
326
|
+
class Include < CodeStructure
|
327
|
+
# === DESCRIPTION
|
328
|
+
# Constructs the header include information.
|
329
|
+
#
|
330
|
+
# === PARAMETER
|
331
|
+
# _location_:: Location -- Location where the directive appears.
|
332
|
+
# _included_fpath_:: Pathname -- Path name of the included file.
|
333
|
+
def initialize(location, included_fpath)
|
334
|
+
@location = location
|
335
|
+
@included_fpath = included_fpath
|
336
|
+
end
|
337
|
+
|
338
|
+
# === DESCRIPTION
|
339
|
+
# Converts this code structure information into array representation.
|
340
|
+
#
|
341
|
+
# === RETURN VALUE
|
342
|
+
# Array< Object > -- Array representation.
|
343
|
+
def to_a
|
344
|
+
["DEP", @location.fpath, @location.line_no, @location.column_no, "I",
|
345
|
+
@included_fpath]
|
346
|
+
end
|
347
|
+
end
|
348
|
+
|
349
|
+
# == DESCRIPTION
|
350
|
+
# Function call information.
|
351
|
+
class Call < CodeStructure
|
352
|
+
# === DESCRIPTION
|
353
|
+
# Constructs the function call informatin.
|
354
|
+
#
|
355
|
+
# === PARAMETER
|
356
|
+
# _location_:: Location -- Location where the function call appears.
|
357
|
+
# _caller_function_:: FunctionIdentifier -- Calling function identifier.
|
358
|
+
# _callee_function_:: FunctionIdentifier -- Called function identifier.
|
359
|
+
def initialize(location, caller_function, callee_function)
|
360
|
+
@location = location
|
361
|
+
@caller_function = caller_function
|
362
|
+
@callee_function = callee_function
|
363
|
+
end
|
364
|
+
|
365
|
+
# === DESCRIPTION
|
366
|
+
# Converts this code structure information into array representation.
|
367
|
+
#
|
368
|
+
# === RETURN VALUE
|
369
|
+
# Array< Object > -- Array representation.
|
370
|
+
def to_a
|
371
|
+
["DEP", @location.fpath, @location.line_no, @location.column_no, "C",
|
372
|
+
@caller_function.name, @caller_function.signature,
|
373
|
+
@callee_function.name, @callee_function.signature]
|
374
|
+
end
|
375
|
+
end
|
376
|
+
|
377
|
+
# == DESCRIPTION
|
378
|
+
# Variable cross reference information.
|
379
|
+
class XRefVar < CodeStructure
|
380
|
+
# === DESCRIPTION
|
381
|
+
# Constructs the cross reference information.
|
382
|
+
#
|
383
|
+
# === PARAMETER
|
384
|
+
# _location_:: Location -- Location where the cross-ref appears.
|
385
|
+
# _accessor_function_:: FunctionIdentifier -- Accessing function
|
386
|
+
# identifier.
|
387
|
+
# _access_type_:: String -- Access type string.
|
388
|
+
# _accessee_variable_:: String -- Accessed variable name.
|
389
|
+
def initialize(location, accessor_function, access_type, accessee_variable)
|
390
|
+
@location = location
|
391
|
+
@accessor_function = accessor_function
|
392
|
+
@access_type = access_type
|
393
|
+
@accessee_variable = accessee_variable
|
394
|
+
end
|
395
|
+
|
396
|
+
# === DESCRIPTION
|
397
|
+
# Converts this code structure information into array representation.
|
398
|
+
#
|
399
|
+
# === RETURN VALUE
|
400
|
+
# Array< Object > -- Array representation.
|
401
|
+
def to_a
|
402
|
+
["DEP", @location.fpath, @location.line_no, @location.column_no, "X",
|
403
|
+
"V", @accessor_function.name, @accessor_function.signature,
|
404
|
+
@access_type, @accessee_variable]
|
405
|
+
end
|
406
|
+
end
|
407
|
+
|
408
|
+
class XRefFunc < CodeStructure
|
409
|
+
# === DESCRIPTION
|
410
|
+
# Constructs the cross reference information.
|
411
|
+
#
|
412
|
+
# === PARAMETER
|
413
|
+
# _location_:: Location -- Location where the cross-ref appears.
|
414
|
+
# _accessor_function_:: FunctionIdentifier -- Accessing function
|
415
|
+
# identifier.
|
416
|
+
# _access_type_:: String -- Access type string.
|
417
|
+
# _accessee_function_:: FunctionIdentifier -- Accessed function identifier.
|
418
|
+
def initialize(location, accessor_function, access_type, accessee_function)
|
419
|
+
@location = location
|
420
|
+
@accessor_function = accessor_function
|
421
|
+
@access_type = access_type
|
422
|
+
@accessee_function = accessee_function
|
423
|
+
end
|
424
|
+
|
425
|
+
# === DESCRIPTION
|
426
|
+
# Converts this code structure information into array representation.
|
427
|
+
#
|
428
|
+
# === RETURN VALUE
|
429
|
+
# Array< Object > -- Array representation.
|
430
|
+
def to_a
|
431
|
+
["DEP", @location.fpath, @location.line_no, @location.column_no, "X",
|
432
|
+
"F", @accessor_function.name, @accessor_function.signature,
|
433
|
+
@access_type, @accessee_function.name, @accessee_function.signature]
|
434
|
+
end
|
435
|
+
end
|
436
|
+
|
437
|
+
class Literal < CodeStructure
|
438
|
+
def initialize(location, literal_type, literal_prefix, literal_suffix,
|
439
|
+
literal_value)
|
440
|
+
@location = location
|
441
|
+
@literal_type = literal_type
|
442
|
+
@literal_prefix = literal_prefix
|
443
|
+
@literal_suffix = literal_suffix
|
444
|
+
@literal_value = literal_value
|
445
|
+
end
|
446
|
+
|
447
|
+
def to_a
|
448
|
+
["LIT", @location.fpath, @location.line_no, @location.column_no,
|
449
|
+
@literal_type, @literal_prefix, @literal_suffix, @literal_value]
|
450
|
+
end
|
451
|
+
end
|
452
|
+
|
453
|
+
class PPDirective < CodeStructure
|
454
|
+
def initialize(location, pp_directive, pp_tokens)
|
455
|
+
@location = location
|
456
|
+
@pp_directive = pp_directive
|
457
|
+
@pp_tokens = pp_tokens
|
458
|
+
end
|
459
|
+
|
460
|
+
def to_a
|
461
|
+
["PRE", @location.fpath, @location.line_no, @location.column_no,
|
462
|
+
@pp_directive, @pp_tokens]
|
463
|
+
end
|
464
|
+
end
|
465
|
+
|
466
|
+
class FunctionIdentifier
|
467
|
+
def initialize(name, signature)
|
468
|
+
@name = name
|
469
|
+
@signature = signature
|
470
|
+
end
|
471
|
+
|
472
|
+
attr_reader :name
|
473
|
+
attr_reader :signature
|
474
|
+
end
|
475
|
+
|
476
|
+
class CodeExtraction
|
477
|
+
def initialize(context)
|
478
|
+
@context = context
|
479
|
+
end
|
480
|
+
|
481
|
+
def execute
|
482
|
+
do_prepare(@context)
|
483
|
+
do_execute(@context)
|
484
|
+
end
|
485
|
+
|
486
|
+
private
|
487
|
+
def do_prepare(context)
|
488
|
+
subclass_responsibility
|
489
|
+
end
|
490
|
+
|
491
|
+
def do_execute(context)
|
492
|
+
subclass_responsibility
|
493
|
+
end
|
494
|
+
|
495
|
+
def report
|
496
|
+
@context.report
|
497
|
+
end
|
498
|
+
end
|
499
|
+
|
500
|
+
end
|