adlint 2.6.14 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/AUTHORS +1 -3
- data/ChangeLog +511 -0
- data/INSTALL +1 -1
- data/MANIFEST +57 -37
- data/NEWS +36 -7
- data/README +2 -2
- data/Rakefile +6 -6
- data/TODO +1 -1
- data/bin/adlint +25 -16
- data/bin/adlint_chk +22 -12
- data/bin/adlint_cma +17 -12
- data/bin/adlint_sma +22 -12
- data/bin/adlintize +98 -17
- data/etc/conf.d/fallback/cinit.erb +1 -1
- data/etc/conf.d/fallback/traits.erb +37 -37
- data/etc/conf.d/i686-cygwin/cinit-gcc_4.3.4.erb +1 -1
- data/etc/conf.d/i686-cygwin/traits-gcc_4.3.4.erb +41 -41
- data/etc/conf.d/i686-devkit/cinit-gcc_4.5.2.erb +1 -1
- data/etc/conf.d/i686-devkit/traits-gcc_4.5.2.erb +40 -40
- data/etc/conf.d/i686-linux/cinit-gcc_4.5.1.erb +1 -1
- data/etc/conf.d/i686-linux/traits-gcc_4.5.1.erb +40 -40
- data/etc/conf.d/i686-mingw/cinit-gcc_4.6.1.erb +1 -1
- data/etc/conf.d/i686-mingw/traits-gcc_4.6.1.erb +40 -40
- data/etc/conf.d/noarch/GNUmakefile.erb +1 -1
- data/etc/conf.d/noarch/adlint_all_bat.erb +1 -1
- data/etc/conf.d/noarch/adlint_all_sh.erb +1 -1
- data/etc/conf.d/noarch/pinit.erb +1 -1
- data/etc/conf.d/x86_64-ubuntu_12.04/cinit-gcc_4.6.3.erb +1 -1
- data/etc/conf.d/x86_64-ubuntu_12.04/traits-gcc_4.6.3.erb +42 -42
- data/etc/mesg.d/c_builtin/en_US/messages.yml +33 -33
- data/etc/mesg.d/c_builtin/ja_JP/messages.yml +5 -5
- data/etc/mesg.d/core/en_US/messages.yml +2 -2
- data/etc/mesg.d/core/ja_JP/messages.yml +2 -2
- data/features/code_check/W0018.feature +197 -0
- data/features/code_check/W0019.feature +79 -0
- data/features/code_check/W0021.feature +81 -0
- data/features/code_check/W0023.feature +203 -0
- data/features/code_check/W0024.feature +226 -0
- data/features/code_check/W0025.feature +5 -0
- data/features/code_check/W0088.feature +2 -2
- data/features/code_check/W0109.feature +2 -2
- data/features/code_check/W0477.feature +0 -3
- data/features/code_check/W0478.feature +0 -1
- data/features/code_check/W0582.feature +3 -3
- data/features/code_check/W0583.feature +4 -7
- data/features/code_check/W0646.feature +0 -1
- data/features/code_check/W0695.feature +0 -1
- data/features/code_check/W0705.feature +8 -0
- data/features/code_check/W0723.feature +0 -1
- data/features/code_check/W0745.feature +1 -0
- data/features/code_check/W0781.feature +1 -0
- data/features/code_check/W1057.feature +141 -0
- data/features/code_check/W1058.feature +93 -0
- data/features/code_check/W1059.feature +86 -0
- data/features/code_check/W1060.feature +77 -0
- data/features/code_check/W1061.feature +143 -0
- data/features/code_check/W1062.feature +162 -0
- data/features/code_check/W1063.feature +123 -0
- data/features/code_check/W1064.feature +83 -0
- data/features/code_check/W1065.feature +82 -0
- data/features/code_check/W9003.feature +2 -0
- data/features/step_definitions/code_check_steps.rb +1 -0
- data/features/support/env.rb +16 -13
- data/lib/adlint.rb +7 -4
- data/lib/adlint/analyzer.rb +131 -157
- data/lib/adlint/annot.rb +149 -0
- data/lib/adlint/cc1.rb +57 -0
- data/lib/adlint/{c → cc1}/branch.rb +74 -62
- data/lib/adlint/{c → cc1}/builtin.rb +21 -21
- data/lib/adlint/{c → cc1}/const.rb +119 -117
- data/lib/adlint/{c → cc1}/conv.rb +76 -78
- data/lib/adlint/{c → cc1}/ctrlexpr.rb +69 -86
- data/lib/adlint/cc1/domain.rb +8103 -0
- data/lib/adlint/{c → cc1}/enum.rb +3 -3
- data/lib/adlint/{c → cc1}/environ.rb +21 -21
- data/lib/adlint/{c → cc1}/expr.rb +232 -218
- data/lib/adlint/{c → cc1}/format.rb +305 -342
- data/lib/adlint/{c → cc1}/interp.rb +269 -220
- data/lib/adlint/cc1/lexer.rb +246 -0
- data/lib/adlint/{c → cc1}/mediator.rb +78 -84
- data/lib/adlint/{c → cc1}/object.rb +261 -264
- data/lib/adlint/{c → cc1}/operator.rb +7 -7
- data/lib/adlint/{c → cc1}/option.rb +4 -3
- data/lib/adlint/{c → cc1}/parser.rb +274 -506
- data/lib/adlint/{c → cc1}/parser.y +69 -301
- data/lib/adlint/cc1/phase.rb +138 -0
- data/lib/adlint/{c → cc1}/resolver.rb +66 -78
- data/lib/adlint/{c → cc1}/scanner.rb +57 -49
- data/lib/adlint/{c → cc1}/scope.rb +3 -3
- data/lib/adlint/{c → cc1}/seqp.rb +13 -5
- data/lib/adlint/{c → cc1}/syntax.rb +819 -1122
- data/lib/adlint/{c → cc1}/type.rb +1498 -1479
- data/lib/adlint/{c → cc1}/util.rb +20 -12
- data/lib/adlint/{c → cc1}/value.rb +699 -642
- data/lib/adlint/code.rb +163 -164
- data/lib/adlint/cpp.rb +2 -2
- data/lib/adlint/cpp/asm.rb +13 -14
- data/lib/adlint/cpp/constexpr.rb +42 -38
- data/lib/adlint/cpp/constexpr.y +44 -40
- data/lib/adlint/cpp/eval.rb +435 -435
- data/lib/adlint/cpp/lexer.rb +343 -340
- data/lib/adlint/cpp/macro.rb +188 -190
- data/lib/adlint/cpp/phase.rb +66 -45
- data/lib/adlint/cpp/scanner.rb +14 -17
- data/lib/adlint/cpp/source.rb +49 -55
- data/lib/adlint/cpp/subst.rb +65 -65
- data/lib/adlint/cpp/syntax.rb +155 -275
- data/lib/adlint/cpp/util.rb +22 -19
- data/lib/adlint/driver.rb +86 -93
- data/lib/adlint/error.rb +33 -52
- data/lib/adlint/exam.rb +158 -24
- data/lib/adlint/exam/c_builtin.rb +7 -7
- data/lib/adlint/exam/c_builtin/cc1_check.rb +20522 -0
- data/lib/adlint/exam/c_builtin/cc1_check_shima.rb +957 -0
- data/lib/adlint/exam/c_builtin/cc1_code.rb +459 -0
- data/lib/adlint/exam/c_builtin/cc1_metric.rb +794 -0
- data/lib/adlint/exam/c_builtin/cpp_check.rb +486 -441
- data/lib/adlint/exam/c_builtin/cpp_check_shima.rb +36 -39
- data/lib/adlint/exam/c_builtin/cpp_code.rb +63 -65
- data/lib/adlint/exam/c_builtin/ld_check.rb +136 -129
- data/lib/adlint/exam/c_builtin/ld_metric.rb +11 -11
- data/lib/adlint/lang.rb +25 -25
- data/lib/adlint/ld.rb +2 -2
- data/lib/adlint/ld/object.rb +220 -188
- data/lib/adlint/ld/phase.rb +94 -63
- data/lib/adlint/ld/typedef.rb +22 -11
- data/lib/adlint/ld/util.rb +43 -35
- data/lib/adlint/lexer.rb +59 -56
- data/lib/adlint/location.rb +140 -0
- data/lib/adlint/memo.rb +157 -0
- data/lib/adlint/message.rb +207 -156
- data/lib/adlint/metric.rb +139 -217
- data/lib/adlint/monitor.rb +45 -43
- data/lib/adlint/phase.rb +56 -29
- data/lib/adlint/prelude.rb +66 -54
- data/lib/adlint/report.rb +253 -332
- data/lib/adlint/source.rb +26 -27
- data/lib/adlint/supp.rb +131 -0
- data/lib/adlint/symbol.rb +14 -16
- data/lib/adlint/token.rb +19 -91
- data/lib/adlint/traits.rb +242 -226
- data/lib/adlint/util.rb +116 -205
- data/lib/adlint/version.rb +8 -8
- data/share/HEADER +2 -2
- data/share/doc/developers_guide_ja.html +148 -19
- data/share/doc/developers_guide_ja.texi +141 -11
- data/share/doc/samples/GNUmakefile +1 -1
- data/share/doc/samples/adlint_traits.yml +45 -36
- data/share/doc/users_guide_en.html +1321 -1252
- data/share/doc/users_guide_en.texi +475 -408
- data/share/doc/users_guide_ja.html +1932 -1878
- data/share/doc/users_guide_ja.texi +324 -273
- data/share/sample/bison-2.5/adlint/GNUmakefile +5 -1
- data/share/sample/bison-2.5/adlint/adlint_traits.yml +38 -38
- data/share/sample/bison-2.5/adlint/lib/GNUmakefile +1 -1
- data/share/sample/bison-2.5/adlint/lib/adlint_cinit.h +1 -1
- data/share/sample/bison-2.5/adlint/lib/adlint_pinit.h +1 -1
- data/share/sample/bison-2.5/adlint/lib/adlint_traits.yml +50 -42
- data/share/sample/bison-2.5/adlint/src/GNUmakefile +1 -1
- data/share/sample/bison-2.5/adlint/src/adlint_cinit.h +1 -1
- data/share/sample/bison-2.5/adlint/src/adlint_pinit.h +1 -1
- data/share/sample/bison-2.5/adlint/src/adlint_traits.yml +50 -42
- data/share/sample/ctags-5.8/adlint/GNUmakefile +1 -1
- data/share/sample/ctags-5.8/adlint/adlint_cinit.h +1 -1
- data/share/sample/ctags-5.8/adlint/adlint_pinit.h +1 -1
- data/share/sample/ctags-5.8/adlint/adlint_traits.yml +50 -42
- data/share/sample/flex-2.5.35/adlint/GNUmakefile +1 -1
- data/share/sample/flex-2.5.35/adlint/adlint_cinit.h +1 -1
- data/share/sample/flex-2.5.35/adlint/adlint_pinit.h +1 -1
- data/share/sample/flex-2.5.35/adlint/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/adlint_traits.yml +46 -38
- data/share/sample/ruby-1.9.3-p0/adlint/core/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/core/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/core/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/core/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/enc-trans/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/enc/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/enc/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/enc/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/enc/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-bigdecimal/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-continuation/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-coverage/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-curses/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-date/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-date/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-date/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-date/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dbm/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-bubblebabble/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-md5/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-rmd160/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha1/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest-sha2/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-digest/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl-callback/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-dl/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-etc/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fcntl/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiber/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-fiddle/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-gdbm/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-iconv/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-console/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-nonblock/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-io-wait/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-generator/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-json-parser/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-complex/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-mathn-rational/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-nkf/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-openssl/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pathname/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-psych/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-pty/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-racc-cparse/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-readline/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-ripper/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-sdbm/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-socket/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-stringio/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-strscan/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syck/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-syslog/adlint_traits.yml +50 -42
- data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/GNUmakefile +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/adlint_cinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/adlint_pinit.h +1 -1
- data/share/sample/ruby-1.9.3-p0/adlint/ext-zlib/adlint_traits.yml +50 -42
- data/share/sample/screen-4.0.3/adlint/GNUmakefile +1 -1
- data/share/sample/screen-4.0.3/adlint/adlint_cinit.h +1 -1
- data/share/sample/screen-4.0.3/adlint/adlint_pinit.h +1 -1
- data/share/sample/screen-4.0.3/adlint/adlint_traits.yml +50 -42
- data/share/sample/vim-7.3/adlint/vim/GNUmakefile +1 -1
- data/share/sample/vim-7.3/adlint/vim/adlint_cinit.h +1 -1
- data/share/sample/vim-7.3/adlint/vim/adlint_pinit.h +1 -1
- data/share/sample/vim-7.3/adlint/vim/adlint_traits.yml +50 -42
- data/share/sample/vim-7.3/adlint/xxd/GNUmakefile +1 -1
- data/share/sample/vim-7.3/adlint/xxd/adlint_cinit.h +1 -1
- data/share/sample/vim-7.3/adlint/xxd/adlint_pinit.h +1 -1
- data/share/sample/vim-7.3/adlint/xxd/adlint_traits.yml +49 -41
- data/share/sample/zsh-4.3.15/adlint/GNUmakefile +1 -1
- data/share/sample/zsh-4.3.15/adlint/adlint_traits.yml +46 -38
- data/share/sample/zsh-4.3.15/adlint/builtins/GNUmakefile +1 -1
- data/share/sample/zsh-4.3.15/adlint/builtins/adlint_cinit.h +1 -1
- data/share/sample/zsh-4.3.15/adlint/builtins/adlint_pinit.h +1 -1
- data/share/sample/zsh-4.3.15/adlint/builtins/adlint_traits.yml +50 -42
- data/share/sample/zsh-4.3.15/adlint/core/GNUmakefile +1 -1
- data/share/sample/zsh-4.3.15/adlint/core/adlint_cinit.h +1 -1
- data/share/sample/zsh-4.3.15/adlint/core/adlint_pinit.h +1 -1
- data/share/sample/zsh-4.3.15/adlint/core/adlint_traits.yml +50 -42
- data/share/sample/zsh-4.3.15/adlint/modules/GNUmakefile +1 -1
- data/share/sample/zsh-4.3.15/adlint/modules/adlint_cinit.h +1 -1
- data/share/sample/zsh-4.3.15/adlint/modules/adlint_pinit.h +1 -1
- data/share/sample/zsh-4.3.15/adlint/modules/adlint_traits.yml +50 -42
- data/share/sample/zsh-4.3.15/adlint/zle/GNUmakefile +1 -1
- data/share/sample/zsh-4.3.15/adlint/zle/adlint_cinit.h +1 -1
- data/share/sample/zsh-4.3.15/adlint/zle/adlint_pinit.h +1 -1
- data/share/sample/zsh-4.3.15/adlint/zle/adlint_traits.yml +50 -42
- data/spec/adlint/{c → cc1}/ctrlexpr_spec.rb +51 -49
- data/spec/adlint/{c → cc1}/domain_spec.rb +210 -179
- data/spec/adlint/{c → cc1}/operator_spec.rb +3 -3
- data/spec/adlint/{c → cc1}/syntax_spec.rb +10 -12
- data/spec/adlint/{c → cc1}/type_spec.rb +61 -68
- data/{lib/adlint/c.rb → spec/adlint/location_spec.rb} +24 -29
- data/spec/conf.d/default_traits.yml +38 -37
- data/spec/conf.d/empty_cinit.h +1 -1
- data/spec/conf.d/empty_pinit.h +1 -1
- data/spec/conf.d/project/foo.c +0 -0
- data/spec/spec_helper.rb +2 -2
- metadata +60 -40
- data/lib/adlint/c/domain.rb +0 -7931
- data/lib/adlint/c/lexer.rb +0 -252
- data/lib/adlint/c/phase.rb +0 -135
- data/lib/adlint/exam/c_builtin/c_check.rb +0 -20745
- data/lib/adlint/exam/c_builtin/c_check_shima.rb +0 -983
- data/lib/adlint/exam/c_builtin/c_code.rb +0 -477
- data/lib/adlint/exam/c_builtin/c_metric.rb +0 -818
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Builtin functions actually called by the interpreter.
|
|
2
2
|
#
|
|
3
3
|
# Author:: Yutaka Yanoh <mailto:yanoh@users.sourceforge.net>
|
|
4
|
-
# Copyright:: Copyright (C) 2010-
|
|
4
|
+
# Copyright:: Copyright (C) 2010-2013, OGIS-RI Co.,Ltd.
|
|
5
5
|
# License:: GPLv3+: GNU General Public License version 3 or later
|
|
6
6
|
#
|
|
7
7
|
# Owner:: Yutaka Yanoh <mailto:yanoh@users.sourceforge.net>
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
# / | / _ |/ / / / | / /__ __/ Source Code Static Analyzer
|
|
12
12
|
# / /| | / / / / / / / |/ / / / AdLint - Advanced Lint
|
|
13
13
|
# / __ |/ /_/ / /___/ / /| / / /
|
|
14
|
-
# /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-
|
|
14
|
+
# /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-2013, OGIS-RI Co.,Ltd.
|
|
15
15
|
#
|
|
16
16
|
# This file is part of AdLint.
|
|
17
17
|
#
|
|
@@ -29,15 +29,15 @@
|
|
|
29
29
|
#
|
|
30
30
|
#++
|
|
31
31
|
|
|
32
|
-
require "adlint/
|
|
33
|
-
require "adlint/
|
|
32
|
+
require "adlint/cc1/type"
|
|
33
|
+
require "adlint/cc1/object"
|
|
34
34
|
|
|
35
35
|
module AdLint #:nodoc:
|
|
36
|
-
module
|
|
36
|
+
module Cc1 #:nodoc:
|
|
37
37
|
|
|
38
38
|
class BuiltinFunction < NamedFunction
|
|
39
|
-
def initialize(
|
|
40
|
-
super(nil,
|
|
39
|
+
def initialize(type_tbl, name)
|
|
40
|
+
super(nil, type_tbl.builtin_function_type, name)
|
|
41
41
|
end
|
|
42
42
|
|
|
43
43
|
def explicit?
|
|
@@ -48,17 +48,17 @@ module C #:nodoc:
|
|
|
48
48
|
true
|
|
49
49
|
end
|
|
50
50
|
|
|
51
|
-
def call(
|
|
52
|
-
|
|
51
|
+
def call(interp, funcall_expr, args)
|
|
52
|
+
interp.create_tmpvar(type.return_type)
|
|
53
53
|
end
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
class InspectFunction < BuiltinFunction
|
|
57
|
-
def initialize(
|
|
58
|
-
super(
|
|
57
|
+
def initialize(type_tbl)
|
|
58
|
+
super(type_tbl, "__adlint__inspect")
|
|
59
59
|
end
|
|
60
60
|
|
|
61
|
-
def call(
|
|
61
|
+
def call(*, args)
|
|
62
62
|
puts "__adlint__inspect"
|
|
63
63
|
args.each { |arg, expr| pp arg }
|
|
64
64
|
puts "EOM"
|
|
@@ -67,20 +67,20 @@ module C #:nodoc:
|
|
|
67
67
|
end
|
|
68
68
|
|
|
69
69
|
class EvalFunction < BuiltinFunction
|
|
70
|
-
def initialize(
|
|
71
|
-
super(
|
|
70
|
+
def initialize(type_tbl)
|
|
71
|
+
super(type_tbl, "__adlint__eval")
|
|
72
72
|
end
|
|
73
73
|
|
|
74
|
-
def call(
|
|
74
|
+
def call(interp, *, args)
|
|
75
75
|
puts "__adlint__eval"
|
|
76
|
-
|
|
77
|
-
if
|
|
78
|
-
without_nil =
|
|
79
|
-
|
|
80
|
-
if
|
|
76
|
+
char_ary = interp.pointee_of(args.first.first)
|
|
77
|
+
if char_ary && char_ary.type.array?
|
|
78
|
+
without_nil = char_ary.value.to_single_value.values[0..-2]
|
|
79
|
+
prog_text = without_nil.map { |char| char.unique_sample.chr }.join
|
|
80
|
+
if prog_text.empty?
|
|
81
81
|
puts "no program text"
|
|
82
82
|
else
|
|
83
|
-
eval
|
|
83
|
+
eval prog_text
|
|
84
84
|
end
|
|
85
85
|
puts "EOM"
|
|
86
86
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# C constant-expression evaluator.
|
|
2
2
|
#
|
|
3
3
|
# Author:: Yutaka Yanoh <mailto:yanoh@users.sourceforge.net>
|
|
4
|
-
# Copyright:: Copyright (C) 2010-
|
|
4
|
+
# Copyright:: Copyright (C) 2010-2013, OGIS-RI Co.,Ltd.
|
|
5
5
|
# License:: GPLv3+: GNU General Public License version 3 or later
|
|
6
6
|
#
|
|
7
7
|
# Owner:: Yutaka Yanoh <mailto:yanoh@users.sourceforge.net>
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
# / | / _ |/ / / / | / /__ __/ Source Code Static Analyzer
|
|
12
12
|
# / /| | / / / / / / / |/ / / / AdLint - Advanced Lint
|
|
13
13
|
# / __ |/ /_/ / /___/ / /| / / /
|
|
14
|
-
# /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-
|
|
14
|
+
# /_/ |_|_____/_____/_/_/ |_/ /_/ Copyright (C) 2010-2013, OGIS-RI Co.,Ltd.
|
|
15
15
|
#
|
|
16
16
|
# This file is part of AdLint.
|
|
17
17
|
#
|
|
@@ -29,20 +29,22 @@
|
|
|
29
29
|
#
|
|
30
30
|
#++
|
|
31
31
|
|
|
32
|
+
require "adlint/traits"
|
|
33
|
+
|
|
32
34
|
module AdLint #:nodoc:
|
|
33
|
-
module
|
|
35
|
+
module Cc1 #:nodoc:
|
|
34
36
|
|
|
35
37
|
module ConstantEvaluator
|
|
36
38
|
# NOTE: Host class of this module must include InterpreterMediator.
|
|
37
39
|
|
|
38
|
-
def eval_constant(
|
|
39
|
-
eval_as_integer_constant(
|
|
40
|
-
eval_as_floating_constant(
|
|
41
|
-
eval_as_character_constant(
|
|
40
|
+
def eval_constant(const_spec)
|
|
41
|
+
eval_as_integer_constant(const_spec.constant.value) or
|
|
42
|
+
eval_as_floating_constant(const_spec.constant.value) or
|
|
43
|
+
eval_as_character_constant(const_spec.constant.value)
|
|
42
44
|
end
|
|
43
45
|
|
|
44
46
|
private
|
|
45
|
-
def eval_as_integer_constant(
|
|
47
|
+
def eval_as_integer_constant(str)
|
|
46
48
|
# NOTE: The ISO C99 standard says;
|
|
47
49
|
#
|
|
48
50
|
# 6.4.4.1 Integer constants
|
|
@@ -78,7 +80,7 @@ module C #:nodoc:
|
|
|
78
80
|
# ll or LL | |
|
|
79
81
|
|
|
80
82
|
# NOTE: For binary constants.
|
|
81
|
-
case
|
|
83
|
+
case str
|
|
82
84
|
when /\A0b([01]+)(?:ULL|LLU)\z/i
|
|
83
85
|
return eval_as_non_decimal_integer_constant_with_ull($1.to_i(2))
|
|
84
86
|
when /\A0b([01]+)LL\z/i
|
|
@@ -94,7 +96,7 @@ module C #:nodoc:
|
|
|
94
96
|
end
|
|
95
97
|
|
|
96
98
|
# NOTE: For octal constants.
|
|
97
|
-
case
|
|
99
|
+
case str
|
|
98
100
|
when /\A0([0-9]+)(?:ULL|LLU)\z/i
|
|
99
101
|
return eval_as_non_decimal_integer_constant_with_ull($1.to_i(8))
|
|
100
102
|
when /\A0([0-9]+)LL\z/i
|
|
@@ -110,7 +112,7 @@ module C #:nodoc:
|
|
|
110
112
|
end
|
|
111
113
|
|
|
112
114
|
# NOTE: For decimal constants.
|
|
113
|
-
case
|
|
115
|
+
case str
|
|
114
116
|
when /\A([0-9]+)(?:ULL|LLU)\z/i
|
|
115
117
|
return eval_as_decimal_integer_constant_with_ull($1.to_i(10))
|
|
116
118
|
when /\A([0-9]+)LL\z/i
|
|
@@ -126,7 +128,7 @@ module C #:nodoc:
|
|
|
126
128
|
end
|
|
127
129
|
|
|
128
130
|
# NOTE: For hexadecimal constants.
|
|
129
|
-
case
|
|
131
|
+
case str
|
|
130
132
|
when /\A0x([0-9A-F]+)(?:ULL|LLU)\z/i
|
|
131
133
|
return eval_as_non_decimal_integer_constant_with_ull($1.to_i(16))
|
|
132
134
|
when /\A0x([0-9A-F]+)LL\z/i
|
|
@@ -144,27 +146,27 @@ module C #:nodoc:
|
|
|
144
146
|
nil
|
|
145
147
|
end
|
|
146
148
|
|
|
147
|
-
def eval_as_floating_constant(
|
|
149
|
+
def eval_as_floating_constant(str)
|
|
148
150
|
# TODO: Must implement hexadecimal-floating-constant evaluation.
|
|
149
|
-
case
|
|
151
|
+
case str
|
|
150
152
|
when /\A([0-9]*\.[0-9]*E[+-]?[0-9]+)\z/i,
|
|
151
153
|
/\A([0-9]+\.?E[+-]?[0-9]+)\z/i,
|
|
152
154
|
/\A([0-9]*\.[0-9]+|[0-9]+\.)\z/
|
|
153
|
-
return
|
|
155
|
+
return create_tmpvar(double_t, scalar_value_of($1.to_f))
|
|
154
156
|
when /\A([0-9]*\.[0-9]*E[+-]?[0-9]+)F\z/i,
|
|
155
157
|
/\A([0-9]+\.?E[+-]?[0-9]+)F\z/i,
|
|
156
158
|
/\A([0-9]*\.[0-9]+|[0-9]+\.)F\z/i
|
|
157
|
-
return
|
|
159
|
+
return create_tmpvar(float_t, scalar_value_of($1.to_f))
|
|
158
160
|
when /\A([0-9]*\.[0-9]*E[+-]?[0-9]+)L\z/i,
|
|
159
161
|
/\A([0-9]+\.?E[+-]?[0-9]+)L\z/i,
|
|
160
162
|
/\A([0-9]*\.[0-9]+|[0-9]+\.)L\z/i
|
|
161
|
-
return
|
|
163
|
+
return create_tmpvar(long_double_t, scalar_value_of($1.to_f))
|
|
162
164
|
end
|
|
163
165
|
nil
|
|
164
166
|
end
|
|
165
167
|
|
|
166
|
-
def eval_as_character_constant(
|
|
167
|
-
if
|
|
168
|
+
def eval_as_character_constant(str)
|
|
169
|
+
if str =~ /\A(L?)'(.*)'\z/i
|
|
168
170
|
case $2.length
|
|
169
171
|
when 0
|
|
170
172
|
char_code = 0
|
|
@@ -175,23 +177,23 @@ module C #:nodoc:
|
|
|
175
177
|
end
|
|
176
178
|
|
|
177
179
|
if $1 == "L"
|
|
178
|
-
|
|
180
|
+
create_tmpvar(wchar_t, scalar_value_of(char_code))
|
|
179
181
|
else
|
|
180
|
-
|
|
182
|
+
create_tmpvar(int_t, scalar_value_of(char_code))
|
|
181
183
|
end
|
|
182
184
|
else
|
|
183
185
|
nil
|
|
184
186
|
end
|
|
185
187
|
end
|
|
186
188
|
|
|
187
|
-
def eval_as_decimal_integer_constant_unsuffixed(
|
|
189
|
+
def eval_as_decimal_integer_constant_unsuffixed(i)
|
|
188
190
|
case
|
|
189
|
-
when
|
|
190
|
-
|
|
191
|
-
when
|
|
192
|
-
|
|
193
|
-
when
|
|
194
|
-
|
|
191
|
+
when int_range.include?(i)
|
|
192
|
+
create_tmpvar(int_t, scalar_value_of(i))
|
|
193
|
+
when long_int_range.include?(i)
|
|
194
|
+
create_tmpvar(long_int_t, scalar_value_of(i))
|
|
195
|
+
when long_long_int_range.include?(i)
|
|
196
|
+
create_tmpvar(long_long_int_t, scalar_value_of(i))
|
|
195
197
|
else
|
|
196
198
|
# NOTE: The ISO C99 standard says;
|
|
197
199
|
#
|
|
@@ -202,18 +204,18 @@ module C #:nodoc:
|
|
|
202
204
|
# has no type.
|
|
203
205
|
#
|
|
204
206
|
# NOTE: Use ExtendedBigIntType for unrepresentable integer constants.
|
|
205
|
-
|
|
207
|
+
create_tmpvar(extended_big_int_t, scalar_value_of(i))
|
|
206
208
|
end
|
|
207
209
|
end
|
|
208
210
|
|
|
209
|
-
def eval_as_decimal_integer_constant_with_u(
|
|
211
|
+
def eval_as_decimal_integer_constant_with_u(i)
|
|
210
212
|
case
|
|
211
|
-
when
|
|
212
|
-
|
|
213
|
-
when
|
|
214
|
-
|
|
215
|
-
when
|
|
216
|
-
|
|
213
|
+
when unsigned_int_range.include?(i)
|
|
214
|
+
create_tmpvar(unsigned_int_t, scalar_value_of(i))
|
|
215
|
+
when unsigned_long_int_range.include?(i)
|
|
216
|
+
create_tmpvar(unsigned_long_int_t, scalar_value_of(i))
|
|
217
|
+
when unsigned_long_long_int_range.include?(i)
|
|
218
|
+
create_tmpvar(unsigned_long_long_int_t, scalar_value_of(i))
|
|
217
219
|
else
|
|
218
220
|
# NOTE: The ISO C99 standard says;
|
|
219
221
|
#
|
|
@@ -224,16 +226,16 @@ module C #:nodoc:
|
|
|
224
226
|
# has no type.
|
|
225
227
|
#
|
|
226
228
|
# NOTE: Use ExtendedBigIntType for unrepresentable integer constants.
|
|
227
|
-
|
|
229
|
+
create_tmpvar(extended_big_int_t, scalar_value_of(i))
|
|
228
230
|
end
|
|
229
231
|
end
|
|
230
232
|
|
|
231
|
-
def eval_as_decimal_integer_constant_with_l(
|
|
233
|
+
def eval_as_decimal_integer_constant_with_l(i)
|
|
232
234
|
case
|
|
233
|
-
when
|
|
234
|
-
|
|
235
|
-
when
|
|
236
|
-
|
|
235
|
+
when long_int_range.include?(i)
|
|
236
|
+
create_tmpvar(long_int_t, scalar_value_of(i))
|
|
237
|
+
when long_long_int_range.include?(i)
|
|
238
|
+
create_tmpvar(long_long_int_t, scalar_value_of(i))
|
|
237
239
|
else
|
|
238
240
|
# NOTE: The ISO C99 standard says;
|
|
239
241
|
#
|
|
@@ -244,16 +246,16 @@ module C #:nodoc:
|
|
|
244
246
|
# has no type.
|
|
245
247
|
#
|
|
246
248
|
# NOTE: Use ExtendedBigIntType for unrepresentable integer constants.
|
|
247
|
-
|
|
249
|
+
create_tmpvar(extended_big_int_t, scalar_value_of(i))
|
|
248
250
|
end
|
|
249
251
|
end
|
|
250
252
|
|
|
251
|
-
def eval_as_decimal_integer_constant_with_ul(
|
|
253
|
+
def eval_as_decimal_integer_constant_with_ul(i)
|
|
252
254
|
case
|
|
253
|
-
when
|
|
254
|
-
|
|
255
|
-
when
|
|
256
|
-
|
|
255
|
+
when unsigned_long_int_range.include?(i)
|
|
256
|
+
create_tmpvar(unsigned_long_int_t, scalar_value_of(i))
|
|
257
|
+
when unsigned_long_long_int_range.include?(i)
|
|
258
|
+
create_tmpvar(unsigned_long_long_int_t, scalar_value_of(i))
|
|
257
259
|
else
|
|
258
260
|
# NOTE: The ISO C99 standard says;
|
|
259
261
|
#
|
|
@@ -264,14 +266,14 @@ module C #:nodoc:
|
|
|
264
266
|
# has no type.
|
|
265
267
|
#
|
|
266
268
|
# NOTE: Use ExtendedBigIntType for unrepresentable integer constants.
|
|
267
|
-
|
|
269
|
+
create_tmpvar(extended_big_int_t, scalar_value_of(i))
|
|
268
270
|
end
|
|
269
271
|
end
|
|
270
272
|
|
|
271
|
-
def eval_as_decimal_integer_constant_with_ll(
|
|
273
|
+
def eval_as_decimal_integer_constant_with_ll(i)
|
|
272
274
|
case
|
|
273
|
-
when
|
|
274
|
-
|
|
275
|
+
when long_long_int_range.include?(i)
|
|
276
|
+
create_tmpvar(long_long_int_t, scalar_value_of(i))
|
|
275
277
|
else
|
|
276
278
|
# NOTE: The ISO C99 standard says;
|
|
277
279
|
#
|
|
@@ -282,14 +284,14 @@ module C #:nodoc:
|
|
|
282
284
|
# has no type.
|
|
283
285
|
#
|
|
284
286
|
# NOTE: Use ExtendedBigIntType for unrepresentable integer constants.
|
|
285
|
-
|
|
287
|
+
create_tmpvar(extended_big_int_t, scalar_value_of(i))
|
|
286
288
|
end
|
|
287
289
|
end
|
|
288
290
|
|
|
289
|
-
def eval_as_decimal_integer_constant_with_ull(
|
|
291
|
+
def eval_as_decimal_integer_constant_with_ull(i)
|
|
290
292
|
case
|
|
291
|
-
when
|
|
292
|
-
|
|
293
|
+
when unsigned_long_long_int_range.include?(i)
|
|
294
|
+
create_tmpvar(unsigned_long_long_int_t, scalar_value_of(i))
|
|
293
295
|
else
|
|
294
296
|
# NOTE: The ISO C99 standard says;
|
|
295
297
|
#
|
|
@@ -300,24 +302,24 @@ module C #:nodoc:
|
|
|
300
302
|
# has no type.
|
|
301
303
|
#
|
|
302
304
|
# NOTE: Use ExtendedBigIntType for unrepresentable integer constants.
|
|
303
|
-
|
|
305
|
+
create_tmpvar(extended_big_int_t, scalar_value_of(i))
|
|
304
306
|
end
|
|
305
307
|
end
|
|
306
308
|
|
|
307
|
-
def eval_as_non_decimal_integer_constant_unsuffixed(
|
|
309
|
+
def eval_as_non_decimal_integer_constant_unsuffixed(i)
|
|
308
310
|
case
|
|
309
|
-
when
|
|
310
|
-
|
|
311
|
-
when
|
|
312
|
-
|
|
313
|
-
when
|
|
314
|
-
|
|
315
|
-
when
|
|
316
|
-
|
|
317
|
-
when
|
|
318
|
-
|
|
319
|
-
when
|
|
320
|
-
|
|
311
|
+
when int_range.include?(i)
|
|
312
|
+
create_tmpvar(int_t, scalar_value_of(i))
|
|
313
|
+
when unsigned_int_range.include?(i)
|
|
314
|
+
create_tmpvar(unsigned_int_t, scalar_value_of(i))
|
|
315
|
+
when long_int_range.include?(i)
|
|
316
|
+
create_tmpvar(long_int_t, scalar_value_of(i))
|
|
317
|
+
when unsigned_long_int_range.include?(i)
|
|
318
|
+
create_tmpvar(unsigned_long_int_t, scalar_value_of(i))
|
|
319
|
+
when long_long_int_range.include?(i)
|
|
320
|
+
create_tmpvar(long_long_int_t, scalar_value_of(i))
|
|
321
|
+
when unsigned_long_long_int_range.include?(i)
|
|
322
|
+
create_tmpvar(unsigned_long_long_int_t, scalar_value_of(i))
|
|
321
323
|
else
|
|
322
324
|
# NOTE: The ISO C99 standard says;
|
|
323
325
|
#
|
|
@@ -328,18 +330,18 @@ module C #:nodoc:
|
|
|
328
330
|
# has no type.
|
|
329
331
|
#
|
|
330
332
|
# NOTE: Use ExtendedBigIntType for unrepresentable integer constants.
|
|
331
|
-
|
|
333
|
+
create_tmpvar(extended_big_int_t, scalar_value_of(i))
|
|
332
334
|
end
|
|
333
335
|
end
|
|
334
336
|
|
|
335
|
-
def eval_as_non_decimal_integer_constant_with_u(
|
|
337
|
+
def eval_as_non_decimal_integer_constant_with_u(i)
|
|
336
338
|
case
|
|
337
|
-
when
|
|
338
|
-
|
|
339
|
-
when
|
|
340
|
-
|
|
341
|
-
when
|
|
342
|
-
|
|
339
|
+
when unsigned_int_range.include?(i)
|
|
340
|
+
create_tmpvar(unsigned_int_t, scalar_value_of(i))
|
|
341
|
+
when unsigned_long_int_range.include?(i)
|
|
342
|
+
create_tmpvar(unsigned_long_int_t, scalar_value_of(i))
|
|
343
|
+
when unsigned_long_long_int_range.include?(i)
|
|
344
|
+
create_tmpvar(unsigned_long_long_int_t, scalar_value_of(i))
|
|
343
345
|
else
|
|
344
346
|
# NOTE: The ISO C99 standard says;
|
|
345
347
|
#
|
|
@@ -350,20 +352,20 @@ module C #:nodoc:
|
|
|
350
352
|
# has no type.
|
|
351
353
|
#
|
|
352
354
|
# NOTE: Use ExtendedBigIntType for unrepresentable integer constants.
|
|
353
|
-
|
|
355
|
+
create_tmpvar(extended_big_int_t, scalar_value_of(i))
|
|
354
356
|
end
|
|
355
357
|
end
|
|
356
358
|
|
|
357
|
-
def eval_as_non_decimal_integer_constant_with_l(
|
|
359
|
+
def eval_as_non_decimal_integer_constant_with_l(i)
|
|
358
360
|
case
|
|
359
|
-
when
|
|
360
|
-
|
|
361
|
-
when
|
|
362
|
-
|
|
363
|
-
when
|
|
364
|
-
|
|
365
|
-
when
|
|
366
|
-
|
|
361
|
+
when long_int_range.include?(i)
|
|
362
|
+
create_tmpvar(long_int_t, scalar_value_of(i))
|
|
363
|
+
when unsigned_long_int_range.include?(i)
|
|
364
|
+
create_tmpvar(unsigned_long_int_t, scalar_value_of(i))
|
|
365
|
+
when long_long_int_range.include?(i)
|
|
366
|
+
create_tmpvar(long_long_int_t, scalar_value_of(i))
|
|
367
|
+
when unsigned_long_long_int_range.include?(i)
|
|
368
|
+
create_tmpvar(unsigned_long_long_int_t, scalar_value_of(i))
|
|
367
369
|
else
|
|
368
370
|
# NOTE: The ISO C99 standard says;
|
|
369
371
|
#
|
|
@@ -374,16 +376,16 @@ module C #:nodoc:
|
|
|
374
376
|
# has no type.
|
|
375
377
|
#
|
|
376
378
|
# NOTE: Use ExtendedBigIntType for unrepresentable integer constants.
|
|
377
|
-
|
|
379
|
+
create_tmpvar(extended_big_int_t, scalar_value_of(i))
|
|
378
380
|
end
|
|
379
381
|
end
|
|
380
382
|
|
|
381
|
-
def eval_as_non_decimal_integer_constant_with_ul(
|
|
383
|
+
def eval_as_non_decimal_integer_constant_with_ul(i)
|
|
382
384
|
case
|
|
383
|
-
when
|
|
384
|
-
|
|
385
|
-
when
|
|
386
|
-
|
|
385
|
+
when unsigned_long_int_range.include?(i)
|
|
386
|
+
create_tmpvar(unsigned_long_int_t, scalar_value_of(i))
|
|
387
|
+
when unsigned_long_long_int_range.include?(i)
|
|
388
|
+
create_tmpvar(unsigned_long_long_int_t, scalar_value_of(i))
|
|
387
389
|
else
|
|
388
390
|
# NOTE: The ISO C99 standard says;
|
|
389
391
|
#
|
|
@@ -394,16 +396,16 @@ module C #:nodoc:
|
|
|
394
396
|
# has no type.
|
|
395
397
|
#
|
|
396
398
|
# NOTE: Use ExtendedBigIntType for unrepresentable integer constants.
|
|
397
|
-
|
|
399
|
+
create_tmpvar(extended_big_int_t, scalar_value_of(i))
|
|
398
400
|
end
|
|
399
401
|
end
|
|
400
402
|
|
|
401
|
-
def eval_as_non_decimal_integer_constant_with_ll(
|
|
403
|
+
def eval_as_non_decimal_integer_constant_with_ll(i)
|
|
402
404
|
case
|
|
403
|
-
when
|
|
404
|
-
|
|
405
|
-
when
|
|
406
|
-
|
|
405
|
+
when long_long_int_range.include?(i)
|
|
406
|
+
create_tmpvar(long_long_int_t, scalar_value_of(i))
|
|
407
|
+
when unsigned_long_long_int_range.include?(i)
|
|
408
|
+
create_tmpvar(unsigned_long_long_int_t, scalar_value_of(i))
|
|
407
409
|
else
|
|
408
410
|
# NOTE: The ISO C99 standard says;
|
|
409
411
|
#
|
|
@@ -414,14 +416,14 @@ module C #:nodoc:
|
|
|
414
416
|
# has no type.
|
|
415
417
|
#
|
|
416
418
|
# NOTE: Use ExtendedBigIntType for unrepresentable integer constants.
|
|
417
|
-
|
|
419
|
+
create_tmpvar(extended_big_int_t, scalar_value_of(i))
|
|
418
420
|
end
|
|
419
421
|
end
|
|
420
422
|
|
|
421
|
-
def eval_as_non_decimal_integer_constant_with_ull(
|
|
423
|
+
def eval_as_non_decimal_integer_constant_with_ull(i)
|
|
422
424
|
case
|
|
423
|
-
when
|
|
424
|
-
|
|
425
|
+
when unsigned_long_long_int_range.include?(i)
|
|
426
|
+
create_tmpvar(unsigned_long_long_int_t, scalar_value_of(i))
|
|
425
427
|
else
|
|
426
428
|
# NOTE: The ISO C99 standard says;
|
|
427
429
|
#
|
|
@@ -432,32 +434,32 @@ module C #:nodoc:
|
|
|
432
434
|
# has no type.
|
|
433
435
|
#
|
|
434
436
|
# NOTE: Use ExtendedBigIntType for unrepresentable integer constants.
|
|
435
|
-
|
|
437
|
+
create_tmpvar(extended_big_int_t, scalar_value_of(i))
|
|
436
438
|
end
|
|
437
439
|
end
|
|
438
440
|
|
|
439
|
-
def
|
|
440
|
-
|
|
441
|
+
def int_range
|
|
442
|
+
int_t.min..int_t.max
|
|
441
443
|
end
|
|
442
444
|
|
|
443
|
-
def
|
|
444
|
-
|
|
445
|
+
def long_int_range
|
|
446
|
+
long_int_t.min..long_int_t.max
|
|
445
447
|
end
|
|
446
448
|
|
|
447
|
-
def
|
|
448
|
-
|
|
449
|
+
def long_long_int_range
|
|
450
|
+
long_long_int_t.min..long_long_int_t.max
|
|
449
451
|
end
|
|
450
452
|
|
|
451
|
-
def
|
|
452
|
-
|
|
453
|
+
def unsigned_int_range
|
|
454
|
+
unsigned_int_t.min..unsigned_int_t.max
|
|
453
455
|
end
|
|
454
456
|
|
|
455
|
-
def
|
|
456
|
-
|
|
457
|
+
def unsigned_long_int_range
|
|
458
|
+
unsigned_long_int_t.min..unsigned_long_int_t.max
|
|
457
459
|
end
|
|
458
460
|
|
|
459
|
-
def
|
|
460
|
-
|
|
461
|
+
def unsigned_long_long_int_range
|
|
462
|
+
unsigned_long_long_t.min..unsigned_long_long_t.max
|
|
461
463
|
end
|
|
462
464
|
end
|
|
463
465
|
|