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
@@ -0,0 +1,643 @@
|
|
1
|
+
# AdLint project configuration.
|
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/version"
|
33
|
+
require "adlint/util"
|
34
|
+
|
35
|
+
module AdLint #:nodoc:
|
36
|
+
|
37
|
+
# == DESCRIPTION
|
38
|
+
# Analysis configuration information.
|
39
|
+
class Traits
|
40
|
+
include Singleton
|
41
|
+
include Validation
|
42
|
+
|
43
|
+
# === DESCRIPTION
|
44
|
+
# Constructs an empty configuration information.
|
45
|
+
def initialize
|
46
|
+
@project_traits = nil
|
47
|
+
@compiler_traits = nil
|
48
|
+
@linker_traits = nil
|
49
|
+
@message_traits = nil
|
50
|
+
end
|
51
|
+
|
52
|
+
def name
|
53
|
+
""
|
54
|
+
end
|
55
|
+
|
56
|
+
ensure_validity_of :project_traits
|
57
|
+
ensure_validity_of :compiler_traits
|
58
|
+
ensure_validity_of :linker_traits
|
59
|
+
ensure_validity_of :message_traits
|
60
|
+
|
61
|
+
def of_project
|
62
|
+
@project_traits
|
63
|
+
end
|
64
|
+
|
65
|
+
def of_compiler
|
66
|
+
@compiler_traits
|
67
|
+
end
|
68
|
+
|
69
|
+
def of_linker
|
70
|
+
@linker_traits
|
71
|
+
end
|
72
|
+
|
73
|
+
def of_message
|
74
|
+
@message_traits
|
75
|
+
end
|
76
|
+
|
77
|
+
def read_from(traits_fpath)
|
78
|
+
File.open(traits_fpath, "r:utf-8") do |io|
|
79
|
+
case array_or_stream = YAML.load_stream(io)
|
80
|
+
when Array
|
81
|
+
# NOTE: YAML.load_stream returns Array in Ruby 1.9.3-preview1.
|
82
|
+
doc = array_or_stream.first
|
83
|
+
when YAML::Stream
|
84
|
+
doc = array_or_stream.documents.first
|
85
|
+
end
|
86
|
+
validate_version(doc["version"])
|
87
|
+
|
88
|
+
@project_traits = ProjectTraits.new(doc["project_traits"]).freeze
|
89
|
+
@compiler_traits = CompilerTraits.new(doc["compiler_traits"]).freeze
|
90
|
+
@linker_traits = LinkerTraits.new(doc["linker_traits"]).freeze
|
91
|
+
@message_traits = MessageTraits.new(doc["message_traits"]).freeze
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
private
|
96
|
+
def validate_version(version)
|
97
|
+
version =~ SCHEMA_VERSION_RE or
|
98
|
+
raise "invalid version of the trailts file."
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
class ProjectTraits
|
103
|
+
include Validation
|
104
|
+
|
105
|
+
def initialize(doc)
|
106
|
+
@project_name = doc["project_name"]
|
107
|
+
|
108
|
+
if path_strs = doc["include_path"]
|
109
|
+
@include_path = path_strs.map { |str| Pathname.new(str) }
|
110
|
+
else
|
111
|
+
@include_path = []
|
112
|
+
end
|
113
|
+
|
114
|
+
@initial_header = doc["initial_header"]
|
115
|
+
@coding_style = CodingStyle.new(doc["coding_style"])
|
116
|
+
@file_encoding = doc["file_encoding"]
|
117
|
+
end
|
118
|
+
|
119
|
+
def name
|
120
|
+
"project_traits"
|
121
|
+
end
|
122
|
+
|
123
|
+
attr_reader :project_name
|
124
|
+
ensure_presence_of :project_name
|
125
|
+
|
126
|
+
attr_reader :include_path
|
127
|
+
ensure_dirs_presence_of :include_path
|
128
|
+
|
129
|
+
attr_reader :initial_header
|
130
|
+
ensure_file_presence_of :initial_header, :allow_nil => true
|
131
|
+
|
132
|
+
attr_reader :coding_style
|
133
|
+
ensure_validity_of :coding_style
|
134
|
+
|
135
|
+
attr_reader :file_encoding
|
136
|
+
ensure_with :file_encoding, :message => "is not a valid encoding name.",
|
137
|
+
:validator => Encoding.method(:include_name?)
|
138
|
+
|
139
|
+
class CodingStyle
|
140
|
+
include Validation
|
141
|
+
|
142
|
+
K_AND_R = "K&R".freeze
|
143
|
+
ALLMAN = "Allman".freeze
|
144
|
+
GNU = "GNU".freeze
|
145
|
+
|
146
|
+
def initialize(doc)
|
147
|
+
@indent_style = doc["indent_style"]
|
148
|
+
@tab_width = doc["tab_width"]
|
149
|
+
@indent_width = doc["indent_width"]
|
150
|
+
end
|
151
|
+
|
152
|
+
def name
|
153
|
+
"project_traits:coding_style"
|
154
|
+
end
|
155
|
+
|
156
|
+
attr_reader :indent_style
|
157
|
+
ensure_inclusion_of :indent_style, :values => [K_AND_R, ALLMAN, GNU]
|
158
|
+
|
159
|
+
attr_reader :tab_width
|
160
|
+
ensure_numericality_of :tab_width, :only_integer => true, :min => 1
|
161
|
+
|
162
|
+
attr_reader :indent_width
|
163
|
+
ensure_numericality_of :indent_width, :only_integer => true, :min => 1
|
164
|
+
|
165
|
+
def freeze
|
166
|
+
@indent_style.freeze
|
167
|
+
@tab_width.freeze
|
168
|
+
@indent_width.freeze
|
169
|
+
super
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
def freeze
|
174
|
+
@project_name.freeze
|
175
|
+
@include_path.freeze
|
176
|
+
@initial_header.freeze
|
177
|
+
@coding_style.freeze
|
178
|
+
@file_encoding.freeze
|
179
|
+
super
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
# == DESCRIPTION
|
184
|
+
# Traits information of the compiler used in the project.
|
185
|
+
class CompilerTraits
|
186
|
+
include Validation
|
187
|
+
|
188
|
+
def initialize(doc)
|
189
|
+
@standard_type = StandardType.new(doc["standard_type"])
|
190
|
+
|
191
|
+
if path_strs = doc["include_path"]
|
192
|
+
@include_path = path_strs.map { |str| Pathname.new(str) }
|
193
|
+
else
|
194
|
+
@include_path = []
|
195
|
+
end
|
196
|
+
|
197
|
+
@initial_header = doc["initial_header"]
|
198
|
+
@arithmetic = Arithmetic.new(doc["arithmetic"])
|
199
|
+
@extension_substitution = doc["extension_substitution"] || {}
|
200
|
+
@arbitrary_substitution = doc["arbitrary_substitution"] || {}
|
201
|
+
@identifier_max = doc["identifier_max"]
|
202
|
+
end
|
203
|
+
|
204
|
+
def name
|
205
|
+
"compiler_traits"
|
206
|
+
end
|
207
|
+
|
208
|
+
# === VALUE
|
209
|
+
# CompilerTraits::StandardType -- The standard type traits information.
|
210
|
+
attr_reader :standard_type
|
211
|
+
ensure_validity_of :standard_type
|
212
|
+
|
213
|
+
# === VALUE
|
214
|
+
# Array< String > -- System include paths.
|
215
|
+
attr_reader :include_path
|
216
|
+
ensure_dirs_presence_of :include_path
|
217
|
+
|
218
|
+
# === VALUE
|
219
|
+
# String -- The file path of the initial source.
|
220
|
+
attr_reader :initial_header
|
221
|
+
ensure_file_presence_of :initial_header, :allow_nil => true
|
222
|
+
|
223
|
+
# === VALUE
|
224
|
+
# CompilerTraits::Arithmetic -- The arithmetic traits information.
|
225
|
+
attr_reader :arithmetic
|
226
|
+
ensure_validity_of :arithmetic
|
227
|
+
|
228
|
+
# === VALUE
|
229
|
+
# Hash<String, String > -- The compiler-extension code substitution
|
230
|
+
# setting.
|
231
|
+
attr_reader :extension_substitution
|
232
|
+
|
233
|
+
# === VALUE
|
234
|
+
# Hash<String, String > -- The arbitrary code substitution setting.
|
235
|
+
attr_reader :arbitrary_substitution
|
236
|
+
|
237
|
+
# === VALUE
|
238
|
+
# Integer -- Max length of all symbols identified by the compiler.
|
239
|
+
attr_reader :identifier_max
|
240
|
+
ensure_numericality_of :identifier_max, :only_integer => true, :min => 1
|
241
|
+
|
242
|
+
# == DESCRIPTION
|
243
|
+
# Traits information of standard types.
|
244
|
+
class StandardType
|
245
|
+
include Validation
|
246
|
+
|
247
|
+
def initialize(doc)
|
248
|
+
@char_size = doc["char_size"]
|
249
|
+
@char_alignment = doc["char_alignment"]
|
250
|
+
|
251
|
+
@short_size = doc["short_size"]
|
252
|
+
@short_alignment = doc["short_alignment"]
|
253
|
+
|
254
|
+
@int_size = doc["int_size"]
|
255
|
+
@int_alignment = doc["int_alignment"]
|
256
|
+
|
257
|
+
@long_size = doc["long_size"]
|
258
|
+
@long_alignment = doc["long_alignment"]
|
259
|
+
|
260
|
+
@long_long_size = doc["long_long_size"]
|
261
|
+
@long_long_alignment = doc["long_long_alignment"]
|
262
|
+
|
263
|
+
@float_size = doc["float_size"]
|
264
|
+
@float_alignment = doc["float_alignment"]
|
265
|
+
|
266
|
+
@double_size = doc["double_size"]
|
267
|
+
@double_alignment = doc["double_alignment"]
|
268
|
+
|
269
|
+
@long_double_size = doc["long_double_size"]
|
270
|
+
@long_double_alignment = doc["long_double_alignment"]
|
271
|
+
|
272
|
+
@code_ptr_size = doc["code_ptr_size"]
|
273
|
+
@code_ptr_alignment = doc["code_ptr_alignment"]
|
274
|
+
|
275
|
+
@data_ptr_size = doc["data_ptr_size"]
|
276
|
+
@data_ptr_alignment = doc["data_ptr_alignment"]
|
277
|
+
|
278
|
+
@char_as_unsigned_char = doc["char_as_unsigned_char"]
|
279
|
+
end
|
280
|
+
|
281
|
+
def name
|
282
|
+
"compiler_traits:standard_type"
|
283
|
+
end
|
284
|
+
|
285
|
+
# === VALUE
|
286
|
+
# Integer -- Bit length of the `char' type.
|
287
|
+
attr_reader :char_size
|
288
|
+
ensure_numericality_of :char_size, :only_integer => true,
|
289
|
+
:min => 1, :max => 256
|
290
|
+
|
291
|
+
attr_reader :char_alignment
|
292
|
+
ensure_numericality_of :char_alignment, :only_integer => true, :min => 1
|
293
|
+
|
294
|
+
# === VALUE
|
295
|
+
# Integer -- Bit length of the `short' type.
|
296
|
+
attr_reader :short_size
|
297
|
+
ensure_numericality_of :short_size, :only_integer => true,
|
298
|
+
:min => 1, :max => 256
|
299
|
+
|
300
|
+
attr_reader :short_alignment
|
301
|
+
ensure_numericality_of :short_alignment, :only_integer => true, :min => 1
|
302
|
+
|
303
|
+
# === VALUE
|
304
|
+
# Integer -- Bit length of the `int' type.
|
305
|
+
attr_reader :int_size
|
306
|
+
ensure_numericality_of :int_size, :only_integer => true,
|
307
|
+
:min => 1, :max => 256
|
308
|
+
|
309
|
+
attr_reader :int_alignment
|
310
|
+
ensure_numericality_of :int_alignment, :only_integer => true, :min => 1
|
311
|
+
|
312
|
+
# === VALUE
|
313
|
+
# Integer -- Bit length of the `long' type.
|
314
|
+
attr_reader :long_size
|
315
|
+
ensure_numericality_of :long_size, :only_integer => true,
|
316
|
+
:min => 1, :max => 256
|
317
|
+
|
318
|
+
attr_reader :long_alignment
|
319
|
+
ensure_numericality_of :long_alignment, :only_integer => true, :min => 1
|
320
|
+
|
321
|
+
# === VALUE
|
322
|
+
# Integer -- Bit length of the `long long' type.
|
323
|
+
attr_reader :long_long_size
|
324
|
+
ensure_numericality_of :long_long_size, :only_integer => true,
|
325
|
+
:min => 1, :max => 256
|
326
|
+
|
327
|
+
attr_reader :long_long_alignment
|
328
|
+
ensure_numericality_of :long_long_alignment, :only_integer => true,
|
329
|
+
:min => 1
|
330
|
+
|
331
|
+
# === VALUE
|
332
|
+
# Integer -- Bit length of the `float' type.
|
333
|
+
attr_reader :float_size
|
334
|
+
ensure_numericality_of :float_size, :only_integer => true,
|
335
|
+
:min => 1, :max => 256
|
336
|
+
|
337
|
+
attr_reader :float_alignment
|
338
|
+
ensure_numericality_of :float_alignment, :only_integer => true, :min => 1
|
339
|
+
|
340
|
+
# === VALUE
|
341
|
+
# Integer -- Bit length of the `double' type.
|
342
|
+
attr_reader :double_size
|
343
|
+
ensure_numericality_of :double_size, :only_integer => true,
|
344
|
+
:min => 1, :max => 256
|
345
|
+
|
346
|
+
attr_reader :double_alignment
|
347
|
+
ensure_numericality_of :double_alignment, :only_integer => true,
|
348
|
+
:min => 1
|
349
|
+
|
350
|
+
# === VALUE
|
351
|
+
# Integer -- Bit length of the `long double' type.
|
352
|
+
attr_reader :long_double_size
|
353
|
+
ensure_numericality_of :long_double_size, :only_integer => true,
|
354
|
+
:min => 1, :max => 256
|
355
|
+
|
356
|
+
attr_reader :long_double_alignment
|
357
|
+
ensure_numericality_of :long_double_alignment, :only_integer => true,
|
358
|
+
:min => 1
|
359
|
+
|
360
|
+
attr_reader :code_ptr_size
|
361
|
+
ensure_numericality_of :code_ptr_size, :only_integer => true,
|
362
|
+
:min => 1, :max => 256
|
363
|
+
|
364
|
+
attr_reader :code_ptr_alignment
|
365
|
+
ensure_numericality_of :code_ptr_alignment, :only_integer => true,
|
366
|
+
:min => 1
|
367
|
+
|
368
|
+
attr_reader :data_ptr_size
|
369
|
+
ensure_numericality_of :data_ptr_size, :only_integer => true,
|
370
|
+
:min => 1, :max => 256
|
371
|
+
|
372
|
+
attr_reader :data_ptr_alignment
|
373
|
+
ensure_numericality_of :data_ptr_alignment, :only_integer => true,
|
374
|
+
:min => 1
|
375
|
+
|
376
|
+
# === VALUE
|
377
|
+
# Boolean -- The flag indicates `char' is `unsigned char'.
|
378
|
+
attr_reader :char_as_unsigned_char
|
379
|
+
ensure_true_or_false_of :char_as_unsigned_char
|
380
|
+
|
381
|
+
def freeze
|
382
|
+
@char_size.freeze
|
383
|
+
@char_alignment.freeze
|
384
|
+
@short_size.freeze
|
385
|
+
@short_alignment.freeze
|
386
|
+
@int_size.freeze
|
387
|
+
@int_alignment.freeze
|
388
|
+
@long_size.freeze
|
389
|
+
@long_alignment.freeze
|
390
|
+
@long_long_size.freeze
|
391
|
+
@long_long_alignment.freeze
|
392
|
+
@float_size.freeze
|
393
|
+
@float_alignment.freeze
|
394
|
+
@double_size.freeze
|
395
|
+
@double_alignment.freeze
|
396
|
+
@long_double_size.freeze
|
397
|
+
@long_double_alignment.freeze
|
398
|
+
@code_ptr_size.freeze
|
399
|
+
@code_ptr_alignment.freeze
|
400
|
+
@data_ptr_size.freeze
|
401
|
+
@data_ptr_alignment.freeze
|
402
|
+
@char_as_unsigned_char.freeze
|
403
|
+
super
|
404
|
+
end
|
405
|
+
end
|
406
|
+
private_constant :StandardType
|
407
|
+
|
408
|
+
# == DESCRIPTION
|
409
|
+
# Traits information of arithmetic process.
|
410
|
+
class Arithmetic
|
411
|
+
include Validation
|
412
|
+
|
413
|
+
def initialize(doc)
|
414
|
+
@logical_right_shift = doc["logical_right_shift"]
|
415
|
+
end
|
416
|
+
|
417
|
+
def name
|
418
|
+
"compiler_traits:arithmetic"
|
419
|
+
end
|
420
|
+
|
421
|
+
# === VALUE
|
422
|
+
# Boolean -- The flag value indicates the right shift operation is
|
423
|
+
# logical.
|
424
|
+
attr_reader :logical_right_shift
|
425
|
+
ensure_true_or_false_of :logical_right_shift
|
426
|
+
|
427
|
+
def freeze
|
428
|
+
@logical_right_shift.freeze
|
429
|
+
super
|
430
|
+
end
|
431
|
+
end
|
432
|
+
private_constant :Arithmetic
|
433
|
+
|
434
|
+
def freeze
|
435
|
+
@standard_type.freeze
|
436
|
+
@include_path.freeze
|
437
|
+
@initial_header.freeze
|
438
|
+
@arithmetic.freeze
|
439
|
+
@extension_substitution.freeze
|
440
|
+
@arbitrary_substitution.freeze
|
441
|
+
@identifier_max.freeze
|
442
|
+
super
|
443
|
+
end
|
444
|
+
end
|
445
|
+
|
446
|
+
# == DESCRIPTION
|
447
|
+
# Traits information of the linker used in the project.
|
448
|
+
class LinkerTraits
|
449
|
+
include Validation
|
450
|
+
|
451
|
+
def initialize(doc)
|
452
|
+
@identifier_max = doc["identifier_max"]
|
453
|
+
@identifier_ignore_case = doc["identifier_ignore_case"]
|
454
|
+
end
|
455
|
+
|
456
|
+
def name
|
457
|
+
"linker_traits"
|
458
|
+
end
|
459
|
+
|
460
|
+
# === VALUE
|
461
|
+
# Integer -- Max length of all external symbols identified by the linker.
|
462
|
+
attr_reader :identifier_max
|
463
|
+
ensure_numericality_of :identifier_max, :only_integer => true, :min => 1
|
464
|
+
|
465
|
+
# === VALUE
|
466
|
+
# Boolean -- The flag indicates that external symbols are identified
|
467
|
+
# without case by the linker.
|
468
|
+
attr_reader :identifier_ignore_case
|
469
|
+
ensure_true_or_false_of :identifier_ignore_case
|
470
|
+
|
471
|
+
def freeze
|
472
|
+
@identifier_max.freeze
|
473
|
+
@identifier_ignore_case.freeze
|
474
|
+
super
|
475
|
+
end
|
476
|
+
end
|
477
|
+
|
478
|
+
class MessageTraits
|
479
|
+
include Validation
|
480
|
+
|
481
|
+
def initialize(doc)
|
482
|
+
@language = doc["language"]
|
483
|
+
str_str_hash = doc["change_list"] || {}
|
484
|
+
@change_list = str_str_hash.each_with_object({}) { |(id, text), hash|
|
485
|
+
hash[id.intern] = text
|
486
|
+
}
|
487
|
+
end
|
488
|
+
|
489
|
+
def name
|
490
|
+
"message_traits"
|
491
|
+
end
|
492
|
+
|
493
|
+
attr_reader :language
|
494
|
+
ensure_inclusion_of :language, :values => %w(ja_JP en_US)
|
495
|
+
|
496
|
+
attr_reader :change_list
|
497
|
+
|
498
|
+
def freeze
|
499
|
+
@language.freeze
|
500
|
+
@change_list.freeze
|
501
|
+
super
|
502
|
+
end
|
503
|
+
end
|
504
|
+
|
505
|
+
module StandardTypeAccessor
|
506
|
+
def standard_type
|
507
|
+
Traits.instance.of_compiler.standard_type
|
508
|
+
end
|
509
|
+
module_function :standard_type
|
510
|
+
|
511
|
+
def char_size
|
512
|
+
standard_type.char_size
|
513
|
+
end
|
514
|
+
module_function :char_size
|
515
|
+
|
516
|
+
def char_alignment
|
517
|
+
standard_type.char_alignment
|
518
|
+
end
|
519
|
+
module_function :char_alignment
|
520
|
+
|
521
|
+
def short_size
|
522
|
+
standard_type.short_size
|
523
|
+
end
|
524
|
+
module_function :short_size
|
525
|
+
|
526
|
+
def short_alignment
|
527
|
+
standard_type.short_alignment
|
528
|
+
end
|
529
|
+
module_function :short_alignment
|
530
|
+
|
531
|
+
def int_size
|
532
|
+
standard_type.int_size
|
533
|
+
end
|
534
|
+
module_function :int_size
|
535
|
+
|
536
|
+
def int_alignment
|
537
|
+
standard_type.int_alignment
|
538
|
+
end
|
539
|
+
module_function :int_alignment
|
540
|
+
|
541
|
+
def long_size
|
542
|
+
standard_type.long_size
|
543
|
+
end
|
544
|
+
module_function :long_size
|
545
|
+
|
546
|
+
def long_alignment
|
547
|
+
standard_type.long_alignment
|
548
|
+
end
|
549
|
+
module_function :long_alignment
|
550
|
+
|
551
|
+
def long_long_size
|
552
|
+
standard_type.long_long_size
|
553
|
+
end
|
554
|
+
module_function :long_long_size
|
555
|
+
|
556
|
+
def long_long_alignment
|
557
|
+
standard_type.long_long_alignment
|
558
|
+
end
|
559
|
+
module_function :long_long_alignment
|
560
|
+
|
561
|
+
def float_size
|
562
|
+
standard_type.float_size
|
563
|
+
end
|
564
|
+
module_function :float_size
|
565
|
+
|
566
|
+
def float_alignment
|
567
|
+
standard_type.float_alignment
|
568
|
+
end
|
569
|
+
module_function :float_alignment
|
570
|
+
|
571
|
+
def double_size
|
572
|
+
standard_type.double_size
|
573
|
+
end
|
574
|
+
module_function :double_size
|
575
|
+
|
576
|
+
def double_alignment
|
577
|
+
standard_type.double_alignment
|
578
|
+
end
|
579
|
+
module_function :double_alignment
|
580
|
+
|
581
|
+
def long_double_size
|
582
|
+
standard_type.long_double_size
|
583
|
+
end
|
584
|
+
module_function :long_double_size
|
585
|
+
|
586
|
+
def long_double_alignment
|
587
|
+
standard_type.long_double_alignment
|
588
|
+
end
|
589
|
+
module_function :long_double_alignment
|
590
|
+
|
591
|
+
def code_ptr_size
|
592
|
+
standard_type.code_ptr_size
|
593
|
+
end
|
594
|
+
module_function :code_ptr_size
|
595
|
+
|
596
|
+
def code_ptr_alignment
|
597
|
+
standard_type.code_ptr_alignment
|
598
|
+
end
|
599
|
+
module_function :code_ptr_alignment
|
600
|
+
|
601
|
+
def data_ptr_size
|
602
|
+
standard_type.data_ptr_size
|
603
|
+
end
|
604
|
+
module_function :data_ptr_size
|
605
|
+
|
606
|
+
def data_ptr_alignment
|
607
|
+
standard_type.data_ptr_alignment
|
608
|
+
end
|
609
|
+
module_function :data_ptr_alignment
|
610
|
+
|
611
|
+
def char_as_unsigned_char?
|
612
|
+
standard_type.char_as_unsigned_char
|
613
|
+
end
|
614
|
+
module_function :char_as_unsigned_char?
|
615
|
+
end
|
616
|
+
|
617
|
+
module CodingStyleAccessor
|
618
|
+
def coding_style
|
619
|
+
Traits.instance.of_project.coding_style
|
620
|
+
end
|
621
|
+
module_function :coding_style
|
622
|
+
|
623
|
+
def indent_style
|
624
|
+
coding_style.indent_style
|
625
|
+
end
|
626
|
+
module_function :indent_style
|
627
|
+
|
628
|
+
def tab_width
|
629
|
+
coding_style.tab_width
|
630
|
+
end
|
631
|
+
module_function :tab_width
|
632
|
+
|
633
|
+
def indent_width
|
634
|
+
coding_style.indent_width
|
635
|
+
end
|
636
|
+
module_function :indent_width
|
637
|
+
|
638
|
+
INDENT_STYLE_K_AND_R = ProjectTraits::CodingStyle::K_AND_R
|
639
|
+
INDENT_STYLE_ALLMAN = ProjectTraits::CodingStyle::ALLMAN
|
640
|
+
INDENT_STYLE_GNU = ProjectTraits::CodingStyle::GNU
|
641
|
+
end
|
642
|
+
|
643
|
+
end
|